Agent Hook Lifecycle Lab

Step inside the agent loop.

See when hooks fire, inspect their JSON, and watch allow, block, context, crash, and timeout change the run.

Safe simulation. No pasted code executes, no files are accessed, and payloads contain only fictional values.

Agent lifecycle

Synchronous hooks may block; observers never change control flow
Ready

Hook stack

JSON on stdin

Redacted, versioned, simulated context

Harness decision

ALLOW
Allow tool call

Policy hook approved the sanitized request.

84%
42ms
1.2%
1.8KB

Failure scenarios

Practical recipes

Audit trace

Security checklist

Least privilege · explicit matchers · environment allowlist · path normalization · bounded runtime · idempotency · schema validation · secret redaction · fail closed for destructive actions · fail open only for telemetry.

The hook lab applies a scenario rule at the fourth event

Read the explanation

The lifecycle lab contains eight events, from session start to turn stop, fourteen failure scenarios and eleven recipe labels. It initially has three hooks. At twenty pixels per item the event bar is one hundred sixty, scenario bar two hundred eighty and recipe bar two hundred twenty. These are local arrays and illustrative fixtures. Selecting a hook changes highlighting but does not change the block decision or install a real shell policy. The decision rule blocks when scenario is not success and event index is at least three, which is the fourth event before tool. The default secret detected scenario allows the first three events then blocks at the fourth. Manual step can continue even after a block, and the final state label becomes complete at the last event despite a block badge. At forty pixels per event the first three measure one hundred twenty and the fourth threshold one hundred sixty, while all eight measure three hundred twenty. This shows assigned fail-closed labeling rather than scanning secrets, validating JSON or stopping a real agent process. Ordinary displayed latency is forty two plus seven times event index milliseconds: forty two at start, sixty three at before tool and ninety one at turn stop. A timeout scenario after the block threshold displays three thousand instead. At one pixel per ten milliseconds the timeout bar is three hundred while ordinary final value is nine point one. Add creates a fourth observer hook. Export serializes hook array and scenario but omits event progress, payload, recipe selection and measured timing. Recipes simply select success and reset progress; no tests, SQL validation or deployments execute.

Super generates helpful tools and automates fact-checking across the internet proactively. If you enjoyed this tool, build your own with Super and share it with a friend.