M1 Enforced harness
Hooks, permissions, subagents and durable sessions that make an agent harness enforce rather than suggest.
Lessons
Section titled “Lessons”- 01 A harness is a loop plus a policy
- 02 Hooks, permissions and modes
- 03 Subagents
- 04 Durable sessions and idempotency
- 05 Context engineering for code tasks
- 06 Failure taxonomy and caps
- 07 Interview angle
Exercise
Section titled “Exercise”M1 enforced harness lab: build your own enforced harness around the Agent SDK, with tests and hints.
01-policy-engine: aGuardthat decides what a tool call may do under writable roots and blocked command patterns.02-hook-adapter: the guard wired as aPreToolUsehook that denies on any doubt, including its own errors.03-session-store: durable ticket sessions with a fresh-session fallback when a resume fails.04-idempotent-tools: side effects that run once per key, across restarts.05-caps-and-report: turn and budget caps and a run summary that says why the run stopped.06-subagent-verdict: a read-only reviewer subagent whose verdict is validated against a schema.07-failure-taxonomy: classify harness failures from recorded traces (judgment stage).08-live-ticket: one tinyshop ticket end to end against the real Agent SDK (needs a Claude login).