<?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: kironovlaziz-del</title>
    <description>The latest articles on DEV Community by kironovlaziz-del (@kironovlazizdel).</description>
    <link>https://dev.to/kironovlazizdel</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%2F4100400%2F9335e83d-c4b1-4f18-9bd9-2e44f4291047.png</url>
      <title>DEV Community: kironovlaziz-del</title>
      <link>https://dev.to/kironovlazizdel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kironovlazizdel"/>
    <language>en</language>
    <item>
      <title>Why 'monitoring' isn't enough for AI agents — and how I made delegation cryptographically verifiable</title>
      <dc:creator>kironovlaziz-del</dc:creator>
      <pubDate>Tue, 22 Sep 2026 01:24:51 +0000</pubDate>
      <link>https://dev.to/kironovlazizdel/why-monitoring-isnt-enough-for-ai-agents-and-how-i-made-delegation-cryptographically-verifiable-5bad</link>
      <guid>https://dev.to/kironovlazizdel/why-monitoring-isnt-enough-for-ai-agents-and-how-i-made-delegation-cryptographically-verifiable-5bad</guid>
      <description>&lt;h2&gt;
  
  
  The problem nobody talks about with AI agents
&lt;/h2&gt;

&lt;p&gt;We're rushing to give AI agents autonomy. An orchestrator agent calls a research agent, which calls a writer agent, which calls a tool. Each hop, one agent hands some of its authority to another.&lt;br&gt;
Every "AI governance" tool I looked at solves this the same way: it logs everything. You get a dashboard, a timeline, an audit trail. Which sounds great — until you ask one uncomfortable question:&lt;br&gt;
When an auditor asks "who authorized this agent to spend money / delete data / call that API?", is a log you control actually proof?&lt;br&gt;
It isn't. A log is a claim. If the server writes the log, the server can write anything. Monitoring tells you what a system says happened. It doesn't let anyone prove it independently.&lt;br&gt;
As agents get more autonomous — and as regulation like the EU AI Act starts demanding "verifiable accountability" — I think this gap becomes a real problem. So I tried to close it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The idea: sign the delegation, not just log it
&lt;/h2&gt;

&lt;p&gt;Instead of recording that Agent A delegated to Agent B, what if the delegation itself were cryptographically signed by A? Then:&lt;br&gt;
Anyone can verify the signature against A's public key&lt;br&gt;
The server holds only public keys — it can verify a delegation, but it can never forge one&lt;br&gt;
An auditor can check the proof on their own machine, without trusting my server at all&lt;br&gt;
That last point is the whole game. "Trust me, here's my log" becomes "here's the math, check it yourself."&lt;br&gt;
I built this into an open-source platform (AI Control Tower), but the technique is general. Let me show the core of it.&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%2F6yixqv98on7j2z642f25.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%2F6yixqv98on7j2z642f25.png" alt=" " width="800" height="1405"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Why Ed25519
&lt;/h2&gt;

&lt;p&gt;For signing delegations you want:&lt;br&gt;
Small keys and signatures (32-byte public keys, 64-byte signatures) — these get stored and passed around a lot&lt;br&gt;
Fast verification — you may verify a whole chain of hops&lt;br&gt;
Deterministic signatures — no per-signature randomness to get wrong&lt;br&gt;
Available everywhere — including natively in the browser via WebCrypto&lt;br&gt;
Ed25519 checks every box. It's modern, boring in the good way, and — crucially for the "verify in your browser" goal — supported by the WebCrypto API.&lt;/p&gt;
&lt;h2&gt;
  
  
  The tricky part: canonical bytes
&lt;/h2&gt;

&lt;p&gt;Here's the bug that will silently break everything if you're not careful.&lt;br&gt;
To verify a signature, the verifier must hash exactly the same bytes the signer signed. If your backend signs a JSON object and your frontend re-serializes it even slightly differently — different key order, extra whitespace, different number formatting — the bytes differ, and every verification fails, even though nothing was tampered with.&lt;br&gt;
The fix is a canonical serialization both sides agree on. In Python (signing side):&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;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;canonical_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# sort_keys + no whitespace = deterministic output
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;sort_keys&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;separators&lt;/span&gt;&lt;span class="o"&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;,&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;:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;utf-8&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;And the matching thing in JavaScript (verifying side) has to produce byte-for-byte the same output. JSON.stringify with manually sorted keys and no spaces gets you there for simple payloads — but test it against real data, because nested objects and unicode will bite you.&lt;br&gt;
Lesson learned: write a test that signs on the backend and verifies with the exact frontend serializer, using awkward payloads (unicode, nested objects, numbers). That one test caught more bugs than anything else.&lt;/p&gt;
&lt;h2&gt;
  
  
  Signing (backend, Python)
&lt;/h2&gt;

&lt;p&gt;Using the cryptography library (no exotic deps):&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;cryptography.hazmat.primitives.asymmetric.ed25519&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;Ed25519PrivateKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Ed25519PublicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_keypair&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;private_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Ed25519PrivateKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;public_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;public_key&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;public_key&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sign_payload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Ed25519PrivateKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;private_key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;canonical_bytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When Agent A delegates, you build a payload describing the delegation (who, to whom, what capabilities, when), sign it with A's private key, and store the payload + signature + A's public key.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying — in the browser, offline
&lt;/h2&gt;

&lt;p&gt;This is the part that makes it verifiable rather than trust-me. Using WebCrypto in the browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;verifyDelegation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;publicKeyRaw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canonicalPayloadBytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// import the raw 32-byte Ed25519 public key&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;importKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;raw&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;publicKeyRaw&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Ed25519&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;verify&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Ed25519&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;signature&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;canonicalPayloadBytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser fetches the delegation's payload, signature, and the signer's public key, rebuilds the canonical bytes, and verifies — locally. The server never gets a chance to lie, because the proof is checked on the client. If the math checks out, you see a green "verified" badge; if anything was altered by a single byte, it fails.&lt;br&gt;
(Note: browser Ed25519 support via WebCrypto is now widespread, but if you need to support older browsers, keep a graceful fallback that verifies server-side and clearly labels it as such — don't pretend a server-side check is the same guarantee.)&lt;/p&gt;

&lt;h2&gt;
  
  
  The other half: capabilities can only shrink
&lt;/h2&gt;

&lt;p&gt;Verifiable signatures answer "did A really authorize this?". But there's a second rule that matters for agent safety:&lt;br&gt;
An agent can never delegate more authority than it holds.&lt;br&gt;
If A can call read and search, it must not be able to hand B write or delete. So every delegation runs a subset check: the delegated capabilities must be a subset of the delegator's own effective capabilities. If B tries to escalate, the delegation is rejected and an incident is raised. Combine that with the signatures, and you get a chain where every hop is both authorized (subset) and provable (signed).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters more every month
&lt;/h2&gt;

&lt;p&gt;Single-agent systems were easy to reason about. Multi-agent systems — where agents spawn and delegate to other agents — are not. As they spread into companies, "show me the log" stops being good enough. People will start asking "prove it." Verifiable delegation is one way to have an answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it / steal the idea
&lt;/h2&gt;

&lt;p&gt;The full implementation — signing service, capability validator, a live delegation graph where you click any edge and verify the signature in your browser — is open-source (Apache-2.0), self-hosted, and runs with one Docker command:&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/kironovlaziz-del/AI-tower.git" rel="noopener noreferrer"&gt;https://github.com/kironovlaziz-del/AI-tower.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/kironovlaziz-del/AI-tower" rel="noopener noreferrer"&gt;https://github.com/kironovlaziz-del/AI-tower&lt;/a&gt;&lt;br&gt;
I'm a solo developer and this is an early, honest MVP — I'd genuinely love feedback, especially on the canonicalization approach and the capability model. If you're working on agent infrastructure, I'd like to hear how you're thinking about the accountability problem.&lt;br&gt;
Have you hit the "monitoring isn't proof" wall with agents yet? How are you handling it? Let me know in the comments.&lt;/p&gt;

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