AgentDbg stores every agent run as two plain files underDocumentation Index
Fetch the complete documentation index at: https://refinehq.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
~/.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:
| Field | Type | Description |
|---|---|---|
spec_version | string | Always "0.1" |
run_id | string | UUIDv4 — unique identifier for this run |
run_name | string | null | Optional human-readable label |
status | string | "running" while active · "ok" on success · "error" on failure |
started_at | string | UTC ISO8601 timestamp with milliseconds, e.g. "2026-04-12T10:30:00.000Z" |
ended_at | string | null | Set when the run finishes; null while still running |
duration_ms | integer | null | Total run duration in milliseconds; null while running |
counts | object | Cumulative event counts (see below) |
last_event_ts | string | null | Timestamp of the last event; set when the run finalizes |
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:| Field | Type | Description |
|---|---|---|
spec_version | string | "0.1" |
event_id | string | UUIDv4 — unique per event |
run_id | string | UUIDv4 — run this event belongs to |
parent_id | string | null | UUIDv4 of a parent event, or null |
event_type | string | One of the event types listed below |
ts | string | UTC ISO8601 with milliseconds and trailing Z |
duration_ms | integer | null | Duration in milliseconds if applicable; otherwise null |
name | string | Label — tool name, model name, run name, etc. |
payload | object | Event-type-specific data (see schemas below) |
meta | object | Freeform metadata — tags, user-defined fields |
Event types
| Type | Description |
|---|---|
RUN_START | Emitted when the traced function begins |
RUN_END | Emitted when the traced function finishes (ok or error) |
LLM_CALL | One LLM invocation — model, prompt, response, usage |
TOOL_CALL | One tool invocation — name, args, result, status |
STATE_UPDATE | State snapshot or diff captured between agent steps |
ERROR | An exception was captured |
LOOP_WARNING | A repeated pattern was detected in recent events |
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: