Skip to main content
RootSign records every tool call a CrewAI agent makes. You pass the agent’s tool list through 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 (call send_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
The three RootSign lines are 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:
CrewAI also prints its own progress output, and on the first run it may ask whether you want to view execution traces. Both come from CrewAI.

Verify the session

The LLM’s reasoning and the crew’s final answer are not recorded. RootSign records tool calls: what ran, with which arguments, and what it returned.

Start the crew with kickoff_async()

Inside async with rootsign.session(...), start the crew with await crew.kickoff_async(). Recent CrewAI 1.x releases raise RuntimeError: Agent execution was invoked synchronously from within a running event loop if you call crew.kickoff() there. This was observed on CrewAI 1.15.41; 1.6.1 and 0.203.2 still accepted kickoff(). kickoff_async() works on every supported version.

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 one ACTION_RECORD. tool_name is the CrewAI tool’s name, the string you gave @tool(...). CrewAI passes arguments by keyword, so they appear under kwargs:
The output is the tool’s return value, for example {"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

Calls must happen inside a session. A wrapped tool called outside async with rootsign.session(...) raises RootSignNotInitializedError, unless you pass ctx= and client= to wrap_crewai_tools() yourself.
  • Human approval is not available on CrewAI tools. @rootsign.trace(require_approval=True) on a CrewAI tool raises NotImplementedError. Put the approval on the plain function the tool calls instead.
  • CrewAI tools are synchronous. When CrewAI calls _run inside a running event loop, RootSign writes the record from a worker thread. On the PostgreSQL backend, do not share a SQLAlchemy AsyncSession across that boundary.

Full example

The crew above is examples/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.