Catch Hidden Assumptions in an Agent Plan
Scenario
An agent proposes a 3-step plan for didPassQuiz(score). Spot the hidden assumption.
Try it yourself
Compare three agent plan statements and spot which ones hide a contract bug.
| Case | Result |
|---|---|
| "If score > 100, clamp score to 100 and return Pass." | Select a choice above to see what happens. |
| "Convert string inputs with Number(score) before checking >= 60." | Select a choice above to see what happens. |
| "Check Number.isInteger(score) && score >= 0 && score <= 100; throw INVALID_SCORE otherwise; return score >= 60." | Select a choice above to see what happens. |
Reveal the explanation
- "If score > 100, clamp score to 100 and return Pass."
Hidden assumption! Clamping hides invalid data instead of returning INVALID_SCORE.
- "Convert string inputs with Number(score) before checking >= 60."
Hidden assumption! Silently converts "" to 0 and "60" to 60 instead of rejecting non-integers.
- "Check Number.isInteger(score) && score >= 0 && score <= 100; throw INVALID_SCORE otherwise; return score >= 60."
Aligned plan. Zero hidden assumptions; safe to approve.
Correcting a faulty assumption during the plan step costs one sentence; correcting it after 5 files are edited takes far longer.
Your turn
Spot the hidden assumption in: "For missing room IDs in lookupRoom, return 0 so callers never see an error."
Common mistake Approving "never see an error" without realizing it confuses missing rooms with full rooms.
Check your work
Correct the plan: return explicit "UNKNOWN_ROOM" for absent keys and reserve 0 for known full rooms.
Quick check
This browser could not save your progress. Changes last until you leave the page.