RunLedger launches your agent as a subprocess. A small JSONL adapter sends tool requests to the runner and receives recorded responses during replay.
Python or Node.jsNo model key for these startersRecord → replay → required check
01
Start with a working adapter
Use a new, empty project directory. Have Python 3.9+ available as python and pipx installed. The Node starter also needs Node.js 20+. Both examples use the built-in local search_docs tool.
Initialize a new project
Terminal
pipx install runledger
runledger init
Need a virtual environment instead? Follow the installation walkthrough, then return here after runledger init.
PYTHON · STANDARD LIBRARY
Python adapter
Replaces the generated demo agent. It requests a tool call, reads the returned search result, and emits a structured answer.
Use the exact artifacts directory printed by the record command. Put it in double quotes if the path contains spaces. This saves the passing run as your comparison baseline.
Replay and check the baseline
Terminal
runledger run ./evals/demo --mode replay --baseline baselines/demo.json
Expect PASS again. Open report.html inside the newly printed artifacts directory. To see a failed check, add next_steps to your schema's required fields and replay; the agent does not return it, so the process exits with code 1.
Configure your repository's branch protection or ruleset to require agent-check. A failing command fails the workflow; RunLedger does not configure repository rules for you.
Keep your framework and add an adapter around the tool boundary. The runner needs each tool request and its arguments to record or replay that call.
1
Receive task_start
Read the case input from a JSON line on stdin.
2
Send tool_call
Emit the tool name, arguments, and a unique call_id on stdout.
3
Consume tool_result
Match the response by call_id and pass it back to your agent's tool node or dispatcher.
4
Send final_output
Emit structured output for the schema and other assertions to check.
Replay applies to calls routed through the runner
Your agent still executes. Model or network calls made outside the adapter remain live. Reserve stdout for JSONL messages and write diagnostic logs to stderr. For your own tools, configure tool_module and tool_registry in the suite.