rootsign.wrap_crewai_tools(), open a rootsign.session() around the run, and start the crew with kickoff_async(). Tool names, descriptions and argument schemas are untouched, so the agent sees the same tools.
Supported versions
Older releases do not work with RootSign: CrewAI 0.28.x conflicts with RootSign’s
typer requirement, and releases up to 0.86 import pkg_resources, which Python 3.12 environments no longer include. The contract suite runs on Python 3.12. CrewAI’s own wheels can lag on 3.13 and 3.14; if pip reports No matching distribution found for crewai, use Python 3.12.
Install
Instrument your crew
This is a complete crew. It runs offline because the LLM is scripted: it replays three replies (callsend_invoice, call log_payment, give the final answer). Everything else is a normal CrewAI crew, and CrewAI’s agent loop is the path RootSign intercepts in production.
crew.py
rootsign.init(...), async with rootsign.session(...), and rootsign.wrap_crewai_tools([...]) around the agent’s tools. To use a real model, pass your usual llm= to the Agent instead of ScriptedLLM; the RootSign lines stay the same. The scripted LLM needs CrewAI 0.120 or later, the first release that exports BaseLLM.
Run it:
Verify the session
Start the crew with kickoff_async()
Two ways to instrument tools
Both produce the same records.rootsign.trace() must sit above @tool, so it receives the finished CrewAI tool. A tool that is already instrumented is skipped by wrap_crewai_tools(), so it is never recorded twice.
What gets recorded
Each tool call adds oneACTION_RECORD. tool_name is the CrewAI tool’s name, the string you gave @tool(...). CrewAI passes arguments by keyword, so they appear under kwargs:
{"result": "invoice sent to acme-corp for $1,500.00"}. If the tool raises, the call is still recorded, with an empty output, and the exception reaches CrewAI unchanged. If RootSign cannot write the record, it logs a warning and the tool call completes normally.
How interception works
wrap_crewai_tools() replaces _run on each tool instance in place and returns the same objects, so they stay CrewAI tools and Agent(tools=...) accepts them. RootSign recognises a CrewAI tool by its shape (a string name and a callable _run) rather than by importing CrewAI, so pip install rootsign works without the crewai extra. The session and storage are looked up at each call, so you can define tools at import time. The design is in ADR-005.
Limitations
- Human approval is not available on CrewAI tools.
@rootsign.trace(require_approval=True)on a CrewAI tool raisesNotImplementedError. Put the approval on the plain function the tool calls instead. - CrewAI tools are synchronous. When CrewAI calls
_runinside a running event loop, RootSign writes the record from a worker thread. On the PostgreSQL backend, do not share a SQLAlchemyAsyncSessionacross that boundary.
Full example
The crew above isexamples/crewai-jsonl in the repository. CI runs it on the CrewAI 0.203.x and 1.x lines; it has also been run on 0.120.1 and 1.6.1.
LangGraph and LangChain
Instrument the tools in a LangGraph agent.
Any Python function
Record calls to functions that are not framework tools.