Format
The event log is NDJSON — one JSON object per line, emitted in chronological order. Every object has an"event" field identifying its type and a "ts" field with a Unix
timestamp in milliseconds.
Output destination
By default, events are written to stdout, interleaved with your agent’s own output. To separate them, configure file output:Guaranteed events
Every execution emits exactly these two events, in this order:ExecutionStarted
Always the first event. Emitted immediately before the child process is spawned.ExecutionStopped
Always the last event. Emitted on every exit path — clean exit, timeout, error, or signal.reason will be one of the stop reasons listed in
Limits & Enforcement.
SDK events
When the Rust SDK macros or Python SDK decorators are active, additional events are emitted for each tool call. These appear betweenExecutionStarted and ExecutionStopped:
| Event | When emitted |
|---|---|
StepCompleted | After each agent step |
ToolAllowed | When Nanny permits a tool call |
ToolDenied | When Nanny blocks a tool call (not in allowlist, or rule fired) |
ToolFailed | When a permitted tool fails at runtime (network error, bad args, etc.) |
AgentScopeEntered | When a #[nanny::agent("name")] function is entered |
AgentScopeExited | When a #[nanny::agent("name")] function returns |
ToolFailed is distinct from ToolDenied — the tool was allowed but encountered an error.
No cost is charged on tool failure.