~/.agentdbg/runs/<run_id>/. These files are the public trace format (spec_version: "0.1") — a stable contract you can rely on for building tooling, writing scripts, or integrating with other systems. Nothing is sent to any server; everything lives on your machine as human-readable JSON.
All AgentDbg releases that share
spec_version "0.1" use the same format. Additive changes (new optional fields, new event types) may be introduced without bumping the spec version. Breaking changes (removed fields, changed types) always result in a new spec_version.Files per run
Each run lives in its own directory:AGENTDBG_DATA_DIR environment variable.
run.json
run.json is created when the run starts and updated when it finishes. It gives you a quick summary of the run without reading the full event log.
Required fields:
counts object:
events.jsonl
events.jsonl is an append-only log where each line is a complete JSON event object. Events are written in the order they occur; when timestamps are identical, the file order is authoritative. AgentDbg flushes after every write so that crashes do not lose the final event.
Event envelope
Every event — regardless of type — has these top-level fields:Event types
Payload schemas
RUN_START
run_namecomes fromAGENTDBG_RUN_NAME, the@trace("name")argument, or a defaultpath:function - YYYY-MM-DD HH:MMlabel.argvvalues matching configured redact keys are replaced with__REDACTED__before being written.
RUN_END
status is either "ok" or "error".
LLM_CALL
promptandresponsemay be strings or objects. They may be redacted (__REDACTED__) or truncated (__TRUNCATED__) based on your configuration.usagefields may benullif the provider did not return token counts.- When
statusis"error", theerrorfield contains an object witherror_type,message, and optionallystackanddetails. provideris one of"openai","anthropic","local", or"unknown".
TOOL_CALL
argsandresultmay be objects, strings, ornull.- When
statusis"error",errorhas the same shape as inLLM_CALL.
STATE_UPDATE
stateis the full snapshot;diffcaptures only what changed.diffmay benullor omitted if not computed.
ERROR
error_typeis the Python exception class name.stackmay benullif no traceback was available.- Guardrail aborts produce an
ERRORevent with additional fields:
LOOP_WARNING
- Each distinct pattern triggers at most one
LOOP_WARNINGper run (deduplicated). - When
stop_on_loopis enabled,LOOP_WARNINGis written first, followed by anERRORevent andRUN_END(status="error").
Redaction and truncation
Before any payload is written to disk, AgentDbg applies redaction and truncation:- Redaction: Field values whose key matches a configured pattern (default:
api_key,token,authorization,cookie,secret,password) are replaced with the string__REDACTED__. Redaction applies toRUN_START.argvoption values and to all event payloads andmetaobjects. - Truncation: Fields that exceed the configured
max_field_byteslimit (default20000bytes) are replaced with__TRUNCATED__.
Using the exported format
When you runagentdbg export, the output file wraps the same data in a single JSON object: