Trace Format
Each trace record contains:| Field | Type | Description |
|---|---|---|
action | string | "allow", "switch_model", "deny_tool", or "stop" |
reason | string | Human-readable explanation of the decision |
model | string | Model name used for the call |
step | int | Step number in the run (1-indexed) |
cost_total | float | Cumulative cost in USD at this step |
budget_state | string | "ok", "warning", or "exceeded" |
applied | bool | true if the action was enforced, false in observe mode |
Accessing Traces
Observe vs Enforce
Inobserve mode, traces record what the harness would do:
appliedis alwaysfalse- Agent execution continues regardless of the action
enforce mode, traces record what the harness did:
appliedistruewhen the action was enforcedstopactions halt executiondeny_toolactions block tool calls
Privacy
Decision traces do not contain prompt content, response content, or user data. They only contain:- Model names and step numbers
- Cost and budget metrics
- Action decisions and reasons
Callbacks
Register callbacks to receive trace records in real time:Session Summary
In addition to per-step traces,session.summary() provides aggregate metrics: