Three trust levels, on every diagram

trusted
Code and data the operator controls.
semi-trusted
The model: it follows instructions from anywhere it reads them, so its output is checked.
untrusted
Content from outside: web pages, tool results, user files, other agents. Treated as data, never as instructions.

Turn on Trust boundaries in any pattern's stage to see the zones drawn on the diagram.

A request enters a lead model ring. Above it sits the plan it wrote. Three worker rings run in parallel to the right, each with a slice of the task; one reads the public web and is marked untrusted. Their results join at a merge dot, return to the lead, and the answer leaves on the right. A per-worker budget sits beneath the lead.writesreviewbriefbriefbriefresultresultresultsynthesiseanswerthin · failedRequestPlanOrchestratorBudgetsWorker: public webWorker: internal docsWorker: codebaseResults joinAnswerResearcher

The principle with the most leverage

Remove a capability rather than trust a prompt. Simon Willison's lethal trifecta (2025-06-16) names the combination to avoid in one agent: access to private data, exposure to untrusted content, and a way to communicate externally. Take any one away and prompt injection can no longer exfiltrate. The orchestrator–worker pattern removes the third leg by design; its "A web page instructs the worker" scenario shows why it matters.

Prompt injection and untrusted content

A model follows instructions from anywhere it reads them: files, pages, tickets, tool results, other agents.

ControlHow it worksPattern · nodes
Tool results are data The runtime never promotes tool output to the instruction role; the system prompt names the developer as the only source of instructions. Single-agent tool loopread · tests · context
Structured results with provenance Results are validated against a schema; findings without a source are dropped and flagged. Orchestrator and workersmerge

Data exfiltration

An agent that can read private data and send messages can be talked into sending the data out.

ControlHow it worksPattern · nodes
No external send This loop has no tool that communicates outside the machine; one leg of the lethal trifecta is absent by design. Single-agent tool loopagent
Workers are sandboxed by capability Each worker type has a fixed tool set; the web worker can read but not write, send or reach internal systems. Orchestrator and workersw1 · w2 · w3
No external communication in the orchestrator The orchestrator’s only outputs are the plan and the answer, delivered to the researcher. Orchestrator and workerslead · answer

Excessive agency and destructive actions

An agent with broad tools does what a compromised decision tells it to.

ControlHow it worksPattern · nodes
Allowlisted commands and gated edits The shell tool runs only allowlisted commands; edits outside the project directory are refused; in cautious mode edits wait for approval. Single-agent tool looptests · edit · developer
Human approval as a node The reviewer node is on the high-risk path; the run cannot reach implement without state.decision = approve. Stateful graph with branching and human approvalreviewer

Runaway cost and unbounded loops

A loop that never decides to stop, or a worker that spends the whole budget.

ControlHow it worksPattern · nodes
Budget outside the model Steps, tokens and seconds are counted in operator code and stop the loop. Single-agent tool loopbudget
Per-worker budgets Token and time limits per worker and in total, enforced outside the models. Orchestrator and workersbudget
Bounded retries The fail edge’s condition closes at the limit and the failure edge escalates. Stateful graph with branching and human approvalverify

Corrupted state and repeated side effects

A node writes nonsense another acts on; a resumed run does the same thing twice.

ControlHow it worksPattern · nodes
Idempotent side effects Ship checks the run id before creating a PR; every side-effecting node is keyed by run id. Stateful graph with branching and human approvalship
Typed state State has a schema with reducers; writes are validated at the boundary. Stateful graph with branching and human approvalstate

Other controls

Watch an attack and a control

Governance frameworks

  • NIST AI Risk Management Framework (AI RMF 1.0) (NIST, 2023-01-26). The SDLC explorer's security stage follows its Govern, Map, Measure and Manage functions. It is a voluntary framework, not a certification.
  • OWASP Top 10 for Agentic Applications for 2026 (OWASP GenAI Security Project). Not yet verified here: the site refuses automated fetches, so the ten risks have not been read into this library. No pattern cites it as evidence until an editor confirms it. This is tracked as an open item in the delivery report.