Learn · Agentic architecture & orchestration · CCAR-F task 1.4
Enforcement and handoff
Prompts are probabilistic, code is deterministic. Put must-never-break rules in code, and hand off with a summary that stands alone.
Key ideas
- Prompts are probabilistic, code is deterministic: enforce must-hold rules in code.
- A prerequisite gate inside the tool refuses to act until an earlier step succeeded.
- Return a structured error that tells the model what to do next.
- A state machine tracks the workflow stage and allows only valid transitions.
- Split multi-concern requests, investigate each (in parallel if independent), answer together.
- A human handoff summary must stand alone: customer ID, root cause, amounts, actions taken, recommendation.
Worked example: A prerequisite gate inside the tool
The rule lives in code the model can't talk its way around. The prompt still says "verify first", so the model usually does; the code guarantees it.
Exam traps
- Fixing a must-never-happen failure by strengthening the prompt ("ALWAYS verify first") instead of adding a code gate.
- Returning a bare error with no hint, so the model can't recover.
- Handing off to a human with "see the conversation above": the human can't see it.
- Answering only the first concern in a multi-concern message.
Official docs
Practise CCAR-F questions · Next lesson: Hooks for tool calls