---
title: "dvaddi (@dvaddi) | Hashnode"
description: "dvaddi (@dvaddi) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@dvaddi"
---

@dvaddi

# dvaddi

@dvaddi · Joined October 2026

## Comments

[Mike, you're right, and the post didn't cover it. It said the count is only as current as the export, and that the approver may have left the tenant by the time the destroy runs. It said nothing about an account that is disabled but still in the export with its groups. The policy reads no account state, so the policy and the count still treat that user as a holder, and so would a recheck that re-evaluates the same policy. The recheck is a design in the post, not code in the series. The post now says this in two places: under "Approvals go stale" and under "What this check is not". The approval's expiry limits how long a leaver's approval stays usable, but only to whatever the issuer set; nothing caps that lifetime. The count has no time bound at all. Both of your options work, and they trade differently. Dropping disabled users at the export needs no policy change, but it holds only as long as the export keeps doing it, and nothing fails if it stops. An active attribute on User puts the rule in the policy, where it can be tested, at the cost of a schema change. On the diff: if the export drops disabled users, a reactivated account shows as one holder becoming two, which the diff flags today. If it keeps them, the diff sees nothing.](https://hashnode.com/posts/agent-authorization-in-production/6aebd30687a2fa4bdc363b9c/comment/6aedc67819115b2ec5c5e8b7#reply-6af722bdb9e3849d26be321d)

Reply · Article · 4d ago · [Authorizing AI Agent Chains in Production](https://hashnode.com/posts/agent-authorization-in-production/6aebd30687a2fa4bdc363b9c)

[Thanks — you’ve read it exactly as intended, and I should be plain about one thing first: the sidecar, its connection and its certificate are the pattern I recommend, not code the series builds. The published policies take the stamp as given; depth is a context value the tests set, and the forbid caps it at two. So everything below is design, not something I can point at a test for. Queues: a stamp bound to a connection doesn’t survive a store, so I’d do both of the things you name, not one. The enqueuing relay signs the hand-off record (tenant pair, on-behalf-of user, initiator, depth, deadline, task id); the dequeuing relay verifies that signature, increments depth itself, and does a fresh RFC 8693 exchange with the consumer as audience and scope ≤ what the record carries. The queue is one more hop that can become a confused deputy, so it gets no authority of its own. Clock skew: agreed on a small grace window at the verifier. The constraint I’d add is that a child’s deadline may only shrink from its parent’s, and must sit within the exchanged token’s exp — a retry can re-issue a task, never a wider deadline. Leeway at the check, nothing that extends. On 8693: yes, that split. One extra use for the nested chain beyond audit: its length should equal the relay’s depth count. Two independent records of the chain; if they disagree, something forged one. Your comment changed the post. The last section, What this doesn’t solve, now ends with a paragraph on hand-offs through a queue: the signed record, re-stamp at dequeue, the deadline bound and the chain-length check, stated as the natural next step rather than code the series runs. The relay paragraphs now read as the design the policies assume.](https://hashnode.com/posts/agent-authorization-in-production/6aebd30687a2fa4bdc363b9c/comment/6aec0f334392c688c0306815#reply-6aecc6378810490743b2f7ab)

Reply · Article · Nov 5 · [Authorizing AI Agent Chains in Production](https://hashnode.com/posts/agent-authorization-in-production/6aebd30687a2fa4bdc363b9c)

[Done in Part 3: the build now runs a ceiling pass over the grant data, read and write for every agent and tool per tenant with a user who holds exactly the tenant’s grants, and keeps the ALLOW set as a committed snapshot; any difference fails the build and a new write allow lands under a REVIEW header. Your billing edit is the fixture: all 28 cases still pass and the gate rejects it in both tenants. Part 3, “Grants are data, and data needs its own check”.](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499/comment/6ae1db5f02d94ec9076bc2ba#reply-6aebee77f1f626b8759f9add)

Reply · Article · Nov 5 · [Writing Agent Authorization as Code with Cedar](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499)

[You were right, and the check changed: the ceiling reports write only, and the same snapshot carries a per-tenant count of User entities holding each write group (an agent never counts, approved\_by is typed User). A move from fewer than two holders to two or more fails the build like a new write allow, the other way is logged, and Part 3 now says plainly that two holders is the ceiling for destroy, not a permit. It’s in Part 3, “Grants are data, and data needs its own check”.](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499/comment/6ae1db5f02d94ec9076bc2ba#reply-6aebee15508c706ce4245a31)

Reply · Article · Nov 5 · [Writing Agent Authorization as Code with Cedar](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499)

[Done in Part 3: the gateway keeps the list it sent each session and records it again whenever it answers tools/list anew, and every decision event carries advertised, true or false, as its own field apart from the policy IDs, so advertised: false gets its own alert line. The crate’s test a\_tool\_dropped\_on\_list\_changed\_is\_no\_longer\_advertised covers the re-record. The write-up is in Part 3, under “What bites in production”.](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae1feda059ede82adc2a357#reply-6aebedbc18d5d4efb9c52abe)

Reply · Article · Nov 5 · [Who Is the Agent Acting As? Why AI Agents Become Confused Deputies](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f)

[You’re right, and it’s a gap in my refinement, not just the post. The destroy forbid needs a different user, same tenant, holding the same write grant, so destroy reachability is a property of the user table, not of agent ∩ tenant. A synthetic approval assumes that second user exists; for a one-holder tenant that’s wrong, and the day an admin adds a second holder, destroy opens with no agent or tenant edit. Taking your count. Per tenant and write group: the number of users who hold it. One to two is flagged like a new ALLOW on destroy; two to one is logged, since it quietly breaks destroy for that tenant. The ceiling run then drops destroy altogether — it reports write, and the holder count decides destroy. Two checks that compose, instead of one pretending to cover both. The approver being a User entity with a signed, nonce-burned approval already rules out an agent standing in as the second person, so the count is of people, which is what the rule means. Will update the section notes.](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499/comment/6ae1db5f02d94ec9076bc2ba#reply-6ae78d996498e0a9ae73fcff)

Reply · Article · Nov 1 · [Writing Agent Authorization as Code with Cedar](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499)

[Glad the Alice/Globex example landed that was the hardest part to make concrete. The “boundary, not a suggestion” framing is the whole point: anything the model can read, it can be talked out of, so the only sets that count are the ones enforced in code it never sees. Part 2 takes the intersection and puts tests and a mutation run behind it, so each guard has to prove it earns its keep.](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae46b2a53d48cf489d8497d#reply-6ae788bad081b95454f05bb0)

Reply · Article · Nov 1 · [Who Is the Agent Acting As? Why AI Agents Become Confused Deputies](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f)

[Agreed, and this is the real gap in Part 2. The suite proves the policies over the entities in tests.json; mutation testing proves each policy earns its keep. Neither says anything about the grants production actually loads. And because Agent carries no tenant, adding billing to support-assistant’s write\_groups is one edit with a blast radius of every tenant whose users and tenant already hold billing. Your diff is the right shape. Three refinements from trying it: You don’t have to enumerate users. Effective permission is agent ∩ user ∩ tenant, so the ceiling across all users of a tenant is agent ∩ tenant. Enumerate (agent, tenant, tool, action) with a synthetic user holding exactly the tenant’s groups. User-grant changes get their own, per-tenant diff. Set delegated\_read\_groups / delegated\_write\_groups to the full set so the run computes the ceiling rather than one task type’s scope. destroy is never allowed without an approval, so either supply a synthetic valid approval (same tenant, holds the grant, fresh, matching hash) or diff on write and treat destroy as write plus approval. Then: stage the new entity store, compute the ALLOW set, diff against the promoted one, and any new ALLOW on write/destroy blocks promotion until reviewed. It’s the data equivalent of the policy mutation test. Cedar’s symbolic analyser compares policies, not entity data, so this is a loop over cedar authorize (or the library Authorizer), not a solver job. The underlying choice is whether Agent should stay tenant-global. A per-tenant enablement attribute would shrink the blast radius, at the cost of one more thing each tenant administers. Either way the grant diff is worth having.](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499/comment/6ae1db5f02d94ec9076bc2ba#reply-6ae207aa77d5cbaa0c48b859)

Reply · Article · Oct 28 · [Writing Agent Authorization as Code with Cedar](https://hashnode.com/posts/agent-authorization-policy-as-code/6ae167e8986e1037a6b00499)

[Not today, and you’re right that it should be its own line. The event we emit carries the decision and the determining policy IDs; whether the tool was on the menu we sent that session isn’t a field. Cedar can’t supply it either: it sees entities, not what the client was shown. The fix is gateway-side. When it answers tools/list for an on-behalf-of token it records the filtered set (and bumps a version on list\_changed). At call time it compares the tool name against that set and adds advertised: false to the event. That becomes an alert distinct from any forbid ID. It also catches something the named-forbid alert misses. In the Bob replay in Part 2 (same tenant, no write grant) the deny comes back with “no policies applied”, so there’s no ID to alert on. An unadvertised-tool flag still fires there. The one caveat: a name the agent was never shown can also come from a stale name or a hallucination, so it’s a strong injection signal, not proof. Thanks, this goes into the production write-up.](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae1feda059ede82adc2a357#reply-6ae2078e77d5cbaa0c48b7d0)

Reply · Article · Oct 28 · [Who Is the Agent Acting As? Why AI Agents Become Confused Deputies](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f)

[Thanks — Part 2 is largely about this. The gateway doesn’t tag content; it makes content irrelevant to scope. Every call carries the scope this hop holds (delegated\_read\_groups / delegated\_write\_groups in the context), the depth-0 scope is minted from the entrypoint or task type — a summarize request mints read-only — never from anything the model read, and a request-scope forbid runs on every call. So a poisoned ticket can’t widen scope on a later call; the “close every Acme ticket” variant is denied by that forbid even though no tenant line is crossed. Part 3 narrows the scope per hop as agents hand off. What’s left is the honest limit: the gateway bounds authority, not influence. Injected text can still steer the model toward a call that’s already in scope — read a different ticket Alice may read — so marking retrieved content untrusted at the model layer is complementary, and I’d run both. On logging: agreed. Cedar returns the determining policy IDs with every decision; the post’s replays show tenant-isolation and request-scope by name, and a deny with a named forbid is exactly the line to alert on. Default denies have no name, which is why anything you care about is a forbid.](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f/comment/6ae167c97260aaff727fb200#reply-6ae1697d4ace2d609e0d67e8)

Reply · Article · Oct 28 · [Who Is the Agent Acting As? Why AI Agents Become Confused Deputies](https://hashnode.com/posts/agent-authorization-confused-deputy/6ae166870363e25effa5e84f)
