Skip to content
Field Notes

Ten AI mistakes, and what I check now

Ten mistakes from my own AI builds and customer workloads: a runaway agent behind green dashboards, 5,342 hidden throttles, a perfect 16/16 eval, and an alert that could never fire.

Raj Murugan 9 min read
Three rows on a dark background under the title Ten AI mistakes, and what I check now. A passed load test: 5,342 throttles. Caching in one staging run: 99.9 percent of prefix tokens read from cache. One output against one test regression: 2 percent caught.
On this page
  1. Build
  2. 1. A method with a sensible name
  3. 2. Reading project chats
  4. 3. A cache hit ratio of 0%
  5. Operate
  6. 4. Green dashboards, runaway agent
  7. 5. A clean load test, 5,342 throttles
  8. 6. One row, re-billed every minute
  9. Measure
  10. 7. 16 out of 16
  11. 8. p = 1.000, then p = 0.0020
  12. 9. Mean minus 1.5 standard deviations
  13. Secure
  14. 10. A policy that deployed cleanly
  15. Two habits that would cover most of them
  16. Sources

A decade of AWS architecture didn’t prepare me for how agentic systems fail. Ten of them below, each one different, still counting.

I found them by rereading everything I have published here: where I was wrong, or nearly shipped something wrong, and what made me notice. Most are mine, on personal builds and experiments. Three (items 3, 4 and 5) come from 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 with a sensible name

The codebase had a helper that persisted 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 and checked the client, hasattr(c, "ingest_memory_records") returned False. The operation does not exist. The real one is BatchCreateMemoryRecords (batch_create_memory_records in boto3).

Then the real one bit me differently: a direct write returned 201, and the record was fetchable by id straight away but absent from search. In three runs, in one sitting, it first appeared at 15 to 27 seconds. Three samples cannot show a tail, so treat that as a ballpark.

A method name is a claim until something runs it, and a 201 only says the write was accepted. What I do now: check the operation against the SDK I ship. To confirm one specific record landed, I read it by id with GetMemoryRecord. If it has to show up in a search, I poll that search until it appears or a timeout fires, rather than sleeping on a guess. The response also has a separate failedRecords list, so I check that too. Details here.

2. Reading project chats

On a personal Year 10 study system I drew the architecture first. It assumed the tool could read project chats. It could not, and the redraw cost me an evening. The design that worked flipped the data flow: push, not pull.

I see the same mistake at enterprise scale, with assumed Knowledge Base behaviour, assumed session state, assumed tool-call semantics. What I do now: the diagram comes after the smoke test. The full story.

3. A cache hit ratio of 0%

On a customer workload on Amazon Bedrock, AWS’s managed service for calling foundation models, the cache hit ratio was 0%. No cache points were configured, and the SDK was the reason: Strands, an open-source Python agent SDK, ships its BedrockModel with prompt caching off, and caching only helps if you ask for it. That one shipped wrong.

In the current Strands reference you configure it with cache_config, for example CacheConfig(strategy="auto", tools_ttl=...), and the older cache_prompt and cache_tools settings are deprecated there. Check your version first. In the library source, auto adds no cache points for Amazon Nova in strands-agents 1.65.0. Support arrived in 1.66.0, released on 23 November 2026, which also drops a tool cache point on Nova with a warning. My measurement below used the older cache_prompt setting.

In a single 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, counted once the cache had been written (Nova needed two writes first). It is one run, and the ratio in steady production traffic will be lower.

Two details decide whether it helps you. By default the cache lives five minutes from its last use, so calls minutes apart pay the write cost repeatedly. Bedrock also offers a one-hour option on Claude models that support it, set with ttl on the cache point and billed at a different rate, which I have not tried.

The other detail is the model. Amazon Nova’s cache points are documented for system and messages only, so mine in the tool definitions failed with a malformed-request error buried inside a fallback chain, while Claude accepted it.

What I do now: after a deploy, I make three calls against the same prefix, five to six seconds apart, and read the usage block. The first should show a cache write and the later ones cache reads. A prefix below the model’s minimum token count is not cached and raises no error, so reads that never appear are worth chasing. Measured here. The 0% starting point is in the three findings.

Operate

4. Green dashboards, runaway agent

An agent loop that 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.

By the time it was caught, the damage was a few thousand dollars. 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.

What I do now: cap more than one thing (tool calls, model re-invocations, wall-clock time), and watch tokens per session and fleet token-rate. The dashboard that answers “is it up?” has no opinion on “is it quietly doing something insane?”.

Bedrock’s InputTokenCount and OutputTokenCount metrics are per model, with no session dimension, so one stuck session hides inside them. With prompt caching on, the API’s inputTokens field also leaves out cached tokens. Bedrock reports those as CacheReadInputTokenCount and CacheWriteInputTokenCount, and a stuck loop can be mostly cache reads, so I watch them too. CloudWatch’s generative AI observability (generally available) and AgentCore Observability both report token usage, and I have not compared either against what I built by hand. The full post.

5. A clean load test, 5,342 throttles

By the usual metrics it was clean. Latency inside the SLA, no 5xx, no alarms. One layer down, the agent’s log group told a different story. 412 turns succeeded. Behind them were 18,454 successful model calls, about 45 per turn through a fallback chain of models, and on top of those 5,342 ThrottlingException events (about 22% of all attempts) that the SDK retry loops swallowed.

“Load test passed” and “load test passed cleanly” are different statements. What I do now: one CloudWatch Logs Insights query counting ThrottlingException per model, on every Bedrock workload, before I trust any load test.

