Lesson 5 of 5 · 6 min read
How a Harness Decides What Runs: Permission Rules, Modes and Hooks
A harness turns each proposed tool call into allow, ask or deny. Hooks can rule first; rules are then checked deny before ask before allow, so a broad deny beats a narrow allow; a compound shell command runs only if every part is allowed; the mode supplies the default when no rule matches; and with nobody to ask, ask becomes deny. Hooks also rewrite input, add context, check results and can refuse to let a turn end. Rules and hooks are policy and feedback, not a boundary: the same effect has many spellings.
Get full Premium access · $25
All 19 topics with every worked answer, all lessons and courses, the full practice bank, and anything new that appears during your access.
6 months · One payment · No auto-renewal
Practise it as an interviewer asks it
What is an AI agent? Explain how it differs from a chatbot and from a workflow that happens to call a model.How does a coding agent work? Walk through what happens between 'fix this failing test' and the pull request.What are guardrails for an AI agent, and why is an instruction in the system prompt not one?What does a build-an-agent coding round test, and how would you prepare for one in a week?What is an agent harness, and how is it different from a framework and from the model?Write the agent loop on the whiteboard, then list every way a run can end.