Skip to content

← All guides

Archive memory guide

This integration guide is preserved for existing users. Memory is now a supporting primitive under Novyx change control, not the main product path.

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

OpenAI Agents SDK v0.14 added sandboxes, workspace memory, and snapshot/resume. It didn't add tamper-evident audit context, policy-gated actions, or governed recovery workflows. novyx-openai-agents wires those controls onto the Runner lifecycle via RunHooks — your existing Agent, tools, and prompts don't change, and supported Novyx-managed state can be checkpointed for recovery.

The Problem

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

  • Traces are debugging — they are not an action approval gate or a complete incident record
  • 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: lifecycle events are recorded for audit review, checkpoints are created at safe boundaries (end of run, agent handoffs), and supported Novyx-managed state can be recovered 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

Tool calls, model turns, and handoffs are recorded as audit context. Traces are debugging; Novyx adds reviewable evidence for governed actions.

Checkpoint recovery

Checkpoints capture supported Novyx-managed state at safe boundaries. Use recovery for incident handling, without assuming every external side effect is reversible.

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 recover when needed

Every tool call + model turn is recorded for audit review. If the run went sideways, await hooks.rollback_to_latest() recovers supported Novyx-managed state from 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 context, policy-gated actions for risky writes, and checkpoint recovery on supported Novyx state. It does not promise a universal transaction over every context pointer, capability binding, policy snapshot, and external side effect.

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?

Checkpoint recovery is available on supported Novyx-managed state. Use hooks.rollback_to_latest() as a recovery helper, not as a guarantee that every external side effect or runtime binding is transactionally rewound.

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: audit context, approvals, and supported recovery workflows. 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.

Next protected action

Name the production action your agents cannot perform yet

Start with a 25-minute readiness call for one blocked workflow.

Book a readiness call

Name the production action your coding agents are not allowed to perform yet.

Email us at:

sales@novyxlabs.com

Include the agent tool, blocked production action, decision deadline, and the budget owner who should join. We will reply with fit and scheduling options for a 25-minute call.