Bedrock also publishes an InvocationThrottles metric, which should make a cheaper alarm. Per 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 InvocationClientErrors instead, so alarm on both, and filtering by ModelId can undercount, so query it without the dimension. I have not compared it against my log counts. The three findings.

6. One row, re-billed every minute

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. It also shipped with a gap: rows flipped to abandoned with a null reason. They had stopped costing money, and nobody could diagnose them.

A safety limit with no telemetry is a black box you re-debug from scratch next time it fires. last_close_error came later, as a follow-up migration, because I only noticed the gap afterwards. What I do now: the stop, the terminal state and the reason ship together. The fix and its gap.

Measure

7. 16 out of 16

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. It was tempting to stop. I checked instead, and the summaries were faithful, so this was not a rubber stamp over nothing. This one I caught before it shipped anywhere.

But a 100% pass rate proves the eval did not break on the easy case. So I graded the judge: five summaries, each with exactly one injected error. It caught 5 of 5. Five of five shows the judge is not blind. It does not show the judge is calibrated: with only five cases it could still be missing about one fault in two, and even that assumes the five are typical, which they were not: every injected error was the benign kind.

What I do now: calibrate with single-variable corruptions before I trust a number, and use more than five.

AWS now ships a managed evaluations service for agents (AgentCore Evaluations, generally available). I have not tested it, and the calibration step applies to any judge, managed or hand-built. Three rounds.

8. p = 1.000, then p = 0.0020

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. The instrument was never the problem.

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). Shorten the source to 600 characters and the same gate reads p = 0.0020, from an exact test over the 16 posts. It is one of the 18 tests I ran in total, and after Holm correction (explained below) it stands at an adjusted p = 0.033. The regression was real. 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. Under Holm correction, the standard adjustment for running many tests, across the 18 tests I ran in total, it reads p = 0.289. That makes it a lead to replicate, not a result. What I do now: correct for how I found the result, and build datasets that include the hard inputs. The correction, in full.

9. Mean minus 1.5 standard deviations

I had a quality signal I could compute on live traffic with no answer key. Then I 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. This one I caught on paper, before wiring it.

Deriving the line properly from my own measured distribution gave a harder result. For a regression that drops the signal by a third, a single output, checked daily at a budget of one false page a month, catches it 2% of the time. One in fifty. A window of about 32 outputs catches 91%. That 32 holds under those assumptions: 2,000-character inputs, that effect size, independent samples and that false-page budget. On 12,000-character inputs the same deleted guardrail moves the signal far less: 32 outputs give 31% power, and 80% needs more than 128. A threshold set from only 64 control outputs also paged more often than planned, 6.3% on average against a 3% budget. And the signal itself is still a lead, not a result. Outputs from one session are correlated, so yours will differ.

What I do now: work out the window size before I wire the pager, and build with a margin above the smallest window that reaches 80% power. The derivation.

Secure

10. A policy that deployed cleanly

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. In LOG_ONLY mode it records what it would have decided and lets the call through.

My first policy also matched too much. like "*platform*" let a user in platform-readonly through, because the group claim arrives as one string. Match the quoted group name instead: like "*\"platform\"*".

A second demo, a fictional bank assistant, added two lessons. First, AgentCore rejected my explicit forbid for everyone on one tool, kyc_update, as “Overly Restrictive”. The service rejects the cartoonishly bad policies, so the wrong policy that deploys is the realistic one. That semantic check can be switched off with validationMode set to IGNORE_ALL_FINDINGS. AWS says not to do that in production, because the same check catches overly permissive policies, so do not flip it to get past a finding.

Second, a policy test that only runs against the policy you wrote correctly 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 test harness failed it.

Even then there are two limits, and both are unsafe. The first is a stale token claim: in the first demo I removed a user from the platform group and their old token, still carrying the claim, was still allowed. That access token lasts an hour. Short token 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, an instruction injected into a memo, acting for a legitimate customer who had passed the extra identity check, changed their address. The policy had nothing to object to, and that is the case that would matter in a real bank.

The model is not the boundary, and a policy on a token is only part of one. What I do now: 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 demo and where the deny belongs.

Ten AI mistakes in four stages. Build: a method that did not exist, a design around access the tool lacked, caching off. Operate: a runaway agent, 5,342 throttles behind a clean load test, a retry cap with no reason logged. Measure: a judge checked on only five cases, a test that missed a regression, a threshold that could never fire. Secure: a policy that enforced nothing on the user. Two habits: check one layer below the one reporting success, and try to break your own check.

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.

Sources

Your quality alert needs 32 samples

Part 3 left me a label-free signal that responds to a real regression. It does not come with a threshold. Here is where the line actually goes, what a false page costs, and why the reflex answer computes to a negative number.

Your golden dataset is too easy

I could not detect a deleted guardrail with an LLM judge, a judge-free assertion, or six label-free signals. Three instruments, one null. The instrument was never the problem: shorten the source and the same gate goes from p = 1.000 to p = 0.0020.

Your regression gate needs a power calculation

I deliberately broke my summariser's prompt, then failed to detect it two ways: with an LLM judge over a golden dataset, and with a judge-free deterministic assertion. Removing the judge changed nothing. Here is the calculation that would have told me first.

Share this article

Newsletter

A new AWS and AI engineering write-up every Tuesday, directly to your inbox.

Comments

  1. Loading comments…

Comments are reviewed before they appear.