Repository navigation
Integrations CrewAI
Experimental: this works and is tested, but may change and gets less hardening than the stable core.
tracekit.integrations.crewai gates every tool call a CrewAI crew makes, through CrewAI's global tool hooks: before
each call it asks the Tracekit signer for a decision (an ask waits for a person), and after the call it records the
outcome.
pip install tracekit-ai "crewai>=1.15.27,<1.16"Tested in CI against a stand-in for CrewAI's tool hooks, not the real library. The case study ran CrewAI 1.15.27 with hand-written hook glue, not this module.
import tracekit; tracekit.instrument() before the crew runs registers both hooks, and records the model calls CrewAI
makes through the OpenAI, Anthropic and Google Gen AI SDKs (autotrace). By hand:
from crewai.hooks import register_after_tool_call_hook, register_before_tool_call_hook
from tracekit.integrations.crewai import hooks
from tracekit.sdk.client import Client
run = Client().run(agent="support-crew")
before, after = hooks(run)
register_before_tool_call_hook(before)
register_after_tool_call_hook(after)-
Blocks by return value. CrewAI runs a tool when a before hook raises, so the before hook never raises: it returns
False, which blocks the call, on anything but an allow or an approved ask. That covers a deny, a rejected or unanswered approval, a refused consume, a signer refusal, an outage under a closed fail mode and any error of its own. Under an open fail mode, a call runs unrecorded during an outage, with a warning. - Tells the model why. For a blocked call the after hook replaces CrewAI's "Tool execution blocked by hook" with Tracekit's reason (the rule ids, or what the approval came to).
-
Records failures as failures. CrewAI hands the after hook a failed tool's exception as the text
Error executing tool: ...; that is recorded asstatus: error. Other results are recorded as the text the model reads, and in full for a tool the policy lists as untrusted (provenance). -
Waits for people. An
askwaits up to 5 minutes (the signer's cap for one wait) before the call; then it is blocked with the approval's state.
Not recorded by the integration: CrewAI's after-LLM hook sees a text answer only, never a response that asks for a
tool, and no reasoning; its tool hooks carry no call id. Record the model calls with tracekit.instrument() or the
LLM gateway; they pair with the calls by arguments only. Which frameworks and providers return readable reasoning, and how to turn it on: reasoning.
- CrewAI's hooks carry no tool-call id, so each call gets one of its own (
crewai-<hex>). Under autotrace or the LLM gateway the reconciler pairs it with the model's tool use of the same turn by its arguments (paired_by_argsonrun.final). Two calls of the same tool with the same arguments in one turn can't be told apart: both are reported (reconcile.hook_missingandreconcile.fabricated). So are calls whose decide lands after another agent's model call in the same run (async tasks, or several crews ininstrument()'s one process run): give each its own run. - On CrewAI's text (ReAct) path, for models without native tool calling, CrewAI retries a failing tool inside one call of its hooks: the retries run under that call's one decision, and only the last outcome is recorded. A failure there ("I encountered an error while trying to use the tool") is recorded as an error, as on the native path.
- Delegation between agents (
delegate_work_to_coworker,ask_question_to_coworker) is decided like any tool: give those tools a class in your policy to gate them. - A tool that runs other than through CrewAI's tool execution (a tool calling another tool directly in Python) is not seen.
Generated from docs/ at v1.4.1. Edit the docs in the repository, not here.
Get started
- Quickstart: the v2 signer
- Quickstarts
- Quickstart: Claude Agent SDK
- 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
- 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
- LangChain v1
- 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
- Policy reference
- Approvals
- Findings
- 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
- MCP gateway
- LLM gateway
- Egress observation
- Witnesses
- Log monitor
- Record-key issuer
- Signer observability
- Viewer
- tracekit why: causal investigation and replay
- Migrating
- Platforms
Verify the evidence
- Reading a v2 verify report
- Evidence format v2
- Auditor guide
- Sample evidence bundle
- Signing
- 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
- 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
Demos
- Demos
- Agent approvers within bounds
- Completeness and tamper evidence
- Detection and containment
- Network coverage: an egress observer
- Guardrails: allow, deny, or ask a person
- MCP tools, gated and recorded
- Prompt injection held by provenance
- Why: which input caused the action
Help