<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aaditya Dagar</title>
    <description>The latest articles on DEV Community by Aaditya Dagar (@profitagentz).</description>
    <link>https://dev.to/profitagentz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4086613%2F01a35e2a-aa52-412a-9d1f-062d0aab7176.png</url>
      <title>DEV Community: Aaditya Dagar</title>
      <link>https://dev.to/profitagentz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/profitagentz"/>
    <language>en</language>
    <item>
      <title>Your agent passed every test and still broke in production</title>
      <dc:creator>Aaditya Dagar</dc:creator>
      <pubDate>Thu, 20 Aug 2026 11:54:37 +0000</pubDate>
      <link>https://dev.to/profitagentz/your-agent-passed-every-test-and-still-broke-in-production-3g9f</link>
      <guid>https://dev.to/profitagentz/your-agent-passed-every-test-and-still-broke-in-production-3g9f</guid>
      <description>&lt;p&gt;Code review stops at deploy. For a normal service that is mostly fine, because the code&lt;br&gt;
that shipped is the code that runs. For an agent it is not, because the decisions it makes&lt;br&gt;
after deploy were never in the diff.&lt;/p&gt;

&lt;p&gt;Here is what actually breaks, in the order we keep running into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The demo exercises one path
&lt;/h2&gt;

&lt;p&gt;A demo is a prompt going in and a good answer coming out. Production is that path plus&lt;br&gt;
every path around it. The tool call that returns a 500. The one that times out after the&lt;br&gt;
first of three steps. The response that parses on Tuesday and does not on Wednesday because&lt;br&gt;
an upstream field became nullable.&lt;/p&gt;

&lt;p&gt;None of those appear in a recording. All of them appear in week two.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Retries you did not write
&lt;/h2&gt;

&lt;p&gt;Most SDKs and agent frameworks retry internally. That is usually good for reliability and&lt;br&gt;
terrible for two things.&lt;/p&gt;

&lt;p&gt;The first is cost. A malformed response can trigger a silent second call, and at volume&lt;br&gt;
that becomes a real percentage of the bill that never shows up in a token report. If your&lt;br&gt;
dashboard tracks tokens but not call count, you cannot see it at all.&lt;/p&gt;

&lt;p&gt;The second is side effects. A retry on a read is free. A retry on something that sends,&lt;br&gt;
charges, or writes to a downstream system is not. If the action is not idempotent, the&lt;br&gt;
retry is a second real action.&lt;/p&gt;

&lt;p&gt;Instrument call count separately from token count. It is a small change and it usually&lt;br&gt;
finds money.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. No compensating action
&lt;/h2&gt;

&lt;p&gt;Draw the happy path for a three step tool sequence. Now draw what happens when step two&lt;br&gt;
times out after step one succeeded.&lt;/p&gt;

&lt;p&gt;Most designs have no answer. The agent either retries the whole sequence, repeating step&lt;br&gt;
one, or it stops and leaves the system half changed. Both are worse than failing cleanly at&lt;br&gt;
the start.&lt;/p&gt;

&lt;p&gt;The fix is not clever. Decide, per action, what undoes it, and write that down before the&lt;br&gt;
agent ships. If an action cannot be undone, it needs a gate.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Everything is treated as equally reversible
&lt;/h2&gt;

&lt;p&gt;This is the one that decides how much autonomy an agent can safely have.&lt;/p&gt;

&lt;p&gt;Sort every action the agent can take into two buckets. Reversible: reading, ranking,&lt;br&gt;
drafting, generating an audit trail, setting an internal status. Irreversible: sending a&lt;br&gt;
message to a person, moving money, triggering a verification, deleting a record.&lt;/p&gt;

&lt;p&gt;Let the agent act freely in the first bucket. Put a human gate on the second. That single&lt;br&gt;
split does more for shippability than any amount of prompt tuning, because it means a bad&lt;br&gt;
decision costs a retry rather than a phone call.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Success is measured as completion
&lt;/h2&gt;

&lt;p&gt;If the only metric is how many cases the agent closed, you have created an incentive to&lt;br&gt;
guess. An agent that closes 95 percent and quietly gets 4 of those wrong is worse than one&lt;br&gt;
that closes 80 percent and hands back the rest with a reason.&lt;/p&gt;

&lt;p&gt;So measure abstention. How often does it stop? Is it stopping on the right cases? A model&lt;br&gt;
that knows what it does not know is a model you can put in front of a customer.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Observability tells you about last Tuesday
&lt;/h2&gt;

&lt;p&gt;Traces are necessary and they are not sufficient. A trace tells you what the agent did. It&lt;br&gt;
does not stop the thing from happening again tomorrow.&lt;/p&gt;

&lt;p&gt;If a class of action needs to never happen, that belongs in a policy layer that can reject&lt;br&gt;
the action before it executes, not in a dashboard someone reads on Thursday.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do before shipping one
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every action labelled reversible or not, in writing&lt;/li&gt;
&lt;li&gt;Idempotency keys on anything with a side effect&lt;/li&gt;
&lt;li&gt;A defined compensating action for each step of a multi step sequence&lt;/li&gt;
&lt;li&gt;Call count and token count on separate graphs&lt;/li&gt;
&lt;li&gt;Abstention rate tracked as a first class metric&lt;/li&gt;
&lt;li&gt;A policy check that can refuse an action, sitting outside the model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of it is exotic. It is the same discipline you would apply to any system that can act&lt;br&gt;
on its own, which is what an agent is, even when it is wrapped in a chat box.&lt;/p&gt;




&lt;p&gt;Written by Aaditya Dagar. I build agent systems at&lt;br&gt;
&lt;a href="https://www.profitagentz.com" rel="noopener noreferrer"&gt;Profit Agentz&lt;/a&gt;, mostly for fintech, recruitment and&lt;br&gt;
operations teams.&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
  </channel>
</rss>
