Skip to main content

Tracekit

Tamper-evident records of what your AI agents actually did.

Every tool call is checked against your policy before it runs, then signed and hash-chained by a signer the agent cannot control. Change, delete or reorder anything afterwards and verification fails.

CI PyPI Python License: MIT

tracekit observe: four coding agents traced live; each dangerous action is blocked by policy and recorded

Why

Agents run commands, edit files and call APIs with your permissions. Afterwards, the record of what they did is usually a log or a transcript the agent's own user can edit or delete, which makes it weak evidence. Tracekit writes that record so it can be checked by anyone, offline, without trusting the agent or the machine it ran on:

  • Before an action: the policy gate blocks it (deny), holds it for a human (ask) or marks it (flag).
  • As it happens: a separate signer, which holds the key and assigns sequence numbers, signs every event into an append-only hash chain. The agent never holds the key.
  • Afterwards: checkpoints go to a witness, and a .tkb bundle verifies offline. Edits, deletions, reordering and a quiet rebuild of the whole log are all detected.

Quickstart

pip install tracekit-ai
tracekit demo               # exit 0

tracekit demo needs no API key, root or config. It runs a scripted agent that is told to upload .env, shows the block, exports the run, verifies it, then edits one recorded command in a copy and shows verification fail.

Trace your own Claude Code sessions (dev mode: the signer runs as your user):

tracekit init --dev
tracekit observe            # the live view above, on http://127.0.0.1:7777
tracekit export --last -o run.tkb
tracekit verify run.tkb --key ~/.tracekit-signer/ledger/signer.pub --witness git:$HOME/.tracekit-signer/witness

Or check the shipped sample bundles with the verifier alone:

tracekit verify docs/sample/demo-run.tkb --key docs/sample/signer.pub            # exit 0
tracekit verify docs/sample/demo-run-tampered.tkb --key docs/sample/signer.pub   # exit 1

What you get

Policy gate Versioned rules with stable ids (TK-D006 uploading a secrets file, TK-D003 force push, ...) decide before a tool runs. ask holds a call until a different OS user approves it.
Signed hash chain Ed25519 signatures over a contiguous sequence, written by tracekitd. Lost events become signed capture.gap records, never silence.
Witnesses Checkpoints of the chain head go to a git remote, a file or a witness service, so even the key holder cannot rebuild history unnoticed.
Offline verification tracekit verify checks a bundle with no network and no Tracekit server, and prints what it proves and what it cannot.
Live observer tracekit observe: agents, actions, blocks, alerts, a per-agent timeline and the evidence behind every row.
Honest coverage The verifier names the blind spots a run touched (subprocess traffic, a same-user signer, an unbound harness) instead of a bare "OK".

How it works

flowchart LR
    A[Agent] --> H[Hooks / SDK]
    H -->|policy gate| S["Signer (tracekitd)"]
    S --> L[Ledger]
    L --> C[Checkpoints]
    C --> W[Witness]
    L --> B[".tkb bundle"]
    B --> V[Offline verify]
  • Hooks and SDKs run before and after each tool call (coding-agent hooks) or around the calls you wrap (Python and TypeScript SDKs). The policy decision is made, and signed, before the tool runs.
  • The signer holds the key and assigns sequence numbers. In Linux system mode it runs as its own OS user, so the agent's user cannot read the key, change the ledger or modify the code that records it.
  • The ledger is append-only JSONL: each record carries the previous record's hash and a signature over (hash, prev_hash, seq).
  • Checkpoints sign the chain head every few records, at every run end and on shutdown, and are published to witnesses outside the attacker's reach.
  • Bundles hold a run's records, checkpoints and policy snapshots, and verify offline against a pinned key or a witness.

What a verified bundle proves

tracekit verify ends with two lines; read them together.

  • Integrity: the records are the ones the signer signed, with none edited, removed or reordered; the head is covered by a checkpoint; every policy decision is tied to the policy snapshot that made it. It is anchored only if you pass the signer's key (--key) or a witness (--witness).
  • Assurance: who could have rewritten the ledger before it was checkpointed. dev means the signer ran as the agent's own user. System mode puts it under a separate OS user.

