Happy-path testing proves the agent can work. Failure testing proves the business can survive it. Actions time out, APIs return errors, credentials expire, and upstream orgs change - and each failure either degrades gracefully or corrupts data and erodes trust.

Agents amplify this because they chain actions autonomously. A single untested failure path can cascade into wrong records, duplicated transactions, or a stuck conversation with no escalation route. Testing the bad day end to end is what turns these scenarios from incidents into rehearsed, controlled outcomes.

Comparison between technical agent success and the real-world user outcome

Design for the bad day

  • Treat every action, integration, and credential as a component that will eventually fail in production.
  • Define the expected behavior for each failure: retry, escalate to a human, roll back, or stop safely.
  • Rollback means restoring data and state, not only redeploying an older agent version.
  • Version drift between the agent, its actions, flows, and target orgs is itself a failure mode to test.

Run end-to-end failure drills

  1. Force each action to fail in a sandbox and verify the agent escalates cleanly, logs the failure, and leaves data consistent.
  2. Test credentials at minimum scope and confirm expired or revoked access fails closed, never open.
  3. Rehearse rollback: revert the active agent version and confirm prior conversations, records, and state stay intact.
  4. Track dependencies on target orgs and repeat a structured pass, such as Salesforce's five-step testing strategy, after every release, sandbox refresh, or package upgrade - and keep the evidence.
Further reading

Resources

This article is based on the following Salesforce learning and product documentation.

Continue the architecture path
ControlPost-Release Control Verification

Re-verify action filters and write permissions against the mandate after every release or org change.

ControlEscalation Triggers

Define low-confidence, unusual-value, and negative-sentiment triggers, and drill the handoff to a human on a real case.

ControlMinimal Action Surface

Filter unavailable actions and restrict write permissions so the agent can only do what its use case requires.