# Section 11 · Execution security Guiding principle: security plays out on actions, not on display. Reads can stay open; it is mutations and side effects that are guarded. ## Three-level access control | Level | Mechanism | Effect | | --- | --- | --- | | Tool | Registry filtering by role, before anything is sent to the model. | The model does not know about a tool it is not allowed to call. | | Data | A guard that checks ownership or scope before a mutation. | An actor modifies only what concerns it. | | Query | Free reads, writes blocked for generic access (for example read-only queries). | Broad analysis possible, mutation impossible through this channel. | ## Agent identity Before filtering what an agent may do, you must know who is acting. Each agent is an identified principal, distinct from the user on whose behalf it operates. It carries its own identity, at least privilege; when it acts for a user, the delegation is explicit, bounded in time and scope, never borrowing the user's full rights. The audit thus always distinguishes two things: who acted, the agent, and for whom, the user. A registry corollary: an agent acting while unknown to the registry is a security anomaly, to be treated as such. Where this identity lives, existing access management or a dedicated building block, is an infrastructure decision made on top; the principle itself does not vary. ## Human approval anchored in the tool's contract High-impact tools declare in their contract that they require approval. Before execution, the infrastructure triggers an approval request: accept, refuse, or edit the arguments. If refused, the execution never takes place. The guard does not depend on the model's discipline; it is carried by the infrastructure, and therefore guaranteed. But an approval must not freeze a living process. If the human is not there, the agent does not stay suspended in memory monopolizing resources until the timeout. It moves into an explicit "suspended" state: its trajectory is serialized into durable state, a projection of working memory; the process frees itself; and the system rehydrates the agent when the decision arrives, minutes or hours later, exactly where it left off. This is checkpoint-based resumption (section 07) applied to waiting on a human: a suspension, not a block. Low-urgency requests are grouped and prioritized in a queue, presented in summary form, so as not to drown the human or push them to rubber-stamp. That summary is itself an attack surface: it must be deterministic and faithful to the tool's real arguments, never a rephrasing by the model, otherwise an injected action slips into the batch and the injection reenters at the control point. Fail-closed remains intact, without paying the price of a frozen agent. ## Diagram, the suspension cycle > Diagram : Sensitive action · approval request · SUSPENDED STATE · state serialized · resources freed · Human decision · prioritized queue, batched · Exact resumption · Suspend, do not block: fail-closed without ever freezing the agent. ## Dependency isolation and exposed surface - Isolated sidecars: a specialized capability runs in its own process, with restricted access and a circuit breaker on failure. - Ephemeral execution: a risky execution, generated code or processing of untrusted content, runs in a disposable environment, provisioned per task and destroyed after use. What is destroyed cannot be durably compromised: the ephemeral bounds in time what a compromise can reach. - Guarded exposed tool surface: the tool server the system publishes is protected by key and rate limit, and is opened beyond local only in a controlled manner. - Secrets and sensitive data: isolated behind typed configuration, never in the domain. And one step further for runtime secrets: the secret never crosses the model boundary or that of the execution environment. The agent handles only a placeholder; the real key is attached by the infrastructure at the network boundary, toward the only explicitly allowed destinations, and is replaced without redeployment. A secret the model has never seen cannot be disclosed: this guard is structural, not behavioral, and it takes away injection's most coveted prize. ## Untrusted inputs and prompt injection The first-rank threat to an agentic system is prompt injection: hostile instructions slipped into the input. Its direct form comes from the user; its indirect form, more pernicious, hides in retrieved content (page, document, memory) and triggers when the model ingests it. It is therefore intrinsic to any memory or retrieval (§06). The worst case arises from a trifecta: access to private data, ingestion of untrusted content, and a means of communicating with the outside, gathered on a single unguarded path; removing any one of the three defuses it. Hence an operational rule, whose window is that of the context: for as long as untrusted content is present in the context, allow only two of these three properties at a time; if all three are genuinely necessary, the action does not execute autonomously, it goes under human supervision. The window is neither the turn, too narrow since ingested content persists beyond it, nor the entire session, too broad: it opens at ingestion and closes only when the content is purged from the context. The defense is not detection, unreliable against indirect injection, but architecture: the model is not a trust perimeter, and once untrusted content is ingested, the range of actions narrows. The baseline, non-negotiable as soon as external content is ingested: - Untrusted content separated from instructions: retrieved material is treated as data, never as an order. - Least privilege for tools: the model sees only what it is allowed to call (cf. access control above). - Human approval on consequential actions and external communication. - Validation of outputs from tools and from the model before they act. - Immutable journal (§07): any action stemming from an injection remains traceable and reversible. For high-privilege deployments, the agent is constrained further by dedicated patterns, proportionate to the risk: allow only a choice among pre-approved actions (action-selector), freeze the plan before exposing the model to tool outputs (plan-then-execute), isolate the processing of untrusted content, purge it from the context after use, or even separate a privileged model that plans from a "quarantined" model that only reads the untrusted (dual LLM). No model being immune, security remains a property of the architecture, whose depth adjusts to the risk. ## Compliance by construction The combination of access control, separation of untrusted content, human approval, complete traceability, and sovereign data handling equips the documentation, human-oversight, and transparency requirements expected in regulated environments: it contributes to them without substituting for them. The right to erasure is upheld without breaking the audit, by rendering a piece of data unreadable rather than breaking the immutable chain (§08). Security is not an added layer; it is distributed across the system's boundaries. **Key takeaways** - Security bears on actions, not display: open reads, guarded mutations. - Three-level access control: tool, data, query. - The agent is an identified principal, distinct from the user it serves: explicit, bounded delegation, never borrowing the user's full rights; the audit distinguishes who acted and for whom. - Human approval is anchored in the tool's contract, guaranteed by the infrastructure. - An approval suspends the agent (durable state) and rehydrates it at the decision, rather than blocking the process; low-urgency requests grouped in a prioritized queue. - Isolated sidecars, guarded exposed surface, sovereign data; the runtime secret never crosses the model or environment boundary: placeholder on the agent side, the real key attached at the network boundary. - Prompt injection = first-rank threat, intrinsic to memory: do not detect, constrain through architecture (least privilege, approval, separation of the untrusted, lethal trifecta broken over the window of the context). --- © Thibault Souris, 2026 · Creative Commons BY-ND 4.0 (https://creativecommons.org/licenses/by-nd/4.0/) · the work’s text unaltered, as plain text for this page; the PDF version is the reference: https://runward.dev/docs/en/reference/doctrine/Designing-and-Running-Agentic-Systems-2026.pdf