Watch: What AI agents actually can and cannot do — failure modes explained (15 min)
How Agents Fail — And What to Do About It
Input failure.
What happens: User provides input the agent was not designed for — wrong language, wrong format, unexpected characters.
Fix: Validate inputs early. Return a helpful error message. Never let unexpected input reach core logic without sanitisation.
Tool failure.
What happens: An API returns an error, rate limit, or timeout.
Fix: Wrap every tool call in error handling. Log the failure. Retry with backoff. If retries fail — escalate to a human or return a clear failure message.
Logic failure.
What happens: The agent reaches a decision point where none of the expected conditions are met.
Fix: Add a default case to every decision branch. Always return something — even 'I was not able to handle this request, here is why.'
Output failure.
What happens: The agent produces a response that is technically valid but factually wrong or harmful.
Fix: Add a verification step before final output is delivered. For high-stakes domains, require human review before the output reaches the end user.
The Five Edge Case Tests
Run all five. Document results honestly in your project log.
T1 — Empty input.
What happens when the user sends nothing, or just whitespace? Does the agent crash, loop, or return a helpful message?
T2 — Unexpected format.
If the agent expects a date — what happens when it receives 'Tuesday'? If it expects English — what happens when it receives Italian?
T3 — Adversarial input.
What if a user asks the agent to do something it is not supposed to do? Does it refuse gracefully or produce harmful output?
T4 — Tool unavailable.
Disconnect the API or simulate a 503 error. Does the agent fail silently, crash, or return a useful error message?
T5 — Correct input, wrong result.
Give the agent a valid input where you already know the correct answer. Does it get it right? If not — is the error predictable?
Key Insight
You do not need to fix all failures — but you must document all of them honestly. The edge case test results become the testing section of your final README.
✏️ Student Reflection
Run all five edge case tests on your prototype. For each test, document: the input you used, what the agent returned, whether this is acceptable behaviour or a bug to fix, and if it is a bug — what you will do about it before Week 8. Add all results to your project log.
📝 Your Lesson Submission
Share your reflection, ask a question, or leave a comment. Your mentor will respond.
🔐
You need to be logged in to submit your reflection.
Next →8.1 — Finalising Your Prototype🔒 Submit reflection to unlock
🔐
Create a Free Account to Continue
Lesson 1.1 and beyond are available to enrolled members. Join the program for free to access all 21+ lessons, mentor sessions, and your completion certificate.