Skip to main content

Testimony Records from CrewAI

pip install testimony-crewai

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

from testimony_crewai import Recorder

def decide(req):
    # req.action, req.args, 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,
)
agent.tools = rec.gate_all(agent.tools)
crew.kickoff()
rec.write("record.jsonl")
$ python3 testimony_validate.py record.jsonl
Conformance: TR-4

Why it wraps tools instead of using a hook

CrewAI has no before-tool hook. step_callback fires after a step, which is enough to observe a tool call and not enough to gate one. crewAI#5888 says so plainly: "the only way to enforce this is by wrapping each tool's _run method individually, which doesn't compose".

So this wraps, and composing is the part it does for you. gate_all returns tools with the same names, descriptions and argument schemas, so the model sees no difference and nothing downstream changes. The inner tool's own run() is what executes, so validation, usage limits and failure policy all still apply. Nothing is monkeypatched.

What it will not do

It will not fail open. If your decide returns anything that is not a decision it issued, the call raises and the tool does not run. openai-agents-python#4845 is the same mistake in a shipped SDK: 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. A gate whose failure mode is allowed is not a gate.

It will not classify risk from anything the model produced. Risk comes from a table you own, and a tool missing from that table raises at wrap time rather than defaulting mid-run.

It will not invent an approver, and it will not let the acting agent approve its own action or accept an identity source the model could have written.

A refusal comes back to the agent as text rather than an exception, because that is how CrewAI already reports a tool that declined, and an agent that can read the refusal can take the other path. The refusal is recorded with the same standing as a permission: a system that records only what it did is a receipt, not an account of itself.

Tests

tests/tests_crewai_testimony.py, 30 checks, run against real CrewAI. CI installs the library and fails if the suite skips.

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

Metadata

Release files for testimony-crewai 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-crewai 0.2.0
File Size Uploaded Provenance
testimony_crewai-0.2.0.tar.gz 37.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 78.3 kB

Release files / testimony_crewai-0.2.0.tar.gz

Download URL testimony_crewai-0.2.0.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0ceea76a68aa137b7acd55c036ed76c516efcdcd2b821087822e453ef26a8b8c
BLAKE2b-256 checksum
How to use checksums
04d59741ca6d849636e3be8a9d6acfdad08638e198e5dd33e7bb4ba0fc03e18a
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_crewai-0.2.0-py3-none-any.whl

Download URL testimony_crewai-0.2.0-py3-none-any.whl
Size 40.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bc6902645bd9b39ef3a99ec1590d1be6ac19ab079b8471008fff4ca15175036
BLAKE2b-256 checksum
How to use checksums
e162b68ee3a95ba5ed7b9ddb81eed7566838ee09238183363d47172574776b2e
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-crewai 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_crewai-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