Skip to main content
@rootsign.trace() records calls to any Python function, so you can audit a hand-written agent, a script, or the tools of a framework RootSign has no adapter for. Each call to a decorated function adds one hash-chained ACTION_RECORD with its arguments and its result. No extra is needed:

Instrument your functions

tools.py

Verify the session

What gets recorded

  • tool_name defaults to the function’s name. Pass tool_name= to record a different one.
  • Positional and keyword arguments are recorded separately, as you passed them.
  • When the function raises, the call is still recorded with an empty output, and the exception reaches your code unchanged. The error message itself is not recorded.

The decorated function is async

@rootsign.trace() always returns an async function, even when the function you decorate is synchronous. Call it with await, as lookup_customer is called above. Calling it without await returns a coroutine and nothing runs or gets recorded.
Calls must happen inside async with rootsign.session(...). Outside a session, the call raises RootSignNotInitializedError with the two lines that fix it.

Options

See Redact PII and Require human approval.

LangChain and CrewAI tools

If you put @rootsign.trace() on a LangChain BaseTool or a CrewAI tool, RootSign detects it and instruments the tool in place instead, so it stays a tool your framework accepts. For tool lists, use rootsign.wrap_tools() for LangChain and LangGraph, or rootsign.wrap_crewai_tools() for CrewAI.

LangGraph and LangChain

Instrument the tools in a LangGraph agent.

CrewAI

Instrument the tools of a CrewAI agent.

How it works

What the hash covers and what each verdict means.