Log every decision#
onDecision (Python and Ruby: on_decision) gets one event per phase of every call: once for the before-guards and once for the after-guards when the tool ran.
createHarness({ agent: "support-bot", guards: [guards.grounding({ mode: "monitor" }), guards.permissions()], onDecision: (e) => logger.info({ run: e.run, tool: e.tool, phase: e.phase, kind: e.kind, guard: e.guard, reason: e.reason, ms: e.ms }), onAlert: (e) => logger.warn({ run: e.run, tool: e.tool, guard: e.guard, decision: e.decision.kind, reason: e.decision.reason }),});Decision event#
| Field | Meaning |
|---|---|
| run | The run id |
| agent | The agent slug |
| tool | The tool name |
| callId (Python and Ruby: call_id) | The tool call id |
| phase | before or after |
| kind | The final decision for this phase |
| guard | The guard that decided, when it was not proceed |
| reason, message | From the deciding guard |
| results | Every guard's answer, in every mode: guard, mode, decision, and error when it threw |
| ms | Time spent in the guards |
Alert event#
Sent when a guard in monitor mode answers anything other than proceed: run, agent, tool, callId (call_id), phase, guard and the decision it would have made.
A hook that throws is ignored; it never changes a decision. Neither event carries the task token.
Roll out a guard#
- Add it in observe. Its answers show up in results of every decision event, nothing else changes.
- Move it to monitor. Same, plus onAlert each time it would have stopped a call.
- Move it to enforce (or drop its mode to use the harness default).
The whole harness can run in one mode with the harness-level mode option, for example mode: "monitor" to try a guard list on live traffic. Guards that set their own mode keep it.
In monitor and observe, approval does not use up confirmations and permissions files no reviewer requests and sends no proofs. decoy is the exception: its report to Scute is sent in every mode. See decoys.
What Scute records#
Every engine check from permissions and every preview is logged in Scute's decision log with the agent, the task and the person (previews with via: "agent_dry_run"). Decoy calls, tool drift and property use are recorded as events. The harness-side guards (grounding, args, budget, content, your own) run in your process and are only visible through onDecision.
Testing#
- No store setup. The default in-memory store keeps state per harness instance, so each test can start clean with a new harness.
- No live API. TypeScript takes a fetch option; Python takes transport (an httpx transport) or a scute client; Ruby takes client: or a transport:. Point them at a fake that answers the endpoints the harness calls.
- Check guards alone. run.check() returns every guard's answer in verdict.results, so a test can assert on one guard without running a tool.
- Snapshot. run.snapshot() shows the run's counters and state after a sequence of calls.