Introduction
Over the past two years, enterprise AI has undergone a structural shift. What began as chatbots answering questions has evolved into agentic systems--LLM-driven software that plans multi-step tasks, calls tools and APIs, retains memory, and executes actions with real consequences: moving money, modifying infrastructure, sending emails, and querying databases [1]. This autonomy delivers enormous productivity gains, but it fundamentally rewrites the security equation. The dominant risks are no longer just what a model says, but what it does--and who can steer it [2].
The core problem is architectural. Agentic AI systems expand the attack surface far beyond a single prompt because they combine three dangerous properties: persistent authority (agents hold API keys, OAuth tokens, and database credentials that an injection can convert into an exfiltration or action channel), untrusted context windows (agents ingest web pages, PDFs, emails, and tool outputs that can carry attacker-controlled instructions), and compounding errors (each step conditions the next, so a small misinterpretation early in a plan can become a destructive action ten steps later) [1]. Because these systems use natural language as their control plane, malicious instructions hidden in any data source the agent consumes can be interpreted and executed [3].
This article maps the modern agentic attack surface in detail. It examines the primary attack vectors--direct and indirect prompt injection, privilege escalation, confused deputy attacks, and tool hijacking--explores why multi-agent systems create cascading failure paths, and surveys the defensive architecture that researchers and practitioners recommend: identity-first design, untrusted-content handling, sandboxed execution, human-in-the-loop gates, and a new generation of information-flow control research.
What Is a Prompt Injection Attack? [Examples & Prevention] - Palo Alto Networks
From Chatbot Threats to Agentic Attack Surfaces
Why Agents Are Different
Security researchers increasingly frame agentic AI not as a chatbot with extra features, but as a distinct class of system with its own attack anatomy. A recent systematization of knowledge (SoK) on agentic AI security argues that tools and autonomy introduce new vectors--indirect prompt injection, code execution exploits, RAG index poisoning, and cross-agent manipulation--that go beyond traditional AI threats [2]. Palo Alto Networks breaks the AI agent attack surface into distinct zones: the agent's instructions, reasoning, and planning; the retrieved data and tool output it consumes; the tools and APIs it can invoke; the identity and credentials it holds; and its stored state and deployment environment [4].
Crucially, risk is not uniform across deployments. Exposure rises when agents process untrusted content, wield powerful tools, retain persistent state, connect to numerous systems, or operate without monitoring and approval controls. A narrowly scoped agent with limited tools and strong controls may have substantially less exposure than an agent with broad enterprise access [4]. This variability is why practitioners increasingly insist that agentic risk assessment must be per-deployment, not per-technology.
The Action Layer Problem
Perhaps the sharpest distinction between classic and agentic threats is what researchers call prompt injection "at the action layer." Against a chatbot, a successful injection produces harmful text. Against an agent with endpoint, database, or financial tool access, the same injection produces harmful actions--and the attacker never needs to interact with the agent directly [3]. In agentic systems, the action log matters more than the chat transcript: untrusted content retrieved by the agent can silently redirect its tool calls [5].
Core Attack Vectors
Direct and Indirect Prompt Injection
Prompt injection comes in two flavors. Direct prompt injection targets the LLM through crafted user inputs--jailbreaks that override system or developer instructions and induce policy-violating behavior [2]. It is the more familiar threat and the easier one to partially mitigate through instruction hierarchies and input inspection [4].
Indirect prompt injection (IPI) is far more insidious. Here, the attacker embeds malicious instructions inside external content the agent parses--an incoming customer support email, a PDF resume, a scraped webpage, or an invoice [6]. Because agents fuse retrieved content with their operational context, embedded instructions can override the agent's core system prompt when content and role contexts are not cleanly separated [2]. The preconditions are minimal--attackers need only the ability to supply input or host content somewhere the agent will read--and real-world attacks have compromised agents end-to-end [2]. One illustrative scenario: a hidden prompt inside an invoice PDF instructs an accounting agent to ignore previous instructions, read secret API keys from environment variables, and exfiltrate them via HTTP GET to an attacker-controlled domain [6].
Defensive measures such as sanitization, role separation, and strict delimitation help, but the research consensus is sobering: they are not yet reliable [2]. Input validation reduces exposure, but prompt injection remains an open problem in LLM security [7].
Privilege Escalation and the Confused Deputy
Prompt injection becomes catastrophic when it meets excessive permissions. Agents are often granted broad credentials--a single service account with read/write access across multiple systems--because per-task scoping is operationally harder. This convenience converts every successful prompt injection into a privilege escalation [1]. The SoK formalizes this as goal G3: leveraging the agent's privileges to perform actions the attacker lacks directly, such as escalating from text input to host code execution, or misusing scoped keys to invoke admin-only APIs [2].
A particularly dangerous pattern is the confused deputy attack, in which an agent faithfully executes instructions that originated from an attacker rather than its principal. Researchers describe a four-stage progression: injection, tool misuse, credential abuse, and finally authority re-delegation--where the compromised agent or its artifacts inject into subsequent systems. A malicious package installed by a compromised coding agent, for example, may contain further prompt injections targeting other agents performing code review or automated testing in the same environment [8]. The stakes escalate dramatically when agent credentials reach the operating system: research on post-training local LLM agents shows they can learn to identify and exploit Linux privilege escalation opportunities using techniques similar to human penetration testers--meaning a confused deputy holding administrative access could theoretically cascade into system-level compromise faster than manual detection can respond [8].
Tool Hijacking and Excessive Agency
Agent tool-calling mechanisms allow LLMs to invoke predefined function signatures--execute_sql_query, send_email, delete_user_account. If an agent is compromised via prompt injection, an attacker can manipulate function parameter arguments to execute arbitrary SQL commands or exfiltrate entire databases [6]. Palo Alto Networks categorizes this as tool misuse, with controls including tool allowlists, parameter validation, and scoped permissions [4].
The deeper issue is what some call excessive agency: agents routinely move sensitive records between systems that previously had no integration path at all, creating data flows that no one designed or governed [5]. OWASP flags unbounded consumption--prompt loops, pathological long outputs, excessive retrieval that exhausts quotas and runs up bills ("Denial of Cash")--as a top LLM risk [2], and the taxonomy extends to fraud, where agents can be weaponized to initiate unauthorized transactions or generate high-quality phishing content causing downstream monetary loss [2].
Memory Poisoning and Data Egress
Agents accumulate context, and that accumulated context becomes a target in its own right. Memory poisoning--injecting malicious content into an agent's persistent memory or RAG index--allows an attack to persist across sessions and users [3]. Combined with the risk of silent data egress, where agents exfiltrate sensitive context to external recipients without triggering alerts [1], and sensitive context exposure as conversations and retrieved documents accumulate [7], the integrity of agent memory and retrieval pipelines becomes a first-class security concern rather than an implementation detail.
The Multi-Agent Problem: Cascading Failure
Multi-agent architectures, where orchestrator agents delegate to specialized sub-agents, introduce a trust topology that attackers actively exploit. Security researchers have documented cross-agent manipulation as a distinct vector, in which a compromise of one agent propagates through the collective [2]. The privilege dynamics are particularly dangerous: in systems where high-privilege master agents orchestrate low-privilege sub-agents, an injected customer service sub-agent can pass crafted context objects to the master agent, tricking it into executing administrative commands [6].
This is authority re-delegation at scale--and it is especially consequential because a single injection can compound across multiple credential sets without triggering human review at each step [8]. Recent research on Model Context Protocol (MCP) security has documented analogous propagation paths through shared tool ecosystems [8]. Governance frameworks now cite cascading failures across multi-agent chains as one of the four dominant risks of agentic AI, alongside indirect prompt injection, unbounded tool access, and silent data egress [1]. The lesson: in multi-agent systems, trust boundaries between agents must be explicit, authenticated, and enforced--not assumed.
AI Agent Security and Prompt Injection | Unico Connect
Measuring the Risk: Attacker Models, Goals, and Metrics
Securing agentic systems requires a common vocabulary for what attackers want. The SoK literature proposes a goal taxonomy spanning G1 (data leakage), G2/G3 (policy subversion and unauthorized action or privilege escalation), G4 (resource abuse and denial of wallet), and G5 (fraud and financial harm), paired with formal attacker models and threat scenarios [2]. It also proposes quantitative posture metrics--such as Unsafe Action Rate, measuring how often an agent takes policy-violating actions under adversarial pressure, and Privilege Escalation Distance, measuring how far an attacker can climb from initial access toward high-privilege capabilities [2].
These metrics matter because regulators and auditors increasingly expect an explainable record of automated decisions and the identity that executed them [5]. They also matter operationally: without correlation between agent activity and the rest of the enterprise estate, an analyst cannot distinguish an agent malfunction from an account compromise [5]. Measurement, in other words, is the bridge between security research and incident response.
Building the Defense: A Layered Security Architecture
No single control defeats prompt injection. The emerging consensus is defense-in-depth: layered controls spanning identity, content handling, execution, policy enforcement, and monitoring [6].
Identity First: Least Privilege and Short-Lived Credentials
The identity layer is the highest-leverage control, because restricting an agent's privileges directly minimizes the blast radius of any injection [9]. Concrete practices include:
- Dedicated agent identities with short-lived credentials: never grant long-lived master database credentials to tool-calling agents; issue ephemeral JWT tokens instead [6][9].
- Dual-layer on-behalf-of authorization: overlapping scope checks of both the agent and the human user it acts for, preserving accountability and blocking privilege escalation [9].
- Just-in-time grants and bounded execution scope with defined endpoint limits, rather than standing broad permissions [3].
- Fail-closed architecture: security disruptions must never result in expanded agent capabilities--interruptions default to total access revocation, not graceful degradation into unmonitored execution [9].
- Lifecycle management: automated pruning of idle or erratic agents, since abandoned credentials from "shadow AI" deployments are easy targets [9], and accumulated scopes and secrets are rarely revoked once projects end [5].
- Cryptographic identity via remote attestation and immutable audit logs to prevent agent spoofing [9].
Treating All Content as Untrusted
Because prompt injection arrives through data, every input an agent ingests--tickets, documents, emails, API responses, tool outputs--must be treated as untrusted and validated [1][7]. Recommended patterns include isolating the system prompt from retrieved content using structural separators [1], strict role and content separation [2], and passing untrusted fields to agents as clearly delimited data rather than interpolating them into prompts [8]. A more aggressive architectural pattern uses a separate, restricted model to summarize untrusted documents before passing them to the planning model, so hostile instructions never reach the decision-making context [1]. On the output side, filtering checks what the agent produces before it acts--catching sensitive data in responses or tool calls that fall outside expected patterns [7].
Sandboxing, Allowlists, and Human-in-the-Loop
Execution controls constrain what a compromised agent can actually do. Practitioners recommend container sandboxing using gVisor or WASM isolates for any agent-invoked code execution [6], tool allowlists with strict parameter validation [4], and workflows that assume injection will sometimes succeed: a CI/CD triage agent, for example, should have read-and-comment tools only, no package installation or shell execution, and no access to caches, secrets, or credentials shared with release pipelines [8]. For high-consequence actions--payments, deletions, fleet-wide changes, any action targeting an external recipient--explicit human-in-the-loop approval gates remain the strongest backstop [1][3][6].
Emerging Research: Information-Flow Control and Design Patterns
Academic research is moving from patchwork mitigations toward principled guarantees. A fast-moving research program applies information-flow control (IFC) and taint tracking to agents: CaMeL defeats prompt injections by design using taint tracking to enforce external system policy; FIDS enforces confidentiality and integrity simultaneously; RTBAS defends agents against injection and privacy leakage; and Prompt Flow Integrity (PFI) uses taint tracking specifically to prevent privilege escalation and confused deputy attacks [10]. Complementary work includes AgentArmor, which enforces program analysis on agent runtime traces [10], and privilege separation architectures that split agents into a planner and an unprivileged parser, with security monitors filtering untrusted input before it reaches planning--accompanied by formal security models [10]. Design pattern catalogs for securing LLM agents against injection are consolidating these findings into reusable blueprints [10]. While most of this work is early-stage, it signals the field's direction: making injection failures benign by construction rather than merely detectable.
Monitoring, Red Teaming, and Incident Response
Runtime defenses complete the stack. Security teams should deploy real-time monitoring of agent behavior correlated with endpoint state changes, comprehensive audit logging of every agent step, session-isolated memory with integrity verification, and authenticated agent-to-agent communication [1][3]. Pre-deployment red teaming is one of the most effective ways to surface control gaps that static analysis misses: simulate adversarial prompt injection, privilege escalation attempts, and tool misuse scenarios to pressure-test controls before launch [3]. In production, emphasize runtime visibility, behavioral analytics, and identity context so teams can detect and respond quickly when live actions drift from policy [7].
For practitioners, the SoK literature offers a phased security checklist covering design-time hardening, runtime monitoring, and incident response [2]--a useful template for sequencing investments from architecture through operations.
AI Agents Are Here. So Are the Threats.
Conclusion
The agentic attack surface is not a speculative future risk--it is the present-day consequence of giving language models credentials, tools, and autonomy. Indirect prompt injection turns every document, email, and webpage into a potential attack vector; excessive permissions turn every successful injection into privilege escalation; and multi-agent trust chains turn single compromises into cascading failures that can propagate across an enterprise faster than human review can intervene [2][1][8].
Yet the picture is not hopeless. A coherent defensive architecture has emerged: identity-first design with short-lived, scoped, fail-close credentials; rigorous treatment of all ingested content as untrusted; sandboxed execution with tool allowlists and human-in-the-loop gates for high-impact actions; and continuous monitoring grounded in auditable action logs rather than chat transcripts [1][3][9][5]. Meanwhile, information-flow control and privilege separation research points toward a future where prompt injection, while perhaps never fully eliminated, can be rendered operationally harmless [10][7].
The strategic imperative for enterprises is to treat security as a design constraint of agentic AI, not an afterthought--scoping autonomy to match trust, assuming injections will occasionally succeed, and ensuring that when they do, the blast radius is small, the action is logged, and a human is in the loop. The organizations that internalize this now will be the ones that scale agentic AI without scaling their risk.
References
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.