A decade of AWS architecture didn't prepare me for how AI systems fail. Getting one to work once is no longer the hard part; making it work on the 1,000th run without failing silently is. Ten failures below, each one different, still counting.
I found them by rereading everything I have published on rajmurugan.com: where I was wrong, or nearly shipped something wrong, and what made me notice. These are personal builds and experiments based on real-world customer workloads, anonymised. Most looked fine until I put a number on them. I have grouped them by where in the life of an AI system the mistake bites.
In short
- Ten mistakes from my own AI builds and customer workloads, grouped as Build, Operate, Measure and Secure. Most have a measured number, and each has a fix I now apply.
- Most threw no error. A green dashboard, a clean load test, an accepted write: each looked fine until a check on a different layer disagreed.
- Two habits would cover most of them: check one layer below the one reporting success, and try to break your own check before you trust it.
Build
1. A method that looked real but did not exist
What happened: the codebase had a helper that saved a fact to AgentCore Memory, the long-term memory service in Amazon Bedrock AgentCore, AWS's platform for running agents. It called ingest_memory_records. It had a docstring and a sensible name. It had never run, so it had never thrown. When I wired it into a real path, hasattr(c, "ingest_memory_records") returned False. The operation does not exist. The real one is BatchCreateMemoryRecords (batch_create_memory_records in boto3).
Then it bit me differently. A write returned 201, and the record could be read by id straight away but was missing from search. Across three runs it first appeared at 15 to 27 seconds, a ballpark, since three samples cannot show a tail.
The cost: none that reached users, as both surfaced on the first real call. Unchecked, the helper fails on first use, and a search straight after a write comes back empty.
The rule: a method name is a claim until something runs it, and a 201 only says the write was accepted. I check each operation against the SDK I ship. I read a record back by id with GetMemoryRecord and check the failedRecords list. If search must find it, I poll with a timeout instead of sleeping on a guess. The read-after-write details.
2. Designing around access the tool did not have
What happened: on a personal Year 10 study system I drew the architecture first. It assumed a Cowork routine, Anthropic's scheduler for Claude, could read the Claude project chats. It could not. The design that worked flipped the data flow: push, not pull. I see the same mistake at enterprise scale, with assumed Knowledge Base behaviour, session state and tool-call semantics.
The cost: an evening, redrawing it.
The rule: the diagram comes after the smoke test. The Year 10 study system story.
3. Cost-saving caching that was never switched on
What happened: on a customer workload on Amazon Bedrock, AWS's managed service for calling foundation models, the usage fields reported 0% cache reads. No cache points were configured. Strands, the open-source Python agent SDK it used, adds none to its BedrockModel unless you configure them, and explicit caching only applies where you ask for it. Amazon Nova also caches some prompts implicitly, but AWS does not report those in the cache usage fields or bill them as cache reads.
In the current Strands reference you set it with cache_config, for example CacheConfig(strategy="auto", tools_ttl=...), and cache_prompt and cache_tools are deprecated there, so check your version. Older releases add no auto cache points for Nova. Newer ones add them, and drop a tool cache point on Nova with a warning. My measurement used the older settings: cache_prompt on both models, plus cache_tools on Sonnet.
In one 10-turn staging run against the workload's real system prompt (8,156 tokens as Nova counts it, 8,788 as Anthropic does), the share of prefix tokens read from cache reached 99.9% on Nova Pro and 99.8% on Sonnet 4.6. It is one run, and steady production traffic will be lower. Two details decide whether it helps:
-
How long the cache lives. By default, five minutes from its last use, so calls minutes apart pay the write cost repeatedly. Bedrock also offers a one-hour
ttlon Claude models that support it, billed at a different rate, which I have not tried. -
Which model. Nova's cache points are documented for
systemandmessagesonly. Mine in the tool definitions failed with a malformed-request error buried in a fallback chain, while Claude accepted it.
The cost: the workload shipped without explicit caching. I measured the fix, not the bill, so I have no dollar figure: the gap is a prefix of about 8,000 tokens sent on every call.
The rule: caching you did not switch on is not caching you have. After a deploy, I make three calls against the same prefix, five to six seconds apart, and read the usage block: a write first, then reads. A prefix below the model's minimum is not cached and raises no error. An occasional repeat write is normal, more so with a cross-region inference profile, because a request served by another server or Region writes a new entry. The caching measurements. The 0% starting point is in three findings from that workload.
Operate
4. A runaway agent behind a green dashboard
What happened: an agent loop never decided it was done. No exception, because nothing was broken: HTTP 200 every lap, p99 normal, error rate zero. It was found on the finance bill, days later. I have not named the company, and I changed numbers in the source post to protect it.
The cost: a few thousand dollars by the time it was caught. Left running, it was a six-figure annual rate. Nothing was designed to catch it. Catching it in days was luck, and luck is not a control.
The rule: cap more than one thing, and watch tokens as well as uptime. I cap tool calls, model re-invocations and wall-clock time, and watch tokens per session and fleet token-rate. Bedrock's InputTokenCount and OutputTokenCount are per model, with no session dimension, so one stuck session hides inside them. With caching on, the API's inputTokens leaves out cached tokens, which Bedrock reports as CacheReadInputTokenCount and CacheWriteInputTokenCount. A stuck loop can be mostly cache reads, so I watch those too. CloudWatch's generative AI observability (generally available) and AgentCore Observability both report token usage, and I have not compared either with what I built. Why agents need a harness.
5. A passed load test hiding 5,342 rejected calls
What happened: by the usual metrics it was clean: latency inside the SLA, no 5xx, no alarms. The agent's log group told a different story. 412 turns succeeded, behind 18,454 successful model calls, about 45 per turn through a fallback chain of models. On top of those were 5,342 ThrottlingException events (about 22% of all attempts, counting each throttle as one attempt) that the SDK retry loops swallowed.
The cost: degradation nobody saw. Per model, throttles ran at 12% of successful calls on Nova Pro, 70% on Sonnet 4.6 and 149% on Haiku 4.5, the third try after both others failed. A turn that succeeded may have been answered by the third model, not the first.
The rule: "load test passed" and "passed cleanly" are different statements. On every Bedrock workload I run one CloudWatch Logs Insights query counting ThrottlingException per model before I trust a load test. Bedrock's InvocationThrottles metric should make a cheaper alarm, with four caveats from AWS's metrics page:
- Throttled requests are not counted in
Invocations. - The count depends on your SDK retry settings.
- Requests rejected for exceeding a quota appear under
InvocationClientErrorsinstead, so alarm on both. - Filtering by
ModelIdcan undercount, so query it without the dimension.
I have not compared it against my log counts. Three findings from that workload.
6. A safety limit that did not record why it stopped
What happened: a poison-pill row (a job that could never reach its finished state, so a poller picked it up again forever) was re-billing a model every sixty seconds. The fix was one integer column, capped at five and incremented atomically in the database. It worked, but rows flipped to abandoned with a null reason.
The cost: every abandoned row was a mystery. The cap stopped the billing, but nobody could tell why a row had stopped. A safety limit with no telemetry is a black box you re-debug the next time it fires. last_close_error came later, as a follow-up migration.
The rule: the stop, the terminal state and the reason ship together. The one-column fix and its gap.
Measure
7. A perfect 16 out of 16 that proved less than it seemed
What happened: I built an LLM-as-judge eval (a second model grades the first model's summaries) on my own blog and got 16 out of 16 passing. The summaries were faithful, so it was not a rubber stamp over nothing. Then I graded the judge: five summaries, each with exactly one injected error. It caught 5 of 5.
The cost: none shipped. I caught it before it went anywhere. The risk was false confidence. A 100% pass rate proves only that the eval did not break on the easy case. Five of five shows the judge is not blind, not that it is calibrated: with five cases it could still be missing about one fault in two, and that assumes the five are typical. They were not. Every injected error was the benign kind.
The rule: calibrate with single-variable corruptions before you trust a number, and use more than five. AWS's managed evaluations service for agents, AgentCore Evaluations, is generally available. I have not tested it, and calibration applies to any judge. Three rounds of grading the judge.
8. A deleted safety instruction the tests could not see
What happened: I deleted a guardrail instruction from a prompt and could not detect it, with a judge, a judge-free assertion, or six label-free signals. My regression gate runs a fixed set of test inputs, a golden dataset. A p-value is the chance of seeing a gap this large if nothing had changed, so smaller means stronger evidence. On my baseline, each post cut at 12,000 characters (ten of the 16 are longer), the gate read p = 1.000: no detectable difference, which is not the same as no regression.
The cost: a real regression the gate passed. Shorten the source to 600 characters and the same gate reads p = 0.0020, from an exact test over the 16 posts. After Holm correction, the standard adjustment for running many tests, across the 18 tests I ran it stands at p = 0.033. The instrument was never the problem. The inputs I had written down could not show it. At 2,000 characters, my cleanest label-free signal, a trigram grounding score, read p = 0.020 uncorrected and 0.289 after Holm: a lead to replicate, not a result.
The rule: build datasets that include the hard inputs, and correct for how you found a result. The correction, in full.
9. An alert that could never fire
What happened: I had a quality signal I could compute on live traffic with no answer key, and reached for the reflex threshold: mean minus 1.5 standard deviations. It computes to minus 0.0062, below the floor of the scale. It could never page anyone.
The cost: none shipped. I caught it on paper, before wiring it. Deriving the line properly gave a harder result. For a regression that drops the signal by a third, a single output checked daily, with a budget of one false page a month (about 3%), catches it 2% of the time. One in fifty. A window of about 32 outputs catches 91%, assuming 2,000-character inputs, that effect size, independent samples and that budget. On 12,000-character inputs, 32 outputs give 31% power, and 80% needs more than 128. A threshold set from only 64 control outputs paged 6.3% of the time on average, about twice the budget. The signal itself is still a lead, and outputs from one session are correlated, so yours will differ.
The rule: work out the window size before you wire the pager. I build with a margin above the smallest window that reaches 80% power. How the window size was derived.
Secure
10. An access rule that checked the agent, not the user
What happened: I wanted to stop an AgentCore agent from acting beyond the user who asked. Cedar is AWS's policy language, and AgentCore evaluates it at its Gateway, the front door agents call tools through. With the agent calling on its own service credential, my working policy deployed cleanly and enforced nothing on the user. It evaluated the agent as the caller, every time. Forward the asking user's token, with the policy engine in ENFORCE mode, and the same policy blocks the same request.
My first policy also matched too much. like "*staff*" let a user in staff-applicant through, because the group claim arrives as one string. Match the quoted group name instead: like "*\"staff\"*".
The cost: found in demos, not production, but silent: a policy that deploys cleanly and checks the wrong caller raises nothing.
Three settings matter. In LOG_ONLY mode the engine records what it would have decided and lets the call through. Anyone with bedrock-agentcore:UpdateGateway can switch to that mode or remove the policy engine, and no condition key guards the mode, so I treat that permission as admin-only. And configure the Gateway to accept only tokens issued for your app, with allowedAudience or allowedClients.
A second demo, a fictional bank assistant, added two lessons. AgentCore rejected my explicit forbid for everyone on one tool, kyc_update, as "Overly Restrictive". It rejected my cartoonishly bad policy, so the wrong policy that deploys is the realistic one. That check can be switched off with validationMode set to IGNORE_ALL_FINDINGS. AWS says not to in production, because the same check catches overly permissive policies. And a policy test that only runs against a correct policy can silently stop checking anything, so I deployed a realistic wrong one, a permit that never compares the customer ID to the token, to prove the harness failed it.
Two limits remain, and both are unsafe. The first is a stale token claim: I removed a user from the staff group and their old token, still carrying the claim, was still allowed. A token stays valid until it expires, and Cognito lets you set the access-token lifetime per app client, from five minutes to a day. Short lifetimes narrow the gap, and for a high-risk action the tool should check the downstream system at the moment of the action.
The second is intent. In the bank demo, a scripted call standing in for a model steered by an instruction injected into a memo, for a legitimate customer who had passed the extra identity check, was allowed to change their address. The policy had nothing to object to. The live model never followed the memo in 30 runs, but a model that did not bite is not a control.
The rule: the model is not the boundary, and a policy on a token is only part of one. Forward the user's token, enforce, and keep a realistic wrong policy next to every policy test. For high-risk tools I would add a human confirmation the model cannot give, which my demo did not build. The smoothie shop demo and where the deny belongs.
Two habits that would cover most of them
- Check one layer below the one reporting success. The throttle log under the load test that passed. The token count under the 200. The read-back under the 201.
- Try to break your own check before you trust it. The injected error, the wrong policy, the shortened source.
Which of these ten have you hit yourself? If you have a mistake that does not fit those, I would like to hear it. Find me on LinkedIn or via rajmurugan.com. The full map of what shipping production agentic AI takes is on the AI Engineer Roadmap.


Top comments (0)