Securing agentic AI: a threat model and reference architecture
Autonomous agents plan, call tools, and act on their own. That autonomy is exactly what expands the attack surface. Here is a practical threat model and a reference architecture for deploying agents safely.
- Agentic AI
- Agent Security
- Threat Modeling
- SecureAIX
A traditional application does what its code says. An agent decides what to do next. It reads a goal, plans steps, calls tools and APIs, observes the result, and repeats — often with access to data, systems, and money. That decision loop is enormously useful, and it is also the reason agents cannot be secured like ordinary software.
This article lays out a threat model for agentic systems and a reference architecture that keeps the useful autonomy while containing the blast radius.
Why agents change the threat model
Classic AppSec assumes a fixed set of code paths an attacker tries to subvert. An agent generates its own path at runtime from untrusted input. Three properties make this hard:
- Instructions and data share a channel. A retrieved document, a tool result, or a web page can carry text the model treats as a new instruction.
- Actions are real. Tool calls send email, move files, run queries, and spend budget. A bad decision is not a log line — it is an effect.
- State compounds. Memory, scratchpads, and multi-step plans mean a single poisoned input can steer many later steps.
An agent is a confused-deputy machine: it holds real privileges and takes instructions from whatever text enters its context. Untrusted content plus real capability is the entire problem.
The agentic attack surface
It helps to enumerate where things go wrong rather than argue about a single "AI vulnerability."
Where agents get attacked
Prompt & context injection
Direct or indirect instructions that override the agent's goal, exfiltrate context, or trigger tools.
Tool & API abuse
Over-broad tool scopes let a hijacked agent read or mutate systems far beyond its task.
Memory & data poisoning
Malicious content written to long-term memory or a knowledge base influences future runs.
Excessive agency
Autonomy without approval gates turns a reasoning error into an irreversible action.
A reference architecture
The pattern that holds up in production is a mediated agent: the model never touches privileged systems directly. Everything routes through a controlled layer that authenticates, authorizes, validates, and logs.
Layers of a governed agent
The key inversion: capability lives in the tool broker, not the model. The agent can only request an action; the broker decides whether that request is allowed, with what credentials, and whether a human must approve it.
Controls that attach to the loop
Map defenses to the agent's actual lifecycle so nothing is left implicit.
Controls across the agent loop
- Ingest
Sanitize & tag untrusted content
- Plan
Constrain goals; deny risky intents
- Act
Broker validates & scopes tool calls
- Observe
Filter tool output before re-entry
- Log
Immutable trace for audit & replay
Practical rules that follow from this:
- Treat every tool result as untrusted input on its way back into context — the same way you treat the initial prompt.
- Scope credentials per task, not per agent. A support agent resolving one ticket should not hold standing write access to the whole datastore.
- Gate irreversible or high-value actions (payments, deletes, external sends) behind explicit approval or a policy check.
- Bound autonomy with step limits, budgets, and timeouts so a runaway loop fails closed.
Governance and evaluation
Controls are only credible if you can prove they work. Evaluate agents against safety and security criteria before launch, monitor them in production for anomalies and drift, and keep an audit trail mapped to the frameworks you answer to — the NIST AI RMF and the OWASP LLM Top 10 give you a shared, defensible vocabulary.
Key takeaways
- Agents combine real privileges with untrusted instructions — that combination, not any single bug, is the risk.
- Put capability in a tool broker, not the model; the agent only requests actions.
- Attach controls to every stage of the loop, and treat tool output as untrusted on re-entry.
- Scope credentials per task, gate irreversible actions, and bound autonomy so failures fail closed.
- Back it with evaluation, runtime monitoring, and audit evidence mapped to NIST AI RMF and the OWASP LLM Top 10.
Autonomy is worth having. The job is to keep the reasoning free while making the actions accountable.
References
Keep reading
Defending against prompt injection in production LLM applications
Prompt injection is the top risk in the OWASP LLM Top 10 for a reason: there is no single patch. This is a defense-in-depth playbook for direct and indirect injection in real applications.
AI red teaming: stress-testing LLMs and agents before attackers do
Red teaming AI is not one clever jailbreak — it is a repeatable discipline. Here is a methodology, a taxonomy of tests, and how to operationalize it as a continuous control.
Building an enterprise AI governance operating model
Governance fails when it is a document nobody reads. This is an operating model that turns AI policy into controls, evidence, and decisions people actually make — mapped to NIST AI RMF and ISO/IEC 42001.
See Vaultryx AI on your environment.
Book a walkthrough across infrastructure, applications, and AI.