<?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: akash b</title>
    <description>The latest articles on DEV Community by akash b (@akash_b_efd6745c303bb2a81).</description>
    <link>https://dev.to/akash_b_efd6745c303bb2a81</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%2F4047335%2Fbbb57caf-7e13-4d05-ba7a-89d645f660c5.png</url>
      <title>DEV Community: akash b</title>
      <link>https://dev.to/akash_b_efd6745c303bb2a81</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akash_b_efd6745c303bb2a81"/>
    <language>en</language>
    <item>
      <title>DevGuard AI: A Self-Observing Multi-Agent Security Pipeline Built on SigNoz</title>
      <dc:creator>akash b</dc:creator>
      <pubDate>Sat, 25 Jul 2026 22:16:42 +0000</pubDate>
      <link>https://dev.to/akash_b_efd6745c303bb2a81/devguard-ai-a-self-observing-multi-agent-security-pipeline-built-on-signoz-1pn0</link>
      <guid>https://dev.to/akash_b_efd6745c303bb2a81/devguard-ai-a-self-observing-multi-agent-security-pipeline-built-on-signoz-1pn0</guid>
      <description>&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Manual security code review costs roughly $85/hour of engineer time and doesn't scale with commit velocity. Most AI code-scanners stop at "here's a vulnerability" — they don't verify their own fixes, and they're completely opaque about what they're actually doing under the hood.&lt;/p&gt;

&lt;p&gt;DevGuard AI is my attempt at fixing both problems for the "Agents of SigNoz" hackathon: an autonomous pipeline that detects vulnerabilities, patches them, adversarially reviews its own work, and — critically — observes itself through SigNoz closely enough to change its own behavior mid-request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Request flow:&lt;/strong&gt; Browser → POST /scan → FastAPI backend → circuit-breaker-wrapped pipeline → Scanner Agent (RAG-augmented) → Fixer/Validator reflection loop (up to 3 attempts) → response.&lt;/p&gt;

&lt;p&gt;Three agents do the actual security work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scanner&lt;/strong&gt; — RAG-augmented vulnerability detection against a CWE/OWASP knowledge base, always on the strongest available model (a missed critical vulnerability is far more expensive than the token cost of using a bigger model).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixer&lt;/strong&gt; — generates a patch, with prior reviewer feedback folded in on retries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validator&lt;/strong&gt; — an adversarial reviewer whose entire job is finding reasons the fix is inadequate. It only passes a fix it would "personally ship."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the Validator rejects a fix, its feedback goes straight back into the Fixer's next prompt. This loops up to 3 times before the pipeline gives up and returns its best attempt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where SigNoz Comes In
&lt;/h2&gt;

&lt;p&gt;Every one of those steps — Scanner, each Fixer/Validator retry, the circuit breaker's state transitions — is wrapped in an OpenTelemetry span via a custom &lt;code&gt;@traced&lt;/code&gt; decorator. Open a trace for a single scan in SigNoz and you see the entire reflection loop as a flame graph: which attempt failed, how long each agent took, and exactly where an LLM call retried after a transient failure.&lt;/p&gt;

&lt;p&gt;On top of tracing, I built custom OTel metrics feeding a "DevGuard AI Command Center" dashboard in SigNoz:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;devguard.llm.tokens_total&lt;/code&gt; / &lt;code&gt;devguard.llm.cost_total&lt;/code&gt; — real token and cost accounting per scan, tagged by agent and model&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;devguard.scan.latency&lt;/code&gt; — a histogram driving p50/p95/p99 panels&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;devguard.cache.hit_total&lt;/code&gt; / &lt;code&gt;miss_total&lt;/code&gt; — Redis cache efficiency&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;devguard.circuit_breaker.state_changes_total&lt;/code&gt; — how often the resilience layer trips&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also configured three SigNoz Alert Rules so the pipeline monitors itself in production terms, not just in a dashboard someone has to remember to check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost Budget Exceeded&lt;/strong&gt; — fires if cumulative LLM spend crosses a threshold&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SLO Degradation - High Latency&lt;/strong&gt; — fires if p99 scan latency exceeds 15s&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Circuit Breaker Stuck Open&lt;/strong&gt; — fires if the breaker trips repeatedly, signalling the upstream LLM provider is struggling&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Differentiator: A Self-Observing Agent Layer
&lt;/h2&gt;

&lt;p&gt;This is the part I'm most excited about. Most "observability for AI agents" projects are one-directional — the agent runs, SigNoz watches. DevGuard closes the loop: the pipeline reads its &lt;em&gt;own&lt;/em&gt; recent telemetry back out through SigNoz's MCP server before making key decisions, via a small &lt;code&gt;mcp_client.py&lt;/code&gt; that speaks the real MCP protocol (streamable-HTTP, authenticated) against SigNoz's own MCP server — confirmed working with a live &lt;code&gt;session.initialize()&lt;/code&gt; + &lt;code&gt;list_tools()&lt;/code&gt; handshake returning real SigNoz tool names.&lt;/p&gt;

&lt;p&gt;Two adaptations run off that telemetry today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Telemetry-aware routing&lt;/strong&gt; — if recent LLM spend is trending high, the Fixer can be routed to a cheaper model tier — except for critical-severity findings, which always get the strongest model regardless of cost pressure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Guardian&lt;/strong&gt; — batches cumulative-cost checks and flips a global "conservation mode" flag when a session's spend crosses a budget.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every adaptation is (a) returned in the API response so the frontend can show it, and (b) stamped onto the active OpenTelemetry span as an attribute — so a routing override is visible both to the end user and inside the SigNoz trace that produced it. And the whole layer is deliberately fail-safe: if SigNoz or its MCP server is unreachable, every function degrades to "behave exactly as if this layer didn't exist" rather than blocking a scan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resilience
&lt;/h2&gt;

&lt;p&gt;A hand-rolled circuit breaker (CLOSED/OPEN/HALF_OPEN) sits between the pipeline and the LLM provider. If the provider starts failing, the breaker trips, the pipeline falls back to a cheaper model automatically, and a state transition event gets logged onto the active span — visible directly in the SigNoz trace, not buried in application logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd Do With More Time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Wire the MCP-informed routing decision to trigger visibly on every scan, not just under cost pressure, so it's easier to demo end-to-end&lt;/li&gt;
&lt;li&gt;Add a full postmortem-generation flow: when the circuit breaker trips, have a small LLM call write a plain-English root-cause summary automatically&lt;/li&gt;
&lt;li&gt;Push the accuracy benchmark (14 hand-labeled OWASP snippets, tracking precision/recall) into the dashboard as a live panel&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing Thoughts
&lt;/h2&gt;

&lt;p&gt;Building this for the hackathon reinforced something I didn't fully appreciate going in: instrumenting an AI pipeline for observability is the easy 80%. The hard 20% — and the actually interesting part — is closing the loop so the system can &lt;em&gt;act&lt;/em&gt; on what it's observing about itself, without that self-observation ever being allowed to break the thing it's trying to help.&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/akashbichukale0111/devguard-ai" rel="noopener noreferrer"&gt;github.com/akashbichukale0111/devguard-ai&lt;/a&gt;&lt;br&gt;
Built for the SigNoz "Agents of SigNoz" hackathon by WeMakeDevs.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>devchallenge</category>
      <category>security</category>
    </item>
  </channel>
</rss>
