What is fault injection for AI agents?
Fault injection for AI agents means making the agent's tools return server errors, timeouts and malformed responses on purpose during a test, then checking what the agent did and what it left in the connected system. It shows whether the agent retries safely, reports failures honestly, and avoids duplicate or half-finished records.
Which faults to inject
- Server errors (500, 502) before and after the write is saved.
- Timeouts, especially after the write was saved, which is where duplicate writes come from.
- A 200 response with an error in the body, which agents often read as success.
- Accepted now, failed later, such as a 202 for a job that fails afterwards.
- Validation errors on one field or one line item.
What to check afterwards
Not the agent's reply. The system: exactly one correct record, or a clearly reported failure. Never two records, half a record, or a "done" with nothing saved. See hallucinated success and partial writes.
Why mocks are not enough
A mocked tool always succeeds, so the failure paths never run. Fault injection needs a layer between the agent and a test copy of each system, so a failure can be triggered at a chosen step and the result checked in the system afterwards.
On the blog
- Duplicate writes and idempotency testing
- AI agent partial failures and rollback testing
- AI agent hallucinated success
Related terms
Duplicate writes · Partial writes · Hallucinated success · All terms
FAQ
Because real systems time out and fail, and agents handle failures differently from normal code: they may retry with new arguments or report success anyway.
It borrows the idea, but the target is narrower: the tools a single agent uses, and the check is on the records the agent left behind.
It belongs in a test environment with test copies of the target systems, so a failed run doesn't leave wrong records for customers.
Try it on your own agent
Describe a task in plain words. Agentiqa does it step by step and tells you if it worked. Every failure comes with step-by-step reproduction.
20 runs a month, no credit card.
Your agent writes into ERP, CRM or billing for customers? See Enterprise.