Trajectories
A trajectory is the structured trace of an agent run: what it decided, what it did, and what happened. Trajectory logging is the transparency layer that makes autonomy auditable.
Why trajectories matter for agents
- Inspectable — Humans and systems can see what the agent did step by step. No black box.
- Verifiable — Outcomes can be rechecked. Did the tests pass? Did the build succeed? Trajectories tie claims to evidence.
- Attributable — When something goes wrong (or right), you can point to the exact decisions and tool calls. That supports debugging, compliance, and improvement.
- Improvable — Trajectories plus outcomes are the training signal. Optimizers and evaluators need (input, decision, outcome) to make policies better.
What gets recorded (conceptually)
- Prompts and model outputs — What the agent was asked and what it replied (e.g. plan, next action).
- Tool calls and results — Which tools were used, with what params, and what they returned (and latency, token use if applicable).
- Verification events — Test runs, build results, lint. The “ground truth” that the trajectory is measured against.
- Decision metadata — Confidence scores, signature names, so that optimization knows which part of the policy to tune.
Trajectories can be stored locally (e.g. REPLAY.jsonl) or, in a protocol like NIP-SA, published as trajectory sessions and events so that auditors and counterparties can see what the agent did without trusting the operator’s word.
Verification-first
The point of a trajectory is to support verification as ground truth. The run produced a trace; the trace can be replayed or checked. Tests and builds are the judge; the trajectory is the evidence. Agent narration is not a substitute.
How trajectories connect to the rest of the stack
- Receipts and payments — A payment or job result can reference a trajectory (or run ID) so that “what was paid for” is tied to “what was done.”
- Optimization — Evaluation and DSPy-style optimizers consume trajectories and outcomes to improve signatures and routing.
- NIP-SA — In the Sovereign Agents protocol, trajectory sessions and events (kinds 39230, 39231) are the standard way to publish execution traces so they can be shared, hashed, and referenced.
Go deeper
- Replay and artifacts: Replay and Artifacts
- Predictable autonomy: Predictable Autonomy
- Sovereign agents (trajectory kinds): Sovereign Agents (NIP-SA)