Failure modes, constraints and alignment
hard 6 minDefine the intended task, the capabilities it requires and the evidence of completion.
Video lesson · Chapter 1 of 4
The quote beside the refund button
Theory
Read or listen first. About 2 min.
What it is
Define the intended task, the capabilities it requires and the evidence of completion. A policy layer enforces permissions, limits and approval rules independently of model output. Alignment feedback complements these controls by shaping behavior within the permitted space.
Why it exists
Test both sides of the contract. Ask whether a prohibited effect was prevented and whether an authorized user can complete the intended task. Review the external state as well as the words returned by the assistant.
A policy assistant can quote a refund but cannot issue one
Inside this chapter
Chapter sources- Agent Failure Modes
- Common failures include repeated actions, stale context, incorrect routing, inconsistent state and unsupported claims. Identify the first violated invariant rather than attributing every error to the final model response. A perfectly worded answer can report an action whose write never committed.
Agent failures tend to cluster: repeating an action after an ambiguous response, acting on stale context, choosing the wrong tool, letting internal state drift from external state, and stating things nothing supports. When investigating, walk the trace forward and stop at the first step where an invariant broke (for example "only claim success after a confirmed write"). Fixing the final wording leaves the real fault in place.
Example. The assistant claims “booked” after a write timeout. Locate the first unverified transition and consult the external operation record.
Another example. A deployment agent reports "rolled back" after the rollback command returned a timeout. The real state was half-rolled-back. The first broken invariant is reporting before checking service versions.
Find the first broken invariant
The wording at the end is a symptom. The fault is treating an unknown write as committed. - Safety Constraints
- Enforce capability limits, spend limits and state transitions in the host. Separate reading from writing and bind approvals to exact operations. For a refund assistant, looking up a receipt and issuing money require distinct permissions even when both actions concern the same order.
Constraints that live only in the prompt are suggestions. Real constraints are checked by the host or the tool service: which capabilities this session has, spend limits, allowed state transitions, and approvals bound to an exact operation (amount, recipient, expiry). Separate read capabilities from write ones even for the same resource, since reading a receipt and moving money carry very different risks.
Example. Authorize reading an order but deny issuing a refund for it. Exercise both paths with the same signed-in user.
Another example. A file-management agent may list and read files in
/reportsbut delete only after an approval that names the exact file paths. An approval forq3.pdfdoes not coverq3-final.pdf.Same user, same order, different permissions
Action Capability needed Granted to assistant? Result Look up order 5521 orders.readyes receipt returned Quote eligible refund refunds.quoteyes amount shown Issue refund refunds.writeno denied by host Change delivery address orders.writeno denied by host Enforced in the host, so persuasive model output cannot change the outcome. - Alignment Strategies
- Align a system by combining a clear objective, representative feedback and external checks on consequences. Measure task completion together with policy adherence and justified abstention. A reward for short resolution time alone can encourage premature closure of unresolved requests.
Whatever you reward, whether through training feedback, prompt incentives or dashboards, an optimiser will find the cheapest way to raise it. If the measure can move without the real outcome moving, expect that to happen. Combine a clear objective with feedback from representative cases and with checks on consequences that arrive later, and test candidate policies on reopened or escalated cases specifically.
Example. A speed-based reward closes tickets early. Add a verified resolution criterion and test reopened cases before judging the new policy.
Another example. A code-review bot rewarded for low comment counts learns to approve everything. Adding a check on defects found after merge restores the intended behaviour.
Objective with an outcome check
- Reward resolved tickets, verified by no reopen within 7 days
- Credit justified abstention and correct escalation
- Track policy adherence alongside speed
Speed-only objective
- Reward short time to close
- Agent closes unresolved tickets early
- Reopen rate rises while the metric improves
- Measuring over-refusal
- A safety evaluation needs a set of legitimate, permitted tasks alongside the attacks. Report how often the system completes those tasks as well as how often it blocks prohibited ones, so a policy that denies everything cannot score as safe and useful.
Build the benign set from real traffic and from near-miss cases that resemble attacks but are allowed (asking about a refund versus requesting one). Track the two rates together over releases, since tightening a filter often lowers the second without anyone noticing.
Example. A refund assistant blocks 100% of unauthorised refund attempts but also refuses 30% of plain balance questions. The safety score looks perfect; the usefulness score exposes the problem.
Both sides of the contract
Policy Prohibited writes blocked Permitted reads completed Verdict Deny every tool call 100% 0% safe but useless Allow every tool call 0% 100% useful but unsafe Capability-scoped host 100% 97% investigate the 3% refusals Illustrative percentages for a policy assistant test set. - Blast radius and kill switches
- Limit how much damage one run, one tenant or one bad release can cause, and keep a fast, tested way to stop agents taking actions. Containment assumes something will eventually go wrong and bounds the cost when it does.
A kill switch only helps if it is rehearsed: test it regularly, make sure it takes effect on runs already in flight, and confirm that agents degrade to a safe mode (read-only, queue for human) rather than crashing mid-transaction.
Example. A misconfigured prompt starts approving every expense claim. Per-run spend limits cap each mistake, and an operator flips the write-actions switch to read-only within minutes while the release is rolled back.
Layers that bound the damage
Per-action limits
Maximum amount per refund, maximum records per delete.
Per-run budgets
Cap writes and spend for a single run.
Tenant isolation
One customer's agent cannot touch another's data.
Kill switch
Flip all agents to read-only without a deploy.
How it works
Step through the idea, or press Play.
Requested task. Quote eligible amount
Understand it
Worked example
A policy assistant can quote a refund but cannot issue one
- 1
Quote eligible amount
The user asks for information. The host grants read access to the relevant records only.
- 2
Issue refund rejected
A generated write proposal is outside both the task and the capability set. A valid schema and persuasive wording do not alter permissions.
- 3
Quote returned · ledger unchanged
Inspect the protected state after the run. Test legitimate reads as well as denied writes so a completely disabled assistant cannot pass the evaluation.
Follow the handoffs
The refund proposal meets the policy layer
Summary
The whole topic in one minute.
A safe and useful policy must allow the intended task as well as prevent unauthorized effects.
Test both sides of the contract. Ask whether a prohibited effect was prevented and whether an authorized user can complete the intended task. Review the external state as well as the words returned by the assistant.