A verified bundle does not prove intent, complete coverage, or that a reported tool result is real. Anything the agent does outside a capture path (inside a subprocess, after the last hook) is not seen; the verifier lists the blind spots a run touched. Every claim is mapped in the threat model.

Supported today

Capture path Status Docs
Claude Code hooks (and the Claude Code plugin) supported plugin
Codex CLI, Cursor, Gemini CLI hooks supported coding agents
Python SDK (tracekit_sdk.Tracer; tracekit.init() records OpenAI, Anthropic and Gemini calls) supported adapters, examples
TypeScript SDK (@cygnux/tracekit) supported sdk/typescript
LangChain / LangGraph, MCP client sessions supported adapters
OpenTelemetry receiver (tracekit otel serve --experimental) experimental: records after the fact, gates nothing OpenTelemetry

Linux runs dev mode and system mode; macOS runs dev mode and an experimental system mode; Windows runs dev mode only (platforms). Separate packages under contrib/: proofpack (auditor zip), query (SQL and MCP over the ledger), stagehand, causeway, onchain.

System mode (Linux)

sudo /usr/bin/python3 -m tracekit init --user <agent-user> --witness git:/var/lib/tracekit/witness@git@github.com:you/tk-witness.git
tracekit status

Run init with a root-owned Python. It installs Tracekit into a root-owned virtualenv at /opt/tracekit (the same tracekit-ai version from PyPI, or this repository from a root-owned clone), runs the signer as its own OS user, and blocks tool calls while the signer is down (fail closed). tracekit doctor checks that nothing the agent can modify is on that path. Register the agent CLI as the harness (--harness) and the signer accepts runs only from that program's process tree.

Policy and approvals

Rules live in tracekit/policy/default.yaml: deny blocks the call, ask holds it until someone runs tracekit approve or tracekit reject (outside dev mode, a different OS user), and flag lets it through and marks it. strict.yaml fails closed and asks before pushes, publishes and uploads. Rules are regex tripwires that a determined agent can evade; the guarantees come from the signer, the chain and the witness.

Use in CI

Verify a bundle in a GitHub Actions workflow:

- uses: Cygnux-Labs/Tracekit@main
  with:
    bundle: run.tkb
    key: keys/signer.pub        # pin the signer; or witness: git:/path/to/clone

require-anchor defaults to true, so an unanchored bundle fails the step; set require-anchor: "false" to only report it.

CLI

tracekit --help lists every command. The common ones: init, status, doctor, demo, observe, pending / approve / reject, export, verify (exit 0 ok, 1 fail, 2 unusable bundle, 3 warnings with --strict), analyze, uninstall.

Docs

Threat model · signing · witnesses · privacy · findings · evaluation · review packet

Roadmap

Tracekit is being extended from laptop coding agents to server-hosted agents: a signer service that agents reach over the network, evidence format v2 and policy enforced inside the signer. Existing v1 bundles keep verifying.

Contributing and security

See CONTRIBUTING.md: make install, then make check runs lint, tests and the build. Report vulnerabilities privately as described in SECURITY.md.

Licence

MIT, Copyright Cygnux Labs. See LICENSE.

Metadata

Release files for tracekit-ai 0.3.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 tracekit-ai 0.3.0
File Size Uploaded
tracekit_ai-0.3.0.tar.gz 631.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tracekit-ai 0.3.0
File Interpreter ABI Platform
tracekit_ai-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 854.1 kB

Release files / tracekit_ai-0.3.0.tar.gz

Download URL tracekit_ai-0.3.0.tar.gz
Size 631.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c8cd258e68cf72345ce81229124db1d2d1449f5a434cf8813f434a2ee5048253
BLAKE2b-256 checksum
How to use checksums
640cb4fda92a282ab1daf1ae7904320e2b03ce0e4281111ef14b26d05e5f4605
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 Oct 9, 2026.

Transparency log

Release files / tracekit_ai-0.3.0-py3-none-any.whl

Download URL tracekit_ai-0.3.0-py3-none-any.whl
Size 222.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7709cddb02d9901a7a6b91117f1c47df5183992dc8b6d415aefdb301eb75e76
BLAKE2b-256 checksum
How to use checksums
b366596f43a3b5601c7a0167c58ad462c706dc00d73d6d895e0f98914815c14d
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 Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release 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