Skip to content

← All guides

Governance for OpenAI Agents SDK (audit, rollback, policy) in one line

OpenAI Agents SDK v0.14 added sandboxes, workspace memory, and snapshot/resume. It didn't add tamper-evident audit chains, policy-gated actions, or transactional rollback. novyx-openai-agents wires all three onto the Runner lifecycle via RunHooks — your existing Agent, tools, and prompts don't change, but every tool call and model turn lands in Novyx's audit chain and every run is rewindable by checkpoint.

The Problem

What openai-agents v0.14 ships vs what production agents need:

  • Traces are debugging — no hash chain, no tamper detection, no forensic non-repudiation
  • Tool calls fire immediately — no approval gate for risky actions (shell, filesystem, API writes)
  • Snapshots resume the sandbox workspace — they don't rewind the agent's governed state
  • Sandbox memory lives inside the workspace — it's not cross-runtime, not auditable, not policy-aware
  • You want to keep using OpenAI's Runner — but you need what OpenAI didn't ship underneath it

The Solution: Novyx

novyx-openai-agents wraps OpenAI's RunHooks interface. Pass one NovyxRunHooks to Runner.run(..., hooks=hooks) and you get governance without behavior change: every lifecycle event is recorded in Novyx's SHA-256 audit chain, checkpoints are created at safe boundaries (end of run, agent handoffs), and you can roll back the full governed state after the fact.

Published the day OpenAI shipped v0.14. Pinned against openai-agents>=0.14.0,<0.15 to protect your installs from signature drift.

Quick Start

One pip install pulls novyx-openai-agents, the Novyx SDK, and a compatible openai-agents version:

bash
pip install novyx-openai-agents

The Agent + Runner code below is the example shipped with the package. Set NOVYX_API_KEY and OPENAI_API_KEY in your environment and run it — every tool call and model turn is now in Novyx's audit chain:

python
import asyncio
import os

from agents import Agent, Runner, function_tool
from novyx_openai_agents import NovyxRunHooks


@function_tool
def lookup_weather(city: str) -> str:
    """Pretend to look up the weather for a given city."""
    return f"The weather in {city} is mild and sunny."


async def main() -> None:
    agent = Agent(
        name="weather-demo",
        instructions="You answer weather questions using the lookup_weather tool.",
        tools=[lookup_weather],
    )

    hooks = NovyxRunHooks(
        api_key=os.environ["NOVYX_API_KEY"],
        agent_id="weather-demo",
    )

    result = await Runner.run(agent, "What's the weather in Lisbon?", hooks=hooks)
    print("Agent output:", result.final_output)

    # Every lifecycle event above is now in Novyx's audit chain.
    # Inspect it via the Novyx Console, or roll back if something
    # went wrong during the run:
    #
    #   await hooks.rollback_to_latest()


if __name__ == "__main__":
    asyncio.run(main())

What You Get

Tamper-evident audit chain

Every tool call, model turn, and handoff appended to a SHA-256 hash chain. Any mid-stream edit breaks the chain and is detected on verification. Traces are debugging — this is forensics.

Transactional rollback

Checkpoints capture the agent's governed state — context, memory pointers, capability bindings, policy snapshot — as a single transaction. Rewind to any checkpoint, audit chain preserved.

Policy-gated actions

Write YAML policies that evaluate before risky tool calls fire. Approve, deny, or pause-for-review — all decisions recorded in the audit chain.

Complements, doesn't compete

Keep using OpenAI Agents SDK's sandboxes, workspace memory, and snapshot/resume. Novyx sits underneath for governance. Both active together; one line of setup.

How It Works

1

Install the package

pip install novyx-openai-agents. Python 3.10+ required. Pulls novyx>=3.4 and openai-agents>=0.14,<0.15 as dependencies.

2

Get a Novyx API key

Run novyx setup to provision a free key, or visit novyxlabs.com/get-started. Format: nram_<tenant>_<timestamp>_<signature>. Set NOVYX_API_KEY in your environment.

3

Wrap your Runner.run call

Create one NovyxRunHooks(api_key=..., agent_id=...) and pass it to Runner.run(agent, input, hooks=hooks). No other code changes.

4

Inspect the audit chain (and roll back when you need to)

Every tool call + model turn is now in Novyx's audit chain. If the run went sideways, await hooks.rollback_to_latest() rewinds the governed state to the last checkpoint.

Frequently Asked Questions

What does novyx-openai-agents add on top of the OpenAI Agents SDK?

Three things OpenAI Agents SDK v0.14 does not ship: tamper-evident audit chain (every tool call and model turn appended to a SHA-256 chain), policy-gated actions (writes to GitHub, Slack, databases evaluated against your policies before they fire), and transactional rollback (rewind the agent's governed state — context, memory pointers, capability bindings, policy snapshot — in one transaction, with the audit chain preserved through the rewind).

Do I have to change my existing Agent + Runner code?

No. NovyxRunHooks implements OpenAI's RunHooks interface. Pass it to Runner.run(..., hooks=hooks) and every lifecycle event is recorded. Your Agent, tools, and prompts stay exactly as they are.

What Python version and SDK version do I need?

Python 3.10+, openai-agents>=0.14.0,<0.15 (pinned to guard against signature drift), and novyx>=3.4.0. All three install together with a single pip install novyx-openai-agents.

Can I roll back a run after it finishes?

Yes. A checkpoint is created at the end of each run by default. Call hooks.rollback_to_latest() and the mission state rewinds to that checkpoint, audit chain preserved.

Does this replace the OpenAI Agents SDK workspace memory?

No — it complements it. OpenAI's workspace memory surfaces prior-run lessons into later runs (great for task continuity). Novyx adds the governance layer underneath: forensics, approvals, and transactional rewind. Use both.

Read the background on why we shipped this the day OpenAI released v0.14. Full SDK reference on docs.novyxlabs.com. Package source at novyxlabs/novyx-core.

Prefer a memory-as-tool integration (use novyx.remember() and novyx.recall() as @function_tool decorators)? See the guides index for the memory-focused walkthrough.

Start Building with Persistent Memory

5,000 memories free. No credit card required.

Start Free

Enter your email to create your developer account.