AWS AgentCore Harness Credential Exfiltration Risk

AWS AgentCore Default Configs Risk Credential Exfiltration via Prompt Injection

HIGH
September 18, 2026
16m read
Cloud SecurityThreat IntelligenceVulnerability

Related Entities

Organizations

Products & Tech

AWS AgentCore HarnessAgentCore IdentityUnit 42 Cloud Security AssessmentPrisma CloudIAM

Other

Niv Rabin

Full Report

Executive Summary

Unit 42 researchers have identified a critical security weakness in the default configuration of Amazon Web Services' AWS AgentCore Harness. The issue stems from the harness's built-in shell tool, which is enabled by default with root privileges. An attacker can use prompt injection techniques to coerce an AI agent into executing arbitrary commands, allowing for the exfiltration of plaintext credentials managed by AgentCore Identity. AWS reviewed the finding and classified it as informative, placing the responsibility on customers to secure their agent environments. The primary mitigations involve explicitly restricting agent tools using the allowedTools parameter and implementing strict network egress filtering. This finding highlights the emerging security risks associated with the default configurations of powerful AI agent frameworks.


Vulnerability Details

The vulnerability is not a traditional code flaw but a dangerous default configuration that creates an insecure-by-default state. The AWS AgentCore Harness is designed to simplify AI agent deployment by managing the underlying infrastructure, including tools for the agent to interact with its environment.

By default, the harness includes two powerful built-in tools: shell and file_operations. The shell tool can execute arbitrary bash commands within the agent's runtime environment. Unit 42's research found that this tool executes with root privileges.

The core of the problem lies in the intersection of three components:

  1. Prompt Injection: An attacker can craft input that tricks the Large Language Model (LLM) powering the agent into executing a malicious command instead of its intended task.
  2. Default shell Tool: The presence of a root-privileged shell tool, available in every session unless explicitly disabled, provides the mechanism for the attacker's command to be executed.
  3. Shared Memory Space: The shell tool operates within the same memory context where AgentCore Identity decrypts and handles credentials in plaintext for runtime use. This gives the shell tool direct access to sensitive information like API keys and other secrets.

An attacker can therefore construct a prompt that instructs the agent to use the shell tool to read these plaintext credentials from memory or environment variables and then exfiltrate them over the network. According to Unit 42, AWS's response emphasized that customers are responsible for managing this risk through controls like scoping the allowedTools parameter and using network egress filtering.


Affected Systems

The vulnerability affects any deployment of AWS AgentCore Harness that relies on the default configuration where the allowedTools parameter is not explicitly set to restrict access to the built-in shell and file_operations tools. Any user or organization building AI agents on this platform without applying the principle of least privilege to the agent's toolset is potentially at risk.


Exploitation Status

The report from Unit 42 is based on their own research and proof-of-concept. There is no mention of this specific technique being exploited in the wild at the time of publication. However, prompt injection is a widely known attack vector against LLM-based applications, and the tools to carry out such an attack are readily available. The low complexity and high impact make this a significant risk for unprepared organizations.


Impact Assessment

The potential impact of this vulnerability is severe. Successful exploitation could lead to the complete compromise of the credentials managed by AgentCore Identity. An attacker gaining these credentials could:

  • Access and exfiltrate sensitive data from connected AWS services (e.g., S3 buckets, databases).
  • Perform lateral movement within the victim's cloud environment.
  • Modify or destroy cloud resources, causing service disruption and financial loss.
  • Bypass security controls like IAM policies and encryption, as the attack occurs at runtime when credentials are legitimately in use.

Given that the agent harness is designed for autonomous operations, a compromise could persist and cause extensive damage before being detected.


IOCs — Directly from Articles

The source article does not contain specific Indicators of Compromise (IOCs) such as IP addresses, domains, or file hashes.


Cyber Observables — Hunting Hints

Security teams may want to hunt for the following patterns to identify vulnerable configurations or potential exploitation activity:

Type
Configuration Audit
Value
allowedTools parameter
Description
Search for AWS AgentCore Harness configurations where the allowedTools parameter is not defined or is overly permissive.
Type
Log Analysis
Value
Agent execution logs
Description
Monitor for invocations of the shell or file_operations tools, especially if their use is not expected.
Type
Command Line Analysis
Value
curl, wget, nc, printenv
Description
Look for the execution of network utility commands or environment inspection commands by the agent's shell process.
Type
Network Monitoring
Value
Egress traffic from AgentCore hosts
Description
Baseline normal egress traffic and alert on connections to unusual IP addresses, domains, or high-volume data transfers.

Detection & Response

Detecting and responding to the abuse of AgentCore Harness requires a multi-layered approach focusing on configuration, logging, and network monitoring.

Detection Methods

  1. Configuration Auditing: Regularly scan AgentCore configurations using infrastructure-as-code (IaC) scanners or custom scripts to find instances where allowedTools is not properly restricted. Prisma Cloud can help identify such misconfigurations.
  2. Log Monitoring: Ingest AWS CloudTrail and agent-specific execution logs into a SIEM. Create detection rules to alert on:
    • Any use of the shell tool in production agents where it is not explicitly required.
    • Suspicious command line arguments passed to the shell, such as those related to network connections (curl, wget) or credential discovery (env, cat /proc/self/environ).
    • D3FEND: D3-PA - Process Analysis
  3. Network Traffic Analysis: Deploy network monitoring tools to analyze traffic originating from the AgentCore runtime environment. Establish a baseline of normal network behavior and alert on anomalies, such as connections to unknown external endpoints or unusually large data transfers.

Response Actions

