Solution Architecture22 January 20277 min read

From Copilots to Always-On Operations — Part 5 of 7

Event-driven agents need permission boundaries

An agent that wakes on events will receive the same event twice, its own events back, and events written by strangers. Part 5 of From Copilots to Always-On Operations models the path from trigger to action, gives an allow, ask and block matrix per action class, and shows where idempotency keys stop a repeated event from repeating its effect.

#AI Agents#Agentic AI#AI Governance#AI Architecture#Zero Trust Security

Rietspruit Digital, our fictional Gqeberha product studio, connected its event-driven agent to two new triggers. When a client's invoice was marked paid, the agent moved the project to "in progress" on the team board, sent the client a thank-you with next steps and booked a kick-off meeting. When a card on the board changed, the agent checked whether the client needed an update.

After a short outage at the payment provider, the provider redelivered the day's notifications. One client received three thank-you emails and three kick-off invitations. Each board move by the agent was itself a board change, so the agent also reviewed its own updates and posted two status notes nobody needed. Nothing dangerous happened. Everything that happened was avoidable.

An event-driven agent needs its permission boundary drawn before the first event arrives: every action class marked allow, ask or block, every external effect protected by an idempotency key, and no event able to change what the agent may do.

From event to effect

Part 2 showed that the authority for event-driven work belongs to whoever wrote the admission rule, not whoever sent the event. This part follows the event all the way to its effect.

Event-driven agent pipeline with permission boundariesFROM EVENT TO EFFECTTriggerdedupe by event ID;drop own eventsRouteraccept, attach orignore, with reasonTicketmandate, scope,budget, ownerWorkerbounded tools,own workspaceEvidencediff, tests, sources,tool resultsApprovalonly for ask-classactions; named personActionidempotency key;result recordedTHENevidence first,then any approval,then the effectAllow: act, then logAsk: wait for a personBlock: never, even if asked
Every event passes the same seven steps. Allow, ask and block are decided per action class before the event arrives, and the action step carries an idempotency key so a repeated event cannot repeat the effect.
StepJobControl that belongs here
TriggerReceive the event and store it onceVerify the sender's signature; deduplicate by event ID; drop events the agent itself caused
RouterDecide: accept as new work, attach to existing work, or ignoreAdmission rules; a recorded reason for every decision
TicketTurn accepted work into a bounded taskMandate in one line, scope, budget, owner
WorkerDo the work in its own session and workspaceOnly the tools the mandate needs, under the agent's own identity
EvidenceShow what was done and whyDiffs, test results, sources and tool results, kept with the ticket (part 6)
ApprovalGet a decision for ask-class actionsA named person who sees the evidence, not only the request
ActionMake the change in the worldIdempotency key; result recorded against the ticket

The order matters. Evidence comes before approval, so the approver decides on what was done rather than on what was promised. Approval comes before the effect, so an ask-class action cannot happen first and be explained later.

Allow, ask, block, per action class

The decision tool for this part is a permission matrix. Classify every action the agent can take, not every tool it has, because one tool can carry very different risks. The same email connector can send an internal note or a price to a client.

Action classClassWhyWho approves an "ask"
Read repository, board and CRM records in scopeAllowNeeded for every task; no effectNot applicable
Open a pull request or draft a replyAllowReversible; a person merges or sendsNot applicable
Add a note to a CRM deal or board cardAllowLow impact; recordedNot applicable
Send an email or invitation to a clientAskExternal and not reversibleAccount lead
Merge to the main branchAskChanges what is deployedTech lead
Change a price, invoice or payment termBlockCommercial decisionNot applicable
Delete records, branches or filesBlockNot reversibleNot applicable
Change its own permissions, rules or scheduleBlockAuthority must not expand itselfNot applicable

Two design rules make the matrix hold.

Block must win. If a broad allow rule and a narrow block rule both match, the block rule should decide. Claude Code's permission system is a useful reference: rules are evaluated deny, then ask, then allow, and an allow rule cannot carve an exception out of a deny rule (checked 23 November 2026). Whatever product you use, test that your "never" rules survive a generous "allow".

Ask must be real. A person who approves twenty kick-off invitations a day without reading them is not a control. Keep the ask class small, and show the approver the evidence. Human-in-the-loop is not a button and the authority ladder from read to write cover how an action class earns its way from ask to allow.

The same event will arrive twice

Event delivery is rarely exactly once. Some providers retry failed deliveries automatically; others leave redelivery to the receiver. GitHub's webhook guidance asks receivers to respond within 10 seconds, after which the delivery counts as failed, and to redeliver missed webhooks once the server is back up. GitHub does not redeliver failed deliveries automatically, and redelivery is available for the past three days. The guidance recommends the X-GitHub-Delivery header to make sure each delivery is unique per event, and notes that a redelivery carries the same delivery ID as the original. Rietspruit's payment notifications behaved the same way.

Two controls stop a repeated event from repeating its effect:

  1. Deduplicate at the trigger. Store each event ID once. A second delivery with the same ID is recorded and dropped. This is cheap and catches most repeats.
  2. Make every external action idempotent. Give each action a key derived from the ticket and the action, for example "ticket 112, send kick-off invitation". Before acting, check whether that key has already succeeded. Where the target system supports it, pass the key along. Stripe's idempotent requests are a well-documented example: a retried request with the same key does not perform the operation twice. Stripe's documentation also notes that, for its v1 API, keys can be pruned once they are at least 24 hours old, so your own record of completed actions is still needed for anything that can be retried later.

The second control matters because deduplication only sees events. If the agent itself retries after a timeout, or a worker restarts halfway through, only the action key prevents the second email. Who owns the retry? explains how retries multiply across layers.

Loops: the agent's own events

An agent that listens to a system it also changes will hear itself. Rietspruit's board loop was harmless. A loop between two agents, each responding to the other's comments, can run up cost and noise quickly.

Anthropic's GitHub Actions integration shows one sensible default: it rejects events from bot actors unless they are explicitly listed, which its documentation says keeps bots from triggering Claude in a loop (checked 23 November 2026). Apply the same idea everywhere:

  • Give the agent its own identity, and drop events authored by that identity at the trigger.
  • Do not accept work from another agent unless an admission rule names it.
  • Cap tickets per thread per hour, and alert when the cap is hit.

Events carry text, not authority

An issue comment, an email or a chat message can contain instructions. To the agent, those are words in its context. OWASP's Top 10 for LLM applications (2025) ranks prompt injection first, including indirect injection from external content. The permission matrix is the defence that does not depend on the model noticing. If "change the invoice" is a blocked action, a cleverly worded comment cannot make it happen, however convincing it is. The tool gateway is a control point, not a trust boundary, so the block must be enforced where the action is executed, not only described in the prompt.

The agent's own identity

In the public video that compared personal and event-driven agents, the presenter's set-up gave the agent its own GitHub account with write access to the repository. That is better than running the agent on a person's token, because every action is attributable and the access can be revoked on its own. Go further: give that identity only the scopes its allow and ask classes need, and keep the block classes impossible at the credential level where the target system allows it.

What this means for South Africa

Many South African firms are wiring agents to payment providers, banking notifications, WhatsApp Business messages and municipal or customer service portals. These systems redeliver, retry and sometimes reorder events, and an effect such as a payment instruction, a customer message or a service request is hard to reverse. Where the agent's actions touch personal information or regulated activity, the permission matrix is also part of how you show reasonable security safeguards. This is general information, not legal advice.

Before you switch on the first event trigger

  1. Write the admission rules and the trigger record (part 2).
  2. Classify every action as allow, ask or block, and test that block wins.
  3. Deduplicate events by ID at the trigger.
  4. Put an idempotency key on every external action and record completed keys.
  5. Give the agent its own least-privilege identity, and drop its own events.
  6. Cap tickets per thread and per hour, with an alert.
  7. Run in observe mode first: let the router decide and record, but not act, for two weeks.

Next in the series, on 27 January: Why an agent must produce evidence, not just output. Previous: Part 4, Memory is not a database dump. All parts are on the series page.

Sources and limits: this article draws on a public video discussion comparing personal agents and event-driven agents; its points are paraphrased, not quoted, and were checked on 23 November 2026 against a timestamped transcript and the published video's description and chapter markers. Product and platform behaviour comes from official documentation checked on 23 November 2026 and may change. Rietspruit Digital is fictional.

How CloudNala can help

CloudNala designs the permission boundary for event-driven agents. We map every trigger source and action class, write the allow, ask and block matrix with your owners, add deduplication and idempotency keys to the actions that matter, set up the agent's own identity, and run the agent in observe mode until its decisions have earned the right to act.


Work with CloudNala

CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.

Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.

Book an Always-On Agent Design Session or write to us at consult@cloudnala.co.za

Found this useful?

Share