Skip to main content

Governance for autonomous agents. Intercepts every action, enforces policy, writes tamper-evident receipts.

Project description

transient-trace

Governance SDK for AI agents. Intercepts, evaluates, and audits every action an agent takes, with policy enforcement, tamper-evident receipts, and a self-learning rule engine.

Part of Transient, the trust infrastructure for autonomous agents.

Install

pipx install transient-trace

pipx installs into an isolated environment and puts the transient-trace binary on PATH permanently. If you don't have pipx: brew install pipx && pipx ensurepath.

Using pip install directly against the system Python will fail on modern macOS and Linux (PEP 668). Use pipx for CLI tools, or pip install inside a virtual environment.

Upgrade

pipx upgrade transient-trace

Quickstart

The fastest path to governed agents is the wrap command. It installs a persistent shell shim so every invocation of the binary goes through governance automatically, no prefix required.

# Wrap Claude Code and add shims to your shell RC file
transient-trace wrap install claude --auto-rc

# Restart your shell (or source the RC file)
source ~/.zshrc

That's it. Every claude invocation is now governed with a full receipt trail.

# Check governance is active
transient-trace wrap status

# View recent receipts
transient-trace receipts list --since 30m

# Summary with deny rate
transient-trace receipts summary --since 1h

Enforce a policy

By default, transient-trace runs in audit mode — records everything, blocks nothing. To enforce a policy, switch to strict mode:

cat > my-policy.json << 'EOF'
{
  "version": 1,
  "defaultAction": "deny",
  "rules": [
    { "id": "allow-git",       "action": "allow", "actionClasses": ["read", "write_low"] },
    { "id": "allow-anthropic", "action": "allow", "actionClasses": ["network"],
      "hosts": ["api.anthropic.com"] }
  ]
}
EOF

transient-trace run --mode strict --policy "$(cat my-policy.json)" claude -p "..."

Or set strict mode as the permanent default:

transient-trace config set mode strict

How transient-trace intercepts agent actions

transient-trace uses three complementary interception layers:

  1. PATH shims — thin bash scripts for git, curl, and other monitored binaries are prepended to PATH. Shell-resolved calls are caught here.

  2. Popen hooksitecustomize.py is injected via PYTHONPATH into every Python subprocess. It monkey-patches subprocess.Popen to catch calls that use absolute binary paths, bypassing PATH. This is why transient-trace works inside Claude Code without any changes to Claude Code itself.

  3. Inherited environment — both mechanisms are inherited by child processes, giving coverage across nested agents and subprocesses.


Python SDK

For direct integration into Python agents:

from transient_trace import Client

policy = {
    "version": 1,
    "defaultAction": "allow",
    "rules": [{"id": "allow-all", "action": "allow"}]
}

client = Client({"agentId": "my-agent", "policy": policy})

result = client.executeActionWithReceipt(
    lambda: {"ok": True},
    {"target": "resource-1", "action_class": "write_low"}
)

print(result["receipt"]["receipt_id"])       # TR-...
print(result["receipt"]["signature"]["alg"]) # Ed25519
print(result["decision"]["outcome"])         # allow

If policy returns deny, raises RuntimeError: Denied: <reason_code>.

Further reading

  • Transient — full product docs, Recall, Intelligence, receipt bus
  • ATP 1.0 — the open protocol specification underlying every receipt

Key differences from the TypeScript SDK

  • Synchronous API — no await, no asyncio
  • Config is a dictClient({"agentId": "..."}), not keyword args
  • Default policy is deny-all — pass a policy or set ATP_POLICY_PATH

Interoperability with TypeScript SDK

Receipt signatures are cross-verifiable — a receipt signed by the Python SDK can be verified by the TypeScript SDK and vice versa.

  • Canonicalization: RFC 8785 JCS (both SDKs, action receipts)
  • Signing: Ed25519 via PyNaCl (Python) / @noble/curves (TypeScript)

Project details


Download files

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

Source Distribution

transient_trace-0.1.0a7.tar.gz (162.2 kB view details)

Uploaded Source

Built Distribution

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

transient_trace-0.1.0a7-py3-none-any.whl (105.9 kB view details)

Uploaded Python 3

File details

Details for the file transient_trace-0.1.0a7.tar.gz.

File metadata

  • Download URL: transient_trace-0.1.0a7.tar.gz
  • Upload date:
  • Size: 162.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for transient_trace-0.1.0a7.tar.gz
Algorithm Hash digest
SHA256 130ed2aa22da6a076c117c2c0ae0a62f1451849018b08ce6764e5352aa030819
MD5 9722b37f8fbeb6862ed4c0e873c27926
BLAKE2b-256 027029106550a8859d62952a3c2d836e30482a2652b743657d8769fd1fe87f09

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on james-transient/transient-trace

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

File details

Details for the file transient_trace-0.1.0a7-py3-none-any.whl.

File metadata

File hashes

Hashes for transient_trace-0.1.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 dce4f9ac541351243ea4b16797c4ebc515f83c70258589b3c8eee316e7c526ac
MD5 6a93b2d8cd02c9499b97688486a0ee94
BLAKE2b-256 ff33317e2b7ecb5d839823c5e0099bf9b0e3c8bbad56a7a5663b8b714a1eaeb8

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on james-transient/transient-trace

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page