Skip to main content
Every harness decision produces a trace record. Traces provide a full audit trail for debugging, compliance reporting, and performance tuning.

Trace Format

Each trace record contains:

Accessing Traces

Example output:

Observe vs Enforce

In observe mode, traces record what the harness would do:
  • applied is always false
  • Agent execution continues regardless of the action
In enforce mode, traces record what the harness did:
  • applied is true when the action was enforced
  • stop actions halt execution
  • deny_tool actions 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
This makes traces safe for logging, external storage, and compliance reporting without data classification concerns.

Callbacks

Register callbacks to receive trace records in real time:

Session Summary

In addition to per-step traces, session.summary() provides aggregate metrics: