<?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: Shaurya</title>
    <description>The latest articles on DEV Community by Shaurya (@shaunblogs).</description>
    <link>https://dev.to/shaunblogs</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%2F4048134%2F7aefbf11-6c03-40ce-8ddc-d19f495f501d.gif</url>
      <title>DEV Community: Shaurya</title>
      <link>https://dev.to/shaunblogs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shaunblogs"/>
    <language>en</language>
    <item>
      <title>An AI Agent Found the Outage. I Still Wouldn't Give It kubectl.</title>
      <dc:creator>Shaurya</dc:creator>
      <pubDate>Sun, 26 Jul 2026 16:13:13 +0000</pubDate>
      <link>https://dev.to/shaunblogs/an-ai-agent-found-the-outage-i-still-wouldnt-give-it-kubectl-ob4</link>
      <guid>https://dev.to/shaunblogs/an-ai-agent-found-the-outage-i-still-wouldnt-give-it-kubectl-ob4</guid>
      <description>&lt;h1&gt;
  
  
  An AI Agent Found the Outage. I Still Wouldn't Give It &lt;code&gt;kubectl&lt;/code&gt;.
&lt;/h1&gt;

&lt;p&gt;A bad payment release was breaking checkout. The incident agent found the&lt;br&gt;
failed requests, connected them to the release, and proposed the right fix: roll&lt;br&gt;
back &lt;code&gt;payment-service&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I still did not want the agent to have a Kubernetes credential.&lt;/p&gt;

&lt;p&gt;That tension became &lt;strong&gt;MANDATE&lt;/strong&gt;, the project I built for the Agents of SigNoz&lt;br&gt;
hackathon. It is an authority layer between an AI agent and the tools that can&lt;br&gt;
change a real system. SigNoz is not just where I send traces after the fact. It&lt;br&gt;
detects the incident, supplies bounded evidence for the decision, records the&lt;br&gt;
approval and execution path, and verifies whether the system actually&lt;br&gt;
recovered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bk1fd7iqk75wejksr46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8bk1fd7iqk75wejksr46.png" alt="MANDATE product map" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The missing part of agent observability
&lt;/h2&gt;

&lt;p&gt;Normal agent tracing can answer useful questions: Which model ran? Which tool&lt;br&gt;
did it call? How long did it take? How many tokens did it use?&lt;/p&gt;

&lt;p&gt;For an action-taking agent, I needed another set of answers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Who gave this agent authority?&lt;/li&gt;
&lt;li&gt;Which tools and resources were in scope?&lt;/li&gt;
&lt;li&gt;What live evidence justified the action?&lt;/li&gt;
&lt;li&gt;Did policy allow, deny, or pause it for approval?&lt;/li&gt;
&lt;li&gt;What exact arguments did the operator approve?&lt;/li&gt;
&lt;li&gt;Did the action work in the real system?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;MANDATE keeps these decisions outside the model. An agent may propose a useful&lt;br&gt;
next step, but a deterministic gateway derives identity, resource scope, risk,&lt;br&gt;
budget, evidence requirements, and approval policy from a signed mandate and&lt;br&gt;
operator-owned configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj2tdhb5osbjta77kmi1o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj2tdhb5osbjta77kmi1o.png" alt="MANDATE system architecture" width="799" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The reference stack uses a Python/FastAPI gateway, a Next.js operator console,&lt;br&gt;
Slack approvals, a Kind Kubernetes workload, OpenTelemetry, and a self-hosted&lt;br&gt;
SigNoz deployment provisioned through Foundry. Agents connect through MCP or&lt;br&gt;
REST, while Kubernetes credentials and SigNoz service-account keys remain on&lt;br&gt;
the gateway side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftsahalr69eu5ma81304x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftsahalr69eu5ma81304x.png" alt="MANDATE technical architecture" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The incident I used to test it
&lt;/h2&gt;

&lt;p&gt;The demo is deliberately small: &lt;code&gt;checkout-service&lt;/code&gt; calls &lt;code&gt;payment-service&lt;/code&gt;.&lt;br&gt;
A controlled release changes the payment deployment to a regressed image and&lt;br&gt;
generates failed checkouts.&lt;/p&gt;

&lt;p&gt;One native SigNoz metric alert watches the five-minute checkout failure rate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;checkout SLO breach&lt;/span&gt;
&lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="s"&gt;100 * sum(rate({"checkout_requests_failed_total"}[5m]))&lt;/span&gt;
  &lt;span class="s"&gt;/ clamp_min(sum(rate({"checkout_requests_total"}[5m])), 1) &amp;gt; 5&lt;/span&gt;
&lt;span class="na"&gt;severity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;critical&lt;/span&gt;
&lt;span class="na"&gt;channels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;automation&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A second, trace-based rule detects a span named &lt;code&gt;mandate.release.deploy&lt;/code&gt; with&lt;br&gt;
&lt;code&gt;mandate.release.regressed = true&lt;/code&gt;. This gives me both customer impact and a&lt;br&gt;
release marker instead of asking the agent to guess from a red graph.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;MANDATE Incident Command&lt;/strong&gt; dashboard combines the checkout error rate,&lt;br&gt;
payment latency, failed-request traces, release markers, Kubernetes state, and&lt;br&gt;
recovery evidence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkohdpj1j50b9pad3dwi9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkohdpj1j50b9pad3dwi9.jpg" alt="SigNoz MANDATE Incident Command dashboard" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When either service/release alert fires, SigNoz sends a webhook to MANDATE. The&lt;br&gt;
incident coordinator receives a short-lived root mandate, then delegates&lt;br&gt;
read-only investigation to a SigNoz investigator. That child can inspect the&lt;br&gt;
payment deployment and query a bounded SigNoz evidence bundle, but it cannot&lt;br&gt;
inherit new tools, a larger budget, or a wider resource scope.&lt;/p&gt;

&lt;p&gt;The proposed rollback is governed independently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;k8s.rollback_deployment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;kubernetes&lt;/span&gt;
  &lt;span class="na"&gt;cost_usd&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0.02&lt;/span&gt;
  &lt;span class="na"&gt;policy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;mutating&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;denial_only&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="na"&gt;approval_required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
    &lt;span class="na"&gt;risk_level&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;critical&lt;/span&gt;
    &lt;span class="na"&gt;evidence_required&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;required&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The gateway records an immutable action plan containing the target, canonical&lt;br&gt;
arguments, evidence digest, policy version, blast radius, and expiry. The&lt;br&gt;
operator sees that exact plan in Slack or the MANDATE console—not a vague&lt;br&gt;
“approve the agent” button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb3s6fbqasnpih7cf1qer.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb3s6fbqasnpih7cf1qer.png" alt="MANDATE operator console with an exact action plan" width="800" height="465"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Approval only advances the action to another checkpoint. Immediately before&lt;br&gt;
execution, the gateway revalidates the mandate, argument digest, expiry,&lt;br&gt;
budget, audit chain, dependency health, and live evidence. Only then does the&lt;br&gt;
gateway perform the rollback. It queries the post-state afterward and records&lt;br&gt;
verification as a separate phase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2lizt3bwsqwpkdc2hyou.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2lizt3bwsqwpkdc2hyou.png" alt="The governed action loop" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  How I used SigNoz
&lt;/h2&gt;

&lt;p&gt;I ended up with two correlated telemetry lanes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agent-runtime telemetry explains model calls, subagents, tool calls, latency,
token use, evaluation score, and estimated cost.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mandate.*&lt;/code&gt; telemetry explains capability validation, delegation, policy,
planning, approval, execution, verification, revocation, and audit health.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both lanes use low-cardinality identifiers such as &lt;code&gt;mandate.id&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;mandate.parent.id&lt;/code&gt;, &lt;code&gt;mandate.root.id&lt;/code&gt;, and &lt;code&gt;mandate.action.id&lt;/code&gt;. Full prompts,&lt;br&gt;
capabilities, authorization headers, and API keys are intentionally excluded.&lt;/p&gt;

&lt;p&gt;The repository reconciles three dashboards, seven saved investigation views,&lt;br&gt;
and eighteen metric-, log-, and trace-based alerts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Authority Overview&lt;/strong&gt; for policy, approval, delegation, execution,
verification, budgets, and audit integrity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incident Command&lt;/strong&gt; for service impact, release correlation, infrastructure,
and recovery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent &amp;amp; LLM Cost&lt;/strong&gt; for model latency, errors, tokens, cost, tool calls, and
evaluations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0fcckm66xr3yx087any.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0fcckm66xr3yx087any.jpg" alt="SigNoz MANDATE Authority Overview dashboard" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfdt7pndnzs8rzqpt1x0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfdt7pndnzs8rzqpt1x0.jpg" alt="SigNoz Agent and LLM Cost dashboard" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SigNoz Query Builder is important here because the evidence collector needs&lt;br&gt;
structured, reproducible queries across metrics and traces. The SigNoz MCP&lt;br&gt;
server exposes those observability capabilities to the gateway, but MANDATE&lt;br&gt;
proxies only the read-only subset granted to the current agent. The agent never&lt;br&gt;
receives the underlying SigNoz key.&lt;/p&gt;
&lt;h2&gt;
  
  
  The bugs that changed the design
&lt;/h2&gt;

&lt;p&gt;The most useful lessons came from failures, not the happy-path demo.&lt;/p&gt;

&lt;p&gt;At one point, a child remediation mandate accidentally included a resource&lt;br&gt;
outside its parent's scope. The gateway correctly rejected the delegation, but&lt;br&gt;
the webhook handler returned HTTP 502. SigNoz retried the alert, and every retry&lt;br&gt;
spawned another incident coordinator. I fixed both sides of the problem: child&lt;br&gt;
authority cannot expand beyond the parent, and a failed incident workflow is&lt;br&gt;
recorded and acknowledged idempotently instead of inviting a retry storm.&lt;/p&gt;

&lt;p&gt;I also approved a rollback after manually restoring the healthy deployment.&lt;br&gt;
The action moved to &lt;code&gt;executing&lt;/code&gt;, then stopped with &lt;code&gt;evidence_unavailable&lt;/code&gt;.&lt;br&gt;
Initially that looked like a broken rollback. It was actually the safety model&lt;br&gt;
working: the release marker and failure evidence that justified the plan were&lt;br&gt;
no longer live. An approval is consent for one current plan, not permission to&lt;br&gt;
execute it later under different conditions.&lt;/p&gt;

&lt;p&gt;Finally, an overly broad infrastructure query hit ClickHouse's memory&lt;br&gt;
OvercommitTracker. That pushed me toward short evidence windows, bounded&lt;br&gt;
aggregates, and low-cardinality metric labels. Observability queries are part&lt;br&gt;
of the operational path; they need budgets too.&lt;/p&gt;
&lt;h2&gt;
  
  
  Reproducing the flow
&lt;/h2&gt;

&lt;p&gt;The repository includes &lt;code&gt;casting.yaml&lt;/code&gt; and &lt;code&gt;casting.yaml.lock&lt;/code&gt; so the SigNoz&lt;br&gt;
deployment can be reproduced with Foundry. For my local setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uv run mandate setup
uv run mandate start &lt;span class="nt"&gt;--profile&lt;/span&gt; lab &lt;span class="nt"&gt;--signoz&lt;/span&gt;
make kind-up kind-build kind-deploy
make demo-trigger-payment-regression
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The final command prepares observable signals, verifies the SigNoz assets,&lt;br&gt;
deploys the controlled payment regression, and generates checkout failures.&lt;br&gt;
From there, I watch Incident Command, inspect the evidence-backed rollback, and&lt;br&gt;
approve the exact plan in Slack. I do not manually reset the workload while&lt;br&gt;
that approval is pending, because doing so intentionally makes the evidence&lt;br&gt;
stale.&lt;/p&gt;

&lt;p&gt;The demo remains deterministic even without a live LLM call. A capped live&lt;br&gt;
model path exists for experimentation, but model output never controls a&lt;br&gt;
critical policy branch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would keep
&lt;/h2&gt;

&lt;p&gt;The main lesson is simple: seeing an agent's reasoning is not the same as&lt;br&gt;
controlling its authority.&lt;/p&gt;

&lt;p&gt;SigNoz gave MANDATE a shared evidence plane for the incident, the agent, the&lt;br&gt;
policy decision, the human checkpoint, the real execution, and the recovery&lt;br&gt;
proof. That made the interesting question visible end to end:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not merely “What did the agent do?” but “Why was it allowed to do it, and how&lt;br&gt;
do we know it worked?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The source, reproducible setup, dashboards, alerts, and runbooks are available&lt;br&gt;
in the &lt;a href="https://github.com/ShauryaSwarup/Mandate" rel="noopener noreferrer"&gt;MANDATE repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Further reading:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://signoz.io/docs/ai/signoz-mcp-server/" rel="noopener noreferrer"&gt;SigNoz MCP Server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://signoz.io/docs/userguide/query-builder-v5/" rel="noopener noreferrer"&gt;SigNoz Query Builder v5&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://opentelemetry.io/docs/concepts/signals/" rel="noopener noreferrer"&gt;OpenTelemetry signals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.wemakedevs.org/hackathons/signoz" rel="noopener noreferrer"&gt;Agents of SigNoz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>kubernetes</category>
      <category>agents</category>
      <category>observability</category>
    </item>
  </channel>
</rss>
