<?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: Kousik Singha</title>
    <description>The latest articles on DEV Community by Kousik Singha (@singhakousik363del).</description>
    <link>https://dev.to/singhakousik363del</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%2F4100925%2F8bc757cc-922d-43e3-82fe-d69a10bb1c3f.png</url>
      <title>DEV Community: Kousik Singha</title>
      <link>https://dev.to/singhakousik363del</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/singhakousik363del"/>
    <language>en</language>
    <item>
      <title>I built an AI agent for production incidents. The interesting part is when it refuses to act.</title>
      <dc:creator>Kousik Singha</dc:creator>
      <pubDate>Sun, 30 Aug 2026 03:10:03 +0000</pubDate>
      <link>https://dev.to/singhakousik363del/i-built-an-ai-agent-for-production-incidents-the-interesting-part-is-when-it-refuses-to-act-1ddg</link>
      <guid>https://dev.to/singhakousik363del/i-built-an-ai-agent-for-production-incidents-the-interesting-part-is-when-it-refuses-to-act-1ddg</guid>
      <description>&lt;p&gt;I wrote this for the All Things Agentic Hackathon.&lt;/p&gt;

&lt;p&gt;Every incident-response demo you have seen ends the same way: something breaks, the agent fixes it, everyone applauds.&lt;/p&gt;

&lt;p&gt;I want to show you the opposite. Here is my agent, at 95% confidence, having correctly diagnosed a bad deployment, deciding not to roll it back.&lt;/p&gt;

&lt;p&gt;That refusal is the whole project.&lt;/p&gt;

&lt;p&gt;The question underneath&lt;/p&gt;

&lt;p&gt;At 3am an alert fires. An engineer wakes up, reads several hundred log lines, correlates them against recent deploys, and rolls something back. Most of it is mechanical. It is an obvious target for automation.&lt;/p&gt;

&lt;p&gt;But "automate it with an LLM" does not dissolve the problem, it relocates it. The new question is: how much would you let an agent change in production without asking you first?&lt;/p&gt;

&lt;p&gt;Give it too little and it is a chatbot that writes summaries. Give it too much and one confidently wrong diagnosis takes down your service at 3am with nobody watching.&lt;/p&gt;

&lt;p&gt;I named the project Sonjomon — Bengali for restraint.&lt;/p&gt;

&lt;p&gt;The autonomy ladder&lt;/p&gt;

&lt;p&gt;An agent should not have one blanket permission level. How far it may act alone is a function of two things: how confident it is, and how much damage the proposed action does if that confidence turns out to be wrong.&lt;/p&gt;

&lt;p&gt;tier = f(confidence, blast_radius)&lt;/p&gt;

&lt;p&gt;OBSERVE   record findings, take no action&lt;br&gt;
SUGGEST   recommend to a human, do not execute&lt;br&gt;
APPROVE   stage the action, execute on explicit approval&lt;br&gt;
ACT       execute now, then verify independently&lt;/p&gt;

&lt;p&gt;A restart is medium risk — reversible in seconds. A rollback is high risk — it shifts production traffic, and a needless rollback during a real outage extends it. Deleting data is critical, and no confidence level unlocks it.&lt;/p&gt;

&lt;p&gt;Six conditions can only ever push the tier down, never up: the blast-radius ceiling, thin evidence, a similar action that just failed, a third attempt at the same fix, a stale incident, and a global dry-run switch.&lt;/p&gt;

&lt;p&gt;Nothing pushes it up. A wrong action is far more expensive than a missed one.&lt;/p&gt;

&lt;p&gt;Three things the model does not control&lt;/p&gt;

&lt;p&gt;It cannot set its own blast radius. The model proposes an action name; a registry in code supplies the risk. If the risk table lived in the prompt, a confidently wrong model could talk itself into a rollback by calling it low-risk.&lt;/p&gt;

&lt;p&gt;It cannot decide whether it may execute. That is deterministic, unit-tested code — installed as ADK's before_tool_callback, so the policy sits on the framework's real enforcement seam. Returning a dict cancels the tool call and hands that dict back to the model, so a blocked model learns why instead of silently retrying.&lt;/p&gt;

&lt;p&gt;It cannot grade its own work. Verification is an independent HTTP probe, recorded as a separate event. An agent that self-reports success is worthless during an outage.&lt;/p&gt;

&lt;p&gt;Forty-one tests hold this in place. One of them asserts that a 96%-confident agent still cannot run a destructive action.&lt;/p&gt;

&lt;p&gt;What happened when I ran it&lt;/p&gt;

&lt;p&gt;Fourteen live incidents against a deliberately fragile Cloud Run service.&lt;/p&gt;

&lt;p&gt;It found things I did not plant. In one incident it compared container image digests across five revisions and concluded that three of them — including the one named "healthy" — shared identical broken code, so a rollback would achieve nothing. It escalated instead. That inference was in neither its registry nor its prompt.&lt;/p&gt;

&lt;p&gt;In another it noticed every revision had traffic_percent: 0. That was a real misconfiguration I had created by accident while setting up, and it caught it.&lt;/p&gt;

&lt;p&gt;It failed, and handled the failure correctly. In one incident it reached the ACT tier and ran a real command against production. The command failed — a missing IAM permission I had not anticipated. The agent saw the failure, did not claim success, re-diagnosed the problem, and the loop breaker then required a human.&lt;/p&gt;

&lt;p&gt;That IAM gap is worth naming. The agent had run.admin on exactly one service and still could not update it, because Cloud Run needs artifactregistry.repositories.downloadArtifacts to pull the image for a new revision. I only found it because the agent tried, failed, and logged the exact permission. Least privilege is discovered by breaking things.&lt;/p&gt;

&lt;p&gt;Once, it said nothing at all. Forty percent confidence, ambiguous signals. Too low to even offer an opinion. In the log it simply reads: confidence too low to even recommend.&lt;/p&gt;

&lt;p&gt;That is the row I am proudest of.&lt;/p&gt;

&lt;p&gt;Three things I got wrong&lt;/p&gt;

&lt;p&gt;I calibrated the thresholds before meeting the model. My initial ACT floor was 0.90. Gemini's self-reported confidence clusters in 0.85–0.95 for a well-evidenced diagnosis, which left the ACT tier effectively unreachable. Seven live incidents told me what no synthetic test would have.&lt;/p&gt;

&lt;p&gt;Cloud Run cuts CPU the moment a request is acked. The push endpoint acks immediately and investigates in a background task — correct design, but with default CPU allocation the investigation crawled and the instance froze before finishing. --no-cpu-throttling is not optional for a long-running agent. That cost me an evening.&lt;/p&gt;

&lt;p&gt;My first chaos injection destroyed its own evidence. The memory-leak fault climbed until the container hit OOM and restarted — which wiped the in-memory fault state and dropped memory back to zero before the alert's alignment window closed. The agent kept arriving at a healthy service and correctly reporting "transient, already resolved." The fix was to cap the leak just below the container limit so it holds there instead of dying.&lt;/p&gt;

&lt;p&gt;The uncomfortable result&lt;/p&gt;

&lt;p&gt;Across fourteen incidents the agent almost never changed production. Every time, that was the correct call: two failure modes have no safe automatic fix by design, one had a rollback that would have achieved nothing, one had already self-resolved.&lt;/p&gt;

&lt;p&gt;I expected to be disappointed by that. I am not.&lt;/p&gt;

&lt;p&gt;The friction this removes is the diagnosis, not the fix. An engineer woken at 3am reaches a root cause in twenty to thirty minutes. This agent did it in 8 to 30 seconds, every time, with the file, the line number, the occurrence count, and the offending revision.&lt;/p&gt;

&lt;p&gt;The fix is the easy part. Knowing you are right enough to apply it is not.&lt;/p&gt;

&lt;p&gt;An agent that acts anyway, to look useful, is the failure mode this project exists to prevent.&lt;/p&gt;

&lt;p&gt;Code: &lt;a href="https://github.com/singhakousik363-del/sonjomon" rel="noopener noreferrer"&gt;https://github.com/singhakousik363-del/sonjomon&lt;/a&gt;&lt;br&gt;
Demo: &lt;a href="https://youtu.be/jBE6wztwGic" rel="noopener noreferrer"&gt;https://youtu.be/jBE6wztwGic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built solo in ten days, as a first-year CS student, on Gemini 3.5, Google ADK, Cloud Run, Pub/Sub, Firestore, Cloud Logging, Cloud Monitoring and Secret Manager.&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>ai</category>
      <category>devops</category>
      <category>sre</category>
    </item>
  </channel>
</rss>
