Skip to main content

Testimony Records from the OpenAI Agents SDK

pip install testimony-openai-agents

Or one file: copy testimony_openai_agents.py and testimony_emit.py next to your agent. There is nothing else to install and nothing here depends on OMEM.

from agents import Agent, Runner, function_tool
from testimony_openai_agents import Recorder

def decide(req):
    # req.action, req.arguments, req.risk_class.
    # Your approval UI, queue or ticket goes here. The identity has to come
    # from your authentication layer; this adapter has none to find.
    if req.action == "close_account":
        return req.refuse("a balance is outstanding")
    return req.approve(approver={"id": "r.okonkwo@example.com", "kind": "human"},
                       identity_source="auth-session")

rec = Recorder(
    agent={"id": "support-agent", "kind": "agent"},
    risk={"issue_refund": "high", "close_account": "high",
          "search_docs": "low"},
    decide=decide,
)
result = await rec.run(Runner, agent, "Refund order 8842")
rec.write("record.jsonl")
$ python3 testimony_validate.py record.jsonl
Conformance: TR-4

This SDK already has the gate. It cannot say who opened it

Unlike the other adapters here, nothing in this one adds an approval boundary. needs_approval on a tool already stops the run, result.interruptions already lists what is waiting, and state.approve(item) already lets it through. That machinery is good and this does not replace it.

What state.approve(item) does not take is a principal. It records that a call was approved, not by whom, and any code holding the state can call it, including the process that proposed the action. So a run where an engineer read the arguments and decided is indistinguishable afterwards from one where a script approved everything.

An assessment of eight agent systems published in September 2026 recorded exactly that for this SDK: whether an approval identifies a person, whether the identity comes from the authentication layer, and whether the agent is prevented from approving its own action were all absent, and in each case because there is nowhere to put the answer.

This does not fix that by inventing an approver. It fixes it by refusing to write an approval unless you supply an identity from your own authentication layer, and by making the omission visible rather than silent.

What it will not do

It will not fail open. #4845 is the neighbouring mistake in this very SDK, one layer down: a callable needs_approval predicate returned None from an unhandled branch, None read as "no approval needed", and the gate opened on the path nobody had thought about. If your decide returns anything that is not a decision this issued, the run raises and the tool does not execute.

It will not classify risk from anything the model produced, let the acting agent approve its own action, or accept an identity source the model could have written.

A refusal is passed to state.reject with your reason as the rejection message, so the model is told why rather than told nothing, and it is recorded with the same standing as a permission.

Tests

tests/tests_openai_agents_testimony.py, 29 checks, against a real Runner with no API key and no network: only the model is scripted, against the SDK's public Model interface. The agent, the Runner, the tool, the interruption, to_state and approve/reject are all the real ones, because those are what is under test.

MIT. Copyright 2026 Garnet Taurus Ltd. The specification: https://datatracker.ietf.org/doc/draft-clifford-testimony-record/

Metadata

Release files for testimony-openai-agents 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for testimony-openai-agents 0.2.0
File Size Uploaded Provenance
testimony_openai_agents-0.2.0.tar.gz 38.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for testimony-openai-agents 0.2.0
File Interpreter ABI Platform
testimony_openai_agents-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 79.2 kB

Release files / testimony_openai_agents-0.2.0.tar.gz

Download URL testimony_openai_agents-0.2.0.tar.gz
Size 38.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f9511ae4db4961572388ffe992c4a9cc9c1d7e700caada9e69de3b9df58883b
BLAKE2b-256 checksum
How to use checksums
2e47af8785089cc69e54011867b4e14ca2ef25083fb517fcbbaae8b4358c9680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / testimony_openai_agents-0.2.0-py3-none-any.whl

Download URL testimony_openai_agents-0.2.0-py3-none-any.whl
Size 40.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
691e52c787d436442c383090b8722d8d8a8b945ff27fe5d1f308bbb7bcf84b3f
BLAKE2b-256 checksum
How to use checksums
95084fef20490482935c4b5f64e63961ca4781cf46b565c6a1c51b460ce1a31b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Security for testimony-openai-agents 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for testimony_openai_agents-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page