Skip to content

Build1 publisher2 min readPublished

Adding ChaosPlugin to a Strands agent injects tool failures without touching its code

Strands Evals 1.0 added chaos testing and red teaming in June. One AWS builder pointed both at a fixture-fed copy of his cost-reporting agent, because Cost Explorer charges a cent per API request.

The Engineer · Build desk

Illustration accompanying Adding ChaosPlugin to a Strands agent injects tool failures without touching its code

What happened

  • Strands Evals 1.0 shipped chaos testing and red teaming in June, adding fault injection to the evaluation path for Strands agents.
  • The twin's fixture data hides one incident on the final day, with EC2-Other, where NAT gateway data processing charges land, jumping from about $1.10 a day to $38.40.
  • The twin calls AWS Cost Anomaly Detection and reads cost by Project tag; the production agent has neither path.

Compiled by The EngineerSomething wrong?How this is made

Why it matters

  • capability Injection at the hook layer means the suite can be pointed at the agent you actually deploy, so running a failure day does not require maintaining a second, instrumented build of it.
  • cost Against live Cost Explorer, the price of adversarial testing scales with the number of attack turns at a cent a call, so whoever runs the red team pays per attempt; fixture data removes the per-call charge and makes reruns identical.
  • decision An agent that finishes and returns green while dropping a service passes a completion check. The pass criterion has to ask whether the agent reports the data it lost.

You declare which tool should fail and how, add `ChaosPlugin()` to the agent, and the plugin intercepts the call at the hook layer and injects the failure [2]. The agent's own code does not change [3]. Pre-call effects kill the call before the tool runs: `Timeout`, `NetworkError`, `ExecutionError`, `ValidationError` [4]. Post-call effects let the tool run and then damage what came back: `TruncateFields`, `RemoveFields`, `CorruptValues` [5]. The two families hit different code. One produces an exception your handler either catches or does not; the other produces a response that still parses.

None of it ran against the production agent, which wakes each morning, reads the author's AWS bill and emails a color-coded report on what changed [7]. He built a lab twin on fixture data instead, because chaos and red-team runs need identical inputs every time and the tag experiment needed a poisoned tag he controlled [9][10]. Money is the other reason. Cost Explorer bills $0.01 per API request, and a red-team run makes a lot of requests [11]. "Testing a cost agent should not become a cost incident," he wrote [12].

A result on the twin transfers to production only for the paths both share, and that list is short. The twin calls `get_anomalies` against AWS Cost Anomaly Detection and reads cost by `Project` tag, two paths that exist on the twin alone [14][15]. Its prompt is much shorter than production's, dropping the `STATUS:` report format and the accumulated prompt rules from the first build [17]. Model setup is the constant, whatever Strands defaults to, which was Claude Sonnet 4.6 on this run [13]. Per-project attribution through tags sits on his version two roadmap, so the suite is exercising a feature ahead of production [16].

The scoring target is a single hidden incident. On the last of fourteen days of fixture spend, `EC2-Other`, where NAT gateway data processing charges land, goes from about $1.10 a day to $38.40 [18][14]. That is roughly 35 times the daily rate, $37.30 more in one day [20]. A crash is the safe failure, since he notices by breakfast; the expensive one is a confident green status while the NAT gateway keeps running [22]. Every experiment asks whether the spike reaches the morning report [19].

The headline finding in the post is about the tooling rather than the agent. The author wrote that "the scariest numbers came from the test harness, not from the agent" [23]. The published account breaks off mid-description of `SuccessFraming`, the model-output effect that prepends a confident success to the model's answer, before those numbers appear [6][24].

What to watch

  • Whether the follow-up publishes the chaos and red-team scores, and whether the harness problems the author flags are Strands Evals defects or scoring-prompt defects.
  • Whether tag-based per-project attribution ships to the production agent after the poisoned-tag experiment, and what that experiment found.
  • Whether Strands Evals gains a way to replay recorded API responses, so red-team iterations on a cost agent stop accruing $0.01 per Cost Explorer call.
Loading claim ledger
Loading source directory links
Loading share composer
Loading topic controls
Loading related stories