<?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: Kmori</title>
    <description>The latest articles on DEV Community by Kmori (@kmori_f732750cda96b27efe7).</description>
    <link>https://dev.to/kmori_f732750cda96b27efe7</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%2F3980380%2F8a48e405-8cc1-44cf-94a1-84bd11422eb0.png</url>
      <title>DEV Community: Kmori</title>
      <link>https://dev.to/kmori_f732750cda96b27efe7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kmori_f732750cda96b27efe7"/>
    <language>en</language>
    <item>
      <title>I built an open-source authorization layer for AI agents — here's what the audit trail looks like</title>
      <dc:creator>Kmori</dc:creator>
      <pubDate>Fri, 12 Jun 2026 15:00:00 +0000</pubDate>
      <link>https://dev.to/kmori_f732750cda96b27efe7/i-built-an-open-source-authorization-layer-for-ai-agents-heres-what-the-audit-trail-looks-like-n5g</link>
      <guid>https://dev.to/kmori_f732750cda96b27efe7/i-built-an-open-source-authorization-layer-for-ai-agents-heres-what-the-audit-trail-looks-like-n5g</guid>
      <description>&lt;h1&gt;
  
  
  I built an open-source authorization layer for AI agents — here's what the audit trail looks like
&lt;/h1&gt;

&lt;p&gt;When an AI agent takes an action in production — isolates a host, rotates credentials, applies a patch — you can log what happened. But you can't prove it was &lt;strong&gt;authorized&lt;/strong&gt;. Logs show what happened. They don't prove who said it was allowed to happen.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://github.com/kmori-source/shani" rel="noopener noreferrer"&gt;Shani&lt;/a&gt; to solve this. It sits between an agent's intent and execution, issues signed authorization tokens, and produces a tamper-evident audit trail.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core idea
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent ──DecisionProposal──► Shani ──ADO──► ExecutionBoundary ──Capability──► World
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;No ADO → no Capability → no execution.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent submits a &lt;code&gt;DecisionProposal&lt;/code&gt; (what it wants to do + evidence). Shani evaluates it against a YAML policy — blast radius, reversibility, environment risk, evidence quality. If authorized, it issues a signed &lt;code&gt;ADO&lt;/code&gt; (Authorized Decision Object). The agent can only act through a &lt;code&gt;Capability&lt;/code&gt; derived from a valid ADO.&lt;/p&gt;

&lt;p&gt;The risk level (D-SAL 0–4) is computed by Shani from proposal context — &lt;strong&gt;not declared by the agent&lt;/strong&gt;. An agent cannot claim its own action is low-risk.&lt;/p&gt;

&lt;p&gt;When D-SAL exceeds a threshold, Shani blocks and waits for human approval via Slack, webhook, or CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Real example: vulnerability remediation CI pipeline
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Scan&lt;/span&gt;
pip-audit &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; pip-audit.json

&lt;span class="c"&gt;# Shani judgment (auto-approve in CI, HITL in prod)&lt;/span&gt;
&lt;span class="nv"&gt;SHANI_HITL_AUTO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 python examples/vuln_remediation/scenario.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's what a real run looks like — 5 vulnerabilities detected, evaluated, and patched:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;[scan] Running pip-audit…
  5 vulnerability finding(s) across 47 packages

[govern] PYSEC-2026-196 [MEDIUM]  pip 24.0
  AUTHORIZED — ADO ff73fedc…  dsal=1
  OK: upgraded to 26.1.2

[govern] CVE-2025-8869 [MEDIUM]  pip 24.0
  AUTHORIZED — ADO 6590afbf…  dsal=1
  OK: upgraded to 25.3

[govern] CVE-2026-6357 [MEDIUM]  pip 24.0
  AUTHORIZED — ADO 4cd03165…  dsal=1
  OK: upgraded to 26.1

[audit] audit.json  (executed=5 denied=0 skipped=0)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the audit trail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"schema_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"agent_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vuln-remediation-agent/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mode"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"auto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"summary"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"executed"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"denied"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"skipped"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"entries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"vuln_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PYSEC-2026-196"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"package"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pip"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"executed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"ado_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ff73fedc-..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"approved_by"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SOC-Analyst"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"detail"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"OK: upgraded to 26.1.2"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every entry proves not just that the upgrade happened, but that it was &lt;strong&gt;authorized, by whom, and against which specific vulnerability finding&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Also works with nanoclaw (zero TypeScript required)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm run chat &lt;span class="s2"&gt;"Isolate host:prod-db-12. Evidence: EDR detected lateral movement (0.93), SIEM anomalous outbound (0.88)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude reads the Shani SKILL.md, submits a DecisionProposal, waits for HITL approval, and only proceeds after receiving a signed ADO.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD pipeline integration
&lt;/h2&gt;

&lt;p&gt;Ships a GitHub Actions workflow: Trivy + Grype + OSV-Scanner → Shani judgment → &lt;code&gt;shani-audit.json&lt;/code&gt;. Gate your deployments on policy, not just vulnerability counts.&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="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Shani vulnerability judgment&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;SHANI_HITL_AUTO&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;1'&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
    &lt;span class="s"&gt;python examples/vuln_remediation/shani_vuln_judge.py \&lt;/span&gt;
      &lt;span class="s"&gt;--trivy trivy.json --grype grype.json \&lt;/span&gt;
      &lt;span class="s"&gt;--output shani-audit.json \&lt;/span&gt;
      &lt;span class="s"&gt;--fail-on-denied&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What this gives you that observability tools don't
&lt;/h2&gt;

&lt;p&gt;LangSmith answers "what did the agent do?" Shani answers "was it authorized, by whom, and why was it blocked?" These are complementary. But for the conversation with your security team, compliance officer, or a regulator — you need both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;v0.4, self-hosted only&lt;/li&gt;
&lt;li&gt;Evidence is agent-submitted (push model — pull-based verification not yet implemented)&lt;/li&gt;
&lt;li&gt;YAML policy is expressive but not yet well-documented for complex cases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apache 2.0: &lt;a href="https://github.com/kmori-source/shani" rel="noopener noreferrer"&gt;github.com/kmori-source/shani&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're shipping AI agents to production and have hit the accountability problem, I'd genuinely like to hear what you've tried.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tags: #security #ai #devops #opensource #llm&lt;/em&gt;&lt;/p&gt;

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