
Your AI Agent Didn't Crash. That's the Problem: Catching Silent Failures on AWS
The worst bugs in my AI billing agent returned a green status and no error: a Slack post that never arrived, a command that got a 200 and did nothing, and a ticket stuck in review. Here is how they happened, and the safeguards on AWS that stop a wrong answer from moving money.
Your Agent Didn't Crash. That's the Problem.
The worst bugs in my AI project never threw an error.
I'm building Backstop, an agent that resolves billing support tickets. It reads a ticket, checks the customer's real Stripe history, and refunds a duplicate charge on its own when the case is clear. It runs on AWS: Step Functions drives the pipeline, Lambda runs each step, DynamoDB keeps the record.
During the build, I watched a run finish green. Refund issued. Ticket resolved. Step Functions status: Succeeded. And Slack, where the team is supposed to see every decision, was completely quiet.
Nothing had failed. That's what made it a problem.
Green, and quietly wrong
The cause was one wrong ID. My deployment pointed at a Slack channel the bot wasn't in, so every post came back
not_in_channel . The notifier catches that error and moves on, on purpose, because a Slack outage should never block a refund. So the only evidence was a single ERROR line in one Lambda's logs, several tabs away from the dashboard I was staring at.I had designed the notifier to fail quietly. I just hadn't designed anything to tell me it was.
A 200 that meant nothing
Next up, Slack commands. Reply in a ticket's thread with
@Backstop refund $150 of this charge and Backstop should parse it, check policy, and refund. My first test came back HTTP 200 and nothing else happened. No execution. No error. No warning.My endpoint handled
message events. My Slack app was sending app_mention events. The handler met an event type it didn't handle, returned 200 (Slack wants a fast OK), and did what any polite service does with something it doesn't understand: nothing. The log line describing what it had received was at INFO, and Lambda's Python runtime doesn't show INFO by default. I only found it by signing a test event myself and asking Step Functions whether anything had started.Wrong, but perfectly formatted
Models fail the same way. A model doesn't raise an exception when it's wrong. It returns valid JSON and a confident rationale.
In an early test, the stand-in for my model proposed refunding a charge that didn't exist. The schema was fine. The reasoning read fine. Send that to Stripe and you get a failed refund on a good day and a wrong one on a bad day.
So the first rule in Backstop is that a model's output is a claim, not a fact. Before anything else happens, the proposed charge is checked against the customer's actual Stripe history (trimmed here):
transaction = next( (t for t in stripe_history.transactions if t.id == action.target_transaction_id), None)if transaction is None: return _downgrade_to_escalate( action, "target_transaction_id was not found in this customer's actual Stripe history." )If the charge isn't there, the action becomes an escalation to a human. The model can be confidently wrong. It just can't be confidently wrong in a way that moves money.
Agreement isn't proof
The obvious fix is a second agent to double-check the first. It only helps if the two don't share a blind spot.
So my verifier gets none of the worker's reasoning. It re-pulls the Stripe data itself, runs on a different model, and reaches its own answer. The two answers are compared on structured fields only: action type, amount, target charge. Never on prose, because prose always sounds persuasive. If they disagree, or the verifier's own confidence is under 0.6, a person decides.
The ticket that never finished
One failure was loud and still invisible. Gemini answered a verification call with a 503, the retries ate the clock, and the Lambda hit its 60 second timeout. Step Functions marked the run FAILED, which was honest. But the control room, where a human would actually look, showed the ticket sitting in "verifier review." It looked like work in progress. It wasn't. Two tickets sat like that until I noticed.
I raised the timeout on the model-calling steps to two minutes. I'll be straight about what that isn't: a function that times out still isn't retried, so a long provider outage can strand a ticket.
An error with the message removed
My favorite:
opa eval failed (exit 2): and then nothing. The policy step had crashed and refused to say why. I had packaged the wrong OPA version, it couldn't parse my policies, and it wrote its complaint to stdout while my code only printed stderr. I found the cause by reproducing it locally with an older compatibility flag.An error with no message is worse than a crash. It proves something is wrong and won't say what. (Printing both streams is a one-line fix.)
What Backstop does about all this
Catching silent failures comes down to a handful of habits, and they're mostly boring on purpose.
Rules the model can't argue with. Policy lives in Open Policy Agent, outside the AI. A single refund over $200 is denied. Fraud flags and disputed charges are refused. Deny beats escalate beats allow, and that last one is one of 15 tests, not a hope.
When in doubt, hand off, and put the rule where the model can't reach it. Even when the worker and the verifier agree, an agreed
escalate or fraud action is never executed, because agreeing that a human must handle it doesn't mean it's safe to automate. That rule isn't in a prompt. It's a state in the Step Functions definition:"CheckNeverAutoExecute": { "Type": "Choice", "Choices": [{ "Or": [ { "Variable": "$.propose_result.proposed_action.action_type", "StringEquals": "escalate" }, { "Variable": "$.propose_result.proposed_action.action_type", "StringEquals": "flag_for_fraud_review" } ], "Next": "AuditVerifierAgreedEscalate" }], "Default": "Execute"}Make retries harmless. Every Stripe call carries an idempotency key derived from the ticket ID, so a repeated run can't refund twice.
Record outcomes, not just status. Step Functions says "Succeeded" for a ticket that was refunded, a ticket blocked by policy, and a ticket handed to a human. It's describing the plumbing, not the result. So every run writes what actually happened to an append-only audit trail in DynamoDB, and the control room shows the worker's and the verifier's reasoning side by side next to the policy decision. The execution graph helps too: the path a run took is green, everything it skipped is grey, so "why didn't this execute?" takes one glance.

Ask, don't guess. In a Slack thread I typed
@Backstop tell the user the issue . The agent answered "Command needs clarification" instead of inventing what to tell a customer. The scariest agents are the ones that always have an answer.Still on my list
Honest limits, because a post about silent failures shouldn't hide any:
- A CloudWatch alarm for failed executions and for notifier errors, so a quiet failure makes noise.
- A warning-level log whenever the Slack endpoint drops an event it doesn't handle.
- Retries for model steps that time out. Execution is already safe to repeat, so this is the easy one.
Try it
If you're building an agent this week, do one thing. Take your last successful run and ask what you'd have to check to know it was right, not just that it finished. Then build that check.
Backstop is public at github.com/iammannat03/backstop , and you can watch it decide in the live demo: Loopline files the ticket, the control room shows the reasoning.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article