Repository navigation
Integrations Inspect AI
Experimental: this works and is tested, but may change and gets less hardening than the stable core.
tracekit.integrations.inspect_ai gates every tool call an Inspect AI eval makes,
through Inspect's approval policy: an approver asks the Tracekit signer for
a decision before each call (an ask waits for a person), and a hook records the outcome after the call.
pip install tracekit-ai "inspect-ai>=0.3.288,<0.4"Inspect AI 0.3.288 and later need Python 3.11 or newer. Tested in CI with the newest Inspect AI 0.3.x (0.3.291 on
2026-11-20) on its mockllm model, against a stand-in signer (tracekit.testing.FakeSigner) and, for a held call's
cancelled wait, the real one. Also run by hand with a local model (Qwen3.5-4B, 4-bit, through mlx-lm's OpenAI-compatible
server) on a real signer: its ls call ran and was signed, its sudo rm -rf call was denied with the reason shown to
it, and tracekit verify passed on the run's bundle.
Pass the approver in the eval's approval policy, with a run handle. One run covers the whole eval:
from inspect_ai import eval
from inspect_ai.approval import ApprovalPolicy
from tracekit.integrations.inspect_ai import tracekit
from tracekit.sdk.client import Client
with Client().run(agent="my-eval") as run:
eval(task, model="openai/gpt-5", approval=[ApprovalPolicy(tracekit(run), "*")])Or pass a client and ask for one run per sample, so two samples with the same tool-call ids no longer share a run:
eval(task, model="openai/gpt-5", approval=[ApprovalPolicy(tracekit(client=Client(), per_sample=True), "*")])A sample's run opens at its first tool call and closes when the sample ends, a cancelled one too, once the outcomes of
its calls are recorded; a sample that makes no tool calls gets no run. Each run is registered as agent="inspect";
pass agent= to name it otherwise. The approver tells samples apart by Inspect's own sample identity
(inspect_ai.log._samples.sample_active()), a private part of Inspect checked on inspect-ai 0.3.290: a release that
moves it makes tracekit(..., per_sample=True) raise ImportError, and one whose running sample has no eval_id or
sample_uuid makes the approver raise, which errors the sample before its call runs. A call it can't attribute to a
sample, or whose sample's run didn't open, is refused.
The same policy works from Task(approval=...) and the approval() context manager. Put Tracekit's approver first, or
alone: it approves every call it allows, which ends Inspect's chain, so an approver listed after it (human, say)
never sees the call. To keep another approver in front, have it escalate what it doesn't decide.
Importing the module registers one Inspect hook for the process. It does nothing until a Tracekit approver was made,
tracekit(run) or tracekit(client=..., per_sample=True).
-
Decides before the call runs. The signer decides
call.functionwithcall.arguments, under Inspect's tool-call id. Anaskwaits up to 5 minutes fortracekit approvals approve; Inspect suspends the sample's token, turn and working-time limits while it waits, but not its wall-clocktime_limit. -
Rejects with the reason. A deny, an unanswered or rejected approval, a refused consume, a signer error and an
outage under a closed fail mode all come back as
reject: the tool never runs and the model gets Tracekit's reason as a tool error of typeapproval. A call Tracekit can't decide is refused, never allowed. -
Records what ran. An approver never sees a call's result, so the hook completes each allowed call when Inspect
emits its
ToolEvent:okwith the result, orerrorwith the event's message (aToolErrorthe tool raised, or an error Inspect made for the call). A refused call is never completed: itsToolEventcarries theapprovalerror. -
Completes a cancelled call as an error. A call a sample limit cuts short while it runs gets a
ToolEventwith acancellederror and is completed aserror. A held call whose wait atime_limitcancels has its approval withdrawn: it never ran, and no gap follows. An allowed call cut short after the approver'sapproveand before the tool starts gets noToolEvent: it stays decided, and the signer closes the run with adecided_not_completedgap for it (limits). -
Refuses a call whose id is open, and records changed arguments. A call whose tool-call id is already being
decided or still open in the run is refused, with a reason the model reads (Inspect's model cache can give two
samples the same id). A call whose arguments changed after the decision (an in-process sentinel's
modify) is completed aserror: "the call's arguments changed after the decision". -
Reads the shell tool as a shell. A framework's tool name is matched ignoring case, so Inspect's
bashis decided asBashand itscommandis read as shell code (limits).
-
Bridged agents. For
agent_bridge()andsandbox_agent_bridge()agents, Inspect approves the calls in each model response and the agent runs them itself. A decision there records that the call was permitted, not that it ran: noToolEventwith a result follows, so each such call ends as adecided_not_completedgap. Keep bridged agents out of an eval that uses this approver. -
Tools the packs don't map. Inspect's
python,text_editorandbash_sessiontools aren't in the policy packs'tools:lists. The dev and coding packs only flag them (unknown_tools: flag), and the server packs hold them for a person. Abash_sessioncall'sinputis typed into a shell but isn't read as shell code, so on the dev pack it runs with only a flag. List them in your policy to give them a class. -
One run per eval, or one per sample. By default every sample and epoch records into the run you gave the
approver, and the hook finds a call by Inspect's tool-call id, so a call whose id is still open is refused. With
tracekit(client=Client(), per_sample=True)each sample gets its own run, opened at its first tool call and closed when the sample ends, and the hook finds a call by its sample and id. A retry keeps its sample's run; each epoch is a separate sample execution with its own run. A call the approver cannot attribute to a sample is refused. -
The trio backend. With
INSPECT_ASYNC_BACKEND=trio, the approver's asyncio calls fail, so every call is refused. -
An escalated call. A Tracekit
askis never turned into Inspect'sescalate: the person's answer goes totracekit approvals, not to Inspect's human approver. -
What the model said. Not recorded by the integration. Record the model calls with
tracekit.instrument()or the LLM gateway; see reasoning.
Generated from docs/ at v1.8.1. Edit the docs in the repository, not here.
Get started
- Quickstart: the v2 signer
- Quickstarts
- Spending limits and receipts for any agent
- Quickstart: Claude Agent SDK
- Quickstart: Claude Code
- Quickstart: a custom agent
- Quickstart: LangChain and LangGraph
- Quickstart: MCP client
- Quickstart: OpenAI Agents SDK
- Coding agents other than Claude Code
- tracekit doctor
- Walkthrough: Tracekit end to end
How it works
- How Tracekit works
- Overview
- The life of a tool call
- The evidence format
- Verification and assurance
- Witnesses and monitoring
- Policy
- Approvals
- Detection and containment
- Capture and completeness
- Custody
- Provenance and tracekit why
- Deployment and isolation
- Storage, durability and performance
- Integrations
- Security model
- Architecture
- tracekit why: architecture
Integrations
- Integrations
- Adapters
- Signer API reference
- OpenTelemetry
- Remote clients
- Kubernetes agent-sandbox
- agentgateway
- agentsh and Tracekit
- Browser Use
- Claude Agent SDK
- Claude Code's sandbox
- Codex's sandbox
- CrewAI
- Docker MCP Gateway
- E2B
- Falco
- Gemini CLI's sandbox
- Google ADK
- Haystack
- Hermes Agent
- Inspect AI
- LangChain v1
- LangSmith Tool Gateway
- LiteLLM
- LlamaIndex
- MCP client
- microsandbox
- Microsoft Agent Framework
- OpenAI Agents SDK
- NVIDIA OpenShell
- Pydantic AI
- sandbox-runtime's proxy on its own
- Strands Agents
- Tetragon
- Vercel AI SDK
- Wassette
Policy and approvals
- Your own policy
- Policy reference
- Approvals
- Intent grants: approve costly payments once, with limits
- PCM 0.1: proof-carrying messages
- Findings
- tracekit audit
- Reading the model's reasoning
- Incidents and containment
- Webhooks
Deploy and operate
- Deploying the signer
- The signer as a container
- The signer on Kubernetes
- The compose stack
- Identity
- Tool executor
- A2A gateway
- Latent transfers and C2C
- MCP gateway
- LLM gateway
- Egress observation
- Witnesses
- Log monitor
- Record-key issuer
- Signer observability
- Viewer
- Event Horizon
- Viewer 1.4
- tracekit why: causal investigation and replay
- Migrating
- Platforms
- Deploy the public witness
Verify the evidence
- Tracekit for auditors
- Reading a v2 verify report
- Evidence format v2
- Auditor guide
- Sample evidence bundle
- Signing
- tracekit graph: what agents did across runs
- What Tracekit guarantees
Security and privacy
- Threat model: the v2 signer
- Threat model: the v1 laptop signer
- HTTP security checklist
- Threat-model review packet
- Privacy
- What the public witness sees
- Known limits and trade-offs
- What's stable
Compliance
- Compliance mapping
- EU AI Act
- ISO/IEC 42001
- NIST AI RMF and the Generative AI Profile
- OWASP Top 10 lists for LLM and agentic applications
Evaluation
Use cases and demos
- Use cases
- Demos
- Agent approvers within bounds
- A production bucket
- A production database
- Completeness and tamper evidence
- Detection and containment
- Network coverage: an egress observer
- Guardrails: allow, deny, or ask a person
- MCP tools, gated and recorded
- A production volume
- Prompt injection held by provenance
- Why: which input caused the action
Help