<?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: Ramanpreet Singh</title>
    <description>The latest articles on DEV Community by Ramanpreet Singh (@ramanpreet_singh_701cac53).</description>
    <link>https://dev.to/ramanpreet_singh_701cac53</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3914665%2F8a68048b-2bdd-4bf6-8e10-dc36524f1e1d.jpg</url>
      <title>DEV Community: Ramanpreet Singh</title>
      <link>https://dev.to/ramanpreet_singh_701cac53</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ramanpreet_singh_701cac53"/>
    <language>en</language>
    <item>
      <title>I built a tiny CI tool to keep AI agent configs from drifting in my repo</title>
      <dc:creator>Ramanpreet Singh</dc:creator>
      <pubDate>Tue, 05 May 2026 20:11:46 +0000</pubDate>
      <link>https://dev.to/ramanpreet_singh_701cac53/i-built-a-tiny-ci-tool-to-keep-ai-agent-configs-from-drifting-in-my-repo-4lod</link>
      <guid>https://dev.to/ramanpreet_singh_701cac53/i-built-a-tiny-ci-tool-to-keep-ai-agent-configs-from-drifting-in-my-repo-4lod</guid>
      <description>&lt;p&gt;If your team uses AI coding agents on real code, you've probably hit this:&lt;/p&gt;

&lt;p&gt;The rules your agents are supposed to follow — what tools they're allowed to use, who can call who, when something should escalate — live in scattered prompts, READMEs, and Notion docs. Nothing in your CI pipeline fails when reality drifts from those documents.&lt;/p&gt;

&lt;p&gt;So I made a small thing.&lt;/p&gt;

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

&lt;p&gt;It turns the rules into YAML that lives in your repo:&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="c1"&gt;# .agent-ops/registry/tool-acl.yaml&lt;/span&gt;
&lt;span class="na"&gt;backend-builder&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;repo_read&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;repo_write_backend&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;run_backend_tests&lt;/span&gt;

&lt;span class="na"&gt;security-reviewer&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;repo_read&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;dependency_scan&lt;/span&gt;

&lt;span class="na"&gt;blocked_tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;direct_email_send&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;production_delete&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A Python validator fails CI when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An agent declares a tool the ACL doesn't grant&lt;/li&gt;
&lt;li&gt;An agent calls another agent not in the call graph&lt;/li&gt;
&lt;li&gt;A sensitive action (email send, deploy, external post) is missing required evidence fields&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's also a ~100-line Python module you can import into your own agent runner to enforce the same rules at runtime, before tools execute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;agent_ops_guard&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AgentOpsGuard&lt;/span&gt;

&lt;span class="n"&gt;guard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AgentOpsGuard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;guard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert_tool_allowed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;backend-builder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;repo_read&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;guard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assert_call_allowed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;orchestrator&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;backend-builder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a check fails it raises &lt;code&gt;PolicyDenied&lt;/code&gt; and your runner blocks the action before it happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it in 5 minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/RPSingh1990/agent-contract-tests
&lt;span class="nb"&gt;cd &lt;/span&gt;agent-contract-tests
python3 scripts/agent_ops_validate.py &lt;span class="nt"&gt;--strict&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That runs the validator against the included example. Pure Python, no dependencies.&lt;/p&gt;

&lt;p&gt;To drop the starter files into your own repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 scripts/agent_ops_init.py &lt;span class="nt"&gt;--target&lt;/span&gt; /path/to/your-repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What this isn't
&lt;/h2&gt;

&lt;p&gt;Being honest about scope:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not an agent framework — AutoGen, CrewAI, and LangGraph already do orchestration&lt;/li&gt;
&lt;li&gt;Not a sandbox — these are repo-level contracts, not process isolation&lt;/li&gt;
&lt;li&gt;Not an LLM eval suite — Promptfoo, DeepEval, and Inspect already do that&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's a small contract-test layer, narrow on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'm looking for
&lt;/h2&gt;

&lt;p&gt;Single author, MIT, days old. The questions I actually have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does the YAML shape match how teams structure agent rules in practice, or is the abstraction wrong?&lt;/li&gt;
&lt;li&gt;Are any of the checks process-for-process's-sake?&lt;/li&gt;
&lt;li&gt;What drift have you seen that this wouldn't catch?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/RPSingh1990/agent-contract-tests" rel="noopener noreferrer"&gt;https://github.com/RPSingh1990/agent-contract-tests&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Issues and PRs welcome. So is "this is wrong because..."&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