If a compromise is suspected, the Unit 42 Incident Response team recommends immediate action:

  1. Isolate: Immediately disable the compromised agent and revoke its associated IAM credentials.
  2. Investigate: Analyze logs to determine the scope of the attacker's actions, including what commands were executed and what data may have been accessed or exfiltrated.
  3. Remediate: Apply the mitigation steps below to all AgentCore instances. Rotate all credentials that may have been exposed.

Mitigation

Mitigation focuses on hardening the AgentCore Harness configuration by adhering to the principle of least privilege.

Immediate Actions

  1. Restrict Tools: The most critical step is to explicitly define the allowedTools parameter for every agent session. Only grant the specific tools required for the agent's task. If the shell or file_operations tools are not needed, they should not be in the list. This is a form of application hardening.

    // Example of a secure configuration
    {
      "model": "anthropic.claude-v2",
      "instructions": "You are a helpful assistant.",
      "tools": [
        // Custom tool definitions here
      ],
      "allowedTools": ["my_custom_tool_1", "my_custom_tool_2"]
    }
    
  2. Implement Egress Filtering: Configure VPC network security groups and NACLs to strictly control outbound network traffic from the AgentCore runtime. Only allow connections to known, trusted endpoints. Deny all other outbound traffic by default.

Strategic Improvements

  • Credential Management: Whenever possible, use IAM roles with temporary credentials that have narrowly scoped permissions, reducing the impact of a potential credential leak.
  • Agent Design: Design agents to be less reliant on broad, powerful tools like a general-purpose shell. Instead, create more granular, purpose-built tools with built-in validation and safety checks.

Timeline of Events

1
August 1, 2026
AWS documentation in late August 2026 described the 'shell' and 'file_operations' tools as being available by default in every session.
2
September 18, 2026
This article was published
3
September 18, 2026
Unit 42 published its research findings on the security risks of AWS AgentCore Harness default configurations.

MITRE ATT&CK Mitigations

Corresponds to disabling the default 'shell' and 'file_operations' tools by explicitly defining an 'allowedTools' list that excludes them.

Mapped D3FEND Techniques:

Implement strict egress filtering to prevent the agent from communicating with unauthorized external endpoints, blocking potential exfiltration channels.

Mapped D3FEND Techniques:

Properly configure the AWS AgentCore Harness by specifying the 'allowedTools' parameter to enforce the principle of least privilege for each agent.

Mapped D3FEND Techniques:

Audit

M1047enterprise

Enable and monitor logs from the AgentCore runtime and AWS CloudTrail to detect suspicious activity, such as unexpected tool usage or command execution.

Mapped D3FEND Techniques:

D3FEND Defensive Countermeasures

The most effective defense against this threat is to harden the configuration of the AWS AgentCore Harness. This involves moving away from the insecure default settings and adopting a principle of least privilege. Specifically, for every agent definition, you must explicitly define the allowedTools parameter. This parameter should contain a list of only the tools that the agent absolutely requires to perform its designated function. By defining a restrictive list, you implicitly disable the powerful, high-risk default tools like shell and file_operations.

Implementation should be enforced via policy-as-code and CI/CD pipeline checks. For example, use tools like Open Policy Agent (OPA) Gatekeeper or native IaC linters to scan Terraform, CloudFormation, or other configuration files for AgentCore definitions that lack a restrictive allowedTools parameter. Block any deployment that attempts to create an agent with default tool access. For existing agents, conduct a thorough audit to identify all instances using default tools, assess whether their use is justified, and refactor them to use more granular, purpose-built tools where possible. This proactive hardening directly removes the primary vector for exploitation described by Unit 42.

As a critical compensating control, implement strict outbound traffic filtering for the network environment where the AgentCore Harness executes. Even if an attacker successfully tricks an agent into executing a command to steal credentials, this control can prevent them from exfiltrating that data. Configure AWS Security Groups and Network Access Control Lists (NACLs) to enforce a default-deny policy on all egress traffic. Then, create explicit allow rules for only the specific IP addresses, domains, and ports that the agent legitimately needs to contact. For example, if the agent only needs to access a specific AWS service API, only allow HTTPS traffic to that service's endpoint. All other outbound connections should be blocked and logged. This defense-in-depth measure significantly raises the difficulty for an attacker, as they would not only need to compromise the agent but also find a way to exfiltrate data through an allowed channel, which is a much harder problem. Regularly review and audit these egress rules to ensure they remain as restrictive as possible.

For detection and threat hunting, implement process analysis by monitoring the commands executed by the agent's shell tool. This requires capturing and analyzing the execution logs from the AgentCore Harness. Forward these logs to a SIEM or security analytics platform. Develop detection rules that look for anomalous process execution patterns. For instance, an agent designed for data analysis should not be executing commands like curl, wget, nc, or attempting to read sensitive system files. Create alerts for any execution of the shell tool in environments where it is supposed to be disabled. Furthermore, establish a baseline of normal commands for agents that legitimately require shell access and alert on any significant deviations. This analysis provides visibility into the agent's actions at runtime and can serve as an early warning of a prompt injection attack or other malicious activity, enabling security teams to respond before a full breach occurs.

Timeline of Events

1
August 1, 2026

AWS documentation in late August 2026 described the 'shell' and 'file_operations' tools as being available by default in every session.

2
September 18, 2026

Unit 42 published its research findings on the security risks of AWS AgentCore Harness default configurations.

Sources & References

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Editorial Standards & Analyst Review

CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.

Tags

AWSAgentCoreAI SecurityCloud SecurityPrompt InjectionCredential ExfiltrationThreat ResearchUnit 42

📢 Share This Article

Help others stay informed about cybersecurity threats

🎯 MITRE ATT&CK Mapped

Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.

🧠 Enriched & Analyzed

Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.

🛡️ Actionable Guidance

Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.

🔗 STIX Visualizer

Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.

Sigma Generator

Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.