The rapid deployment of autonomous artificial intelligence agents within cloud ecosystems has fundamentally altered the security landscape by introducing sophisticated vectors that bypass traditional infrastructure protections. A significant discovery by researchers at Palo Alto Networks’ Unit 42 has illuminated a critical vulnerability within the AWS AgentCore framework, focusing on the potential for indirect prompt-injection attacks. These exploits allow malicious actors to manipulate Large Language Models into exfiltrating sensitive plaintext credentials, such as session tokens and authentication keys. This development highlights a shift in cyber threats, where the target is no longer just the underlying software or the physical hardware, but the very logic and decision-making processes of the AI agents themselves. Understanding these technical mechanics is vital for organizations that rely on the AgentCore Harness to automate complex enterprise workflows. As these tools become more pervasive throughout 2026, the need for robust governance over AI agency has never been more pressing for security teams.
Architectural Foundations: Defining the Operational Environment
The AWS AgentCore architecture is built upon a dual-layer system that separates the foundational infrastructure from the active operational environment used by the AI agent. The AgentCore Runtime provides the base layer of this system, ensuring that the underlying computational resources are available and isolated from other user sessions. Meanwhile, the AgentCore Harness serves as the primary environment where the agent interacts with various external tools, manages persistent memory, and handles identity requirements for service authentication. Within this Harness, agents are granted access to essential capabilities like file operations and networking, which are necessary for performing complex tasks in a cloud-native context. However, the high degree of integration between the Harness and the Runtime creates a situation where the agent’s own tools can potentially access sensitive memory regions. This design facilitates efficient performance but also requires a nuanced understanding of how data flows between different subsystems during an active session.
Component Roles within the Framework
In a typical deployment, the AgentCore Identity subsystem is responsible for managing the credentials required to interact with external services and Model Context Protocol servers. These credentials are often stored securely using Amazon Resource Names to prevent the risks associated with hard-coding sensitive information directly into the agent’s logic. When the agent needs to perform an authenticated task, the identity service resolves these references into usable formats, such as JSON Web Tokens, which are then temporarily held in the runtime memory for the duration of the session. While the transition from a stored reference to an active token is a standard procedure, the presence of these tokens in plaintext within the runtime process creates a target for internal scraping. If a tool within the Harness environment is compromised or manipulated, it may be able to read this memory space, effectively bypassing the security measures intended to keep the original credentials hidden. This internal accessibility highlights the importance of securing the communication between the Harness and its identity components.
Default Settings and Configuration Gaps
A significant factor in the vulnerability of these systems is the open-by-default philosophy that governs the initial setup of the AgentCore Harness environment. By default, the environment provides the agent with powerful capabilities, including a built-in command-line shell and tools for creating or modifying files within the session. These tools are active and fully operational from the moment of deployment unless a developer explicitly takes steps to restrict them using the allowed-tools configuration setting. While this approach allows for rapid development and flexibility, it also means that many agents operate with a level of authority that is not strictly necessary for their specific functions. If these excessive permissions are not dialed back, the agent remains susceptible to being used as a conduit for system-level commands that it was never intended to execute. This gap between the ease of deployment and the necessity of restrictive security configurations is a primary entry point for attackers looking to leverage standard agent features for malicious purposes.
Technical Execution: The Mechanics of the Exploit
The execution of an indirect prompt-injection attack represents a highly strategic method of compromising an AI agent without needing to breach the perimeter of the cloud infrastructure. This process begins when an attacker places poisoned data into a source that the agent is expected to process, such as a customer support ticket or an external database entry. Because the agent is programmed to read and act upon this information, it consumes the malicious instructions as part of its normal operation. This injection is termed indirect because the attacker does not communicate with the model directly but relies on the agent’s autonomous behavior to trigger the exploit. Once the agent interprets the hidden commands, it is induced to invoke the built-in shell tool, effectively transitioning from a data-processing mode to a code-execution mode. This pivot is critical because it allows the agent to bypass standard input filters that are typically designed to detect direct attempts at subverting the model’s core instructions or safety guidelines.
From Prompt to Code Execution
Once the malicious instructions have been successfully ingested, the agent uses its authorized access to the command-line shell to execute arbitrary Bash commands within the Harness environment. This capability is particularly dangerous because the shell process in many default configurations operates with root-level privileges, granting it broad visibility into the local system. Furthermore, researchers discovered that the shell tool often shares a common user identifier with the runtime process that manages the overall session. This shared context is what allows the shell to bridge the gap between different functional layers, enabling it to read the memory of the runtime process. In this memory space, the shell can locate and extract the resolved authentication tokens that were generated earlier in the session for legitimate service interactions. The agent, acting under the influence of the injected prompt, can then be commanded to transmit these stolen tokens to an external endpoint, providing the attacker with the means to impersonate the agent in subsequent requests.
Memory Access and Credential Exfiltration
The exfiltration of plaintext credentials from the runtime memory marks the final and most damaging stage of the injection attack. Because the JSON Web Tokens found in the memory are already in a resolved and usable format, the attacker does not need to decrypt them or provide additional authentication to use them. These tokens can be replayed from any unauthorized system to gain access to the same external services and Model Context Protocol servers that the original agent was authorized to use. This bypass effectively nullifies the protections provided by identity and access management policies, as the attacker is essentially using a valid, active session key. In simulated environments, this method allowed unauthorized actors to query customer databases and retrieve personally identifiable information that should have been restricted. The fact that this entire process occurs within the boundaries of a single authorized session proves that infrastructure-level isolation is not a substitute for internal segmentation and rigorous tool governance within the AI runtime itself.
Strategic Context: The Evolving Threat Landscape
The risks identified within the AWS AgentCore framework are part of a broader, industry-wide trend known as agent hijacking, which has become a primary focus for security researchers in 2026. This phenomenon occurs when an autonomous agent is granted enough agency and tool access to interact with its host operating system in ways that can be subverted by malicious prompts. Organizations like the National Institute of Standards and Technology have documented how command-line access and file manipulation tools significantly expand the attack surface of Large Language Models. When agents are allowed to download external software or scrape cloud metadata services, they can inadvertently become tools for persistent lateral movement within an enterprise network. The consensus among cybersecurity professionals is that the traditional security boundary has moved from the network perimeter to the internal logic of the AI model. As agents become more integrated into critical workflows, the potential for them to be turned into conduits for data breaches grows if their permissions are not strictly audited.
Infrastructure Versus Logical Isolation
A fundamental takeaway from recent security evaluations is that the physical isolation provided by modern cloud infrastructures is no longer sufficient to protect against logic-based exploits. Most current frameworks utilize dedicated micro-virtual machines to separate different user sessions, ensuring that a compromise in one session does not lead to a broad infrastructure breach. However, as the Unit 42 research demonstrated, the most critical vulnerabilities often exist within the session itself, where the internal components of the agent are not adequately segmented from one another. If an agent can use its own authorized tools to access its own session memory, the security of the virtual machine is irrelevant to the protection of the credentials held within that session. This realization has forced a shift in defensive strategies, moving away from a reliance on host-level security toward a focus on protecting the internal state of the agent. Ensuring that tools and memory are properly compartmentalized is now recognized as a vital requirement for any secure implementation of autonomous AI.
Shared Duties: Navigating the Responsibility Model
The resolution of these security challenges is found within the Shared Responsibility Model, which defines the specific duties of the cloud provider and the enterprise client. Under this model, AWS successfully maintained the security of the cloud by ensuring micro-virtual machine isolation and the integrity of the managed runtime code. However, the responsibility for securing the configuration and the prompts within the agent environment fell squarely on the developer. This included the mandate to sanitize all incoming data and to restrict the available tools to only those strictly necessary for the task at hand. By treating the Unit 42 disclosure as an informational issue rather than a bug, the industry reaffirmed that the ultimate defense against prompt injection lies in customer-managed controls. Developers must proactively implement behavioral restrictions and validation layers to ensure that their agents do not interpret malicious external data as a set of legitimate instructions. This division of labor emphasizes that while the platform provides the necessary tools, the user must provide the necessary governance.
Restricted Scoping: Implementing Governance Protocols
The strategic shift toward restrictive tool scoping proved to be the most effective method for securing these environments throughout 2026. Security teams recognized that the transition from open-by-default configurations to a zero-trust model was necessary for preventing the conversion of productivity tools into data conduits. Organizations that prioritized the principles of least privilege and strict network segmentation successfully mitigated the risks associated with token exfiltration. These entities integrated comprehensive logging through monitoring services, which allowed for the detection of anomalous behavioral patterns within agent sessions. Furthermore, the adoption of VPC-only network modes blocked unauthorized egress attempts, ensuring that intercepted credentials remained unusable to external adversaries. As autonomous agents continued to evolve, the industry moved away from reliance on infrastructure isolation alone, acknowledging that internal logic protection was paramount. These proactive steps defined the standard for securing the next generation of cloud-native intelligence and ensured that AI deployment remained a secure asset for the enterprise.
