Skip to main content

Testimony Records from CrewAI

Packaged and tested; the first publish to PyPI is pending, so for now it is 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/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testimony_crewai-0.1.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testimony_crewai-0.1.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file testimony_crewai-0.1.0.tar.gz.

File metadata

  • Download URL: testimony_crewai-0.1.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for testimony_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c8317eea67cb620af003de94d6d3354ca6555f5669cebf1cd4309e3bef8d581
MD5 2331909cfd3084b0e16ebefccbae60ab
BLAKE2b-256 4bf5b1aaa34c216534c1674de99e03b2e57e461f5a18bfe90d4d65c8a49e915c

See more details on using hashes here.

Provenance

The following attestation bundles were made for testimony_crewai-0.1.0.tar.gz:

Publisher: release-adapter.yml on troybrandonc-bit/machine-testimony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file testimony_crewai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for testimony_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65490b241344710dcc2b7a25d64a772f44a1d427ba5667eef60ab726bbad3326
MD5 11448861722866f064f4390c9fa1a664
BLAKE2b-256 0e54fda2a0b2bb787b7dd19734b17a6714f9a512238dba255a63b2131bf093f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for testimony_crewai-0.1.0-py3-none-any.whl:

Publisher: release-adapter.yml on troybrandonc-bit/machine-testimony

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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