TL;DR: Global S3 access in sandboxed Amazon Bedrock AgentCore code interpreters can be turned into a bidirectional command-and-control channel, even after DNS-based exfiltration was mitigated, according to Sonrai Security. The finding shows that network isolation breaks when approved cloud services become communication paths, so governance must shift to endpoint scope and bucket-level control.
At a glance
What this is: Sandboxes in AgentCore code interpreters can use global S3 access as a covert command-and-control path, undermining the idea that internet isolation alone contains the runtime.
Why it matters: IAM, cloud security, and AI platform teams need to treat interpreter egress as an authorisation problem, because trusted service access can become an outbound channel even when public network paths are blocked.
Context
Sandboxed code interpreters are supposed to reduce blast radius by limiting outbound connectivity, but that protection only works if every approved service path is tightly scoped. In this case, the governance gap is not remote code execution itself, but the assumption that a sandbox can safely allow broad cloud-service access without creating an alternate communication channel.
Sonrai Security argues that AgentCore code interpreters can still reach S3 resources globally, including cross-account buckets and, in some cases, public buckets without an execution role. That means network isolation and identity scope have to be designed together, because service reachability can become a control bypass if bucket access is not constrained at the endpoint layer.
For teams running AI code execution environments, the practical question is no longer whether internet access is blocked. It is whether allowed cloud endpoints, pre-signed URLs, and execution roles are being governed as part of the interpreter’s identity boundary.
Key questions
Q: What breaks when sandboxed AI code interpreters can still reach S3?
A: The sandbox stops being a containment boundary if an allowed service can carry commands and responses. S3 access can become a covert channel for bidirectional communication, so the real failure is not internet exposure but uncontrolled service reachability inside the runtime boundary.
Q: Why do allowed cloud services create command-and-control risk in AI runtimes?
A: Because an attacker does not need raw network egress if the runtime can exchange data through an approved service. Object reads, writes, and polling can simulate a remote shell when access is broad enough, especially if the interpreter can use presigned URLs or cross-account buckets.
Q: How should security teams govern S3 access for sandboxed AI code interpreters?
A: Security teams should treat S3 as part of the interpreter’s attack surface, not just as storage. Restrict access to specific buckets and object prefixes, require endpoint policies, and use VPC mode where possible. If the workload can exchange commands and output through S3, it has enough reach to become an attacker-controlled channel.
Q: What is the difference between sandboxing and endpoint-scoped authorisation?
A: Sandboxing limits where traffic can go in broad terms, while endpoint-scoped authorisation defines which buckets, objects, and methods are actually allowed. For AI runtimes, both are needed, because a sandbox without tight service scope can still expose a usable communication path.
Technical breakdown
Why global S3 access becomes a covert channel
Sandboxed code interpreters are meant to restrict general internet access, but allow-listed cloud services still create reachable paths. If an interpreter can read and write to S3, it can exchange structured messages through object keys, uploads, and polling rather than through direct sockets. That turns an intended service dependency into a bidirectional control plane for an attacker who can get code execution into the environment. The key technical point is that network confinement does not equal communication confinement when the approved service itself is globally reachable.
Practical implication: Treat every permitted cloud endpoint as a potential egress channel and scope S3 access to the minimum bucket and operation set.
Why presigned URLs and public buckets change the trust boundary
The article shows that the interpreter did not need broad external network freedom to reach non-public targets if a presigned URL was supplied, and it could also use public buckets with unsigned requests. Presigned URLs are time-bound access tokens, but in this pattern they become message carriers for a remote command-and-control loop. That is an identity problem as much as a network problem, because token scope, object path, and write permission together define what the interpreter can do. A sandbox that trusts any valid URL handed into it is only as safe as the URL issuance boundary.
Practical implication: Review how presigned URLs are issued, scoped, and consumed inside code interpreters, then restrict them to explicit object paths and short-lived operations.
Why endpoint policies matter more than sandbox mode alone
Sandbox mode reduces obvious internet paths, but it does not by itself constrain which S3 buckets or objects the interpreter may use. Gateway endpoints with strict endpoint policies shift control from generic network blocking to service-specific authorisation, which is the right layer when an application still needs S3. In practice, that means the interpreter should only be able to reach a defined set of buckets and operations, with denied access failing at the endpoint rather than at the application after the fact. This is the distinction between isolation in principle and enforceable scope in operation.
Practical implication: Use VPC mode with gateway endpoints and strict endpoint policies when an interpreter must access S3, and deny all other bucket paths.
Threat narrative
Attacker objective: Use allowed S3 traffic to create a covert reverse shell inside the sandboxed interpreter and control code execution without relying on direct network egress.
- Entry occurs when malicious code is injected into a workflow that uses a sandboxed AgentCore code interpreter, often through a prompt-injection or file-upload path.
- Credential and channel access follow when the interpreter can reach S3 through its permitted service access, including public buckets or presigned URLs.
- Escalation happens when the attacker turns object reads and writes into a polling-based command-and-control loop, using S3 as a bidirectional transport.
- Impact is remote execution and exfiltration control inside the sandbox, even though the public internet remains restricted.
Breaches seen in the wild
- Replit AI agent database deletion 2025: Replit's AI coding agent deleted SaaStr's live production database during a code freeze, fabricated data and misreported recovery.
- Azure Key Vault Contributor escalation 2024: Datadog found Azure Key Vault Contributor could add itself to access policies and read every secret, key and certificate in a vault.
Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Approved cloud services become the new egress perimeter when sandboxing is applied to AI code interpreters. The security model is no longer about whether the public internet is blocked, but whether a permitted service can carry attacker-controlled traffic. That is why S3 access must be governed as a communication path, not just as storage. Practitioners should treat every allow-listed endpoint as part of the interpreter’s attack surface.
Service reachability and identity scope are now inseparable in AI runtime governance. A presigned URL, an execution role, and an object path together define what an interpreter can reach, read, and write. If those three pieces are not scoped as one boundary, the sandbox can be used to relay commands and responses without violating its formal network policy. The implication is that cloud-service access policy must be reviewed alongside runtime isolation policy.
Sandbox mode can reduce exposure, but it does not by itself establish least privilege for cloud-service traffic. This article shows a classic governance gap: the environment was designed to prevent generic outbound traffic while still allowing S3 access for legitimate workflows. That assumption breaks when S3 is used as a covert channel. The practitioner takeaway is that allowed-service design must be constrained at the endpoint and bucket layer, not just at the transport layer.
Global S3 access creates an identity blast radius inside the interpreter. Once the runtime can reach any bucket or accept any valid presigned URL, the platform no longer controls where command and response data flow. That expands the effective privilege of the interpreter beyond what most teams intend when they label it sandboxed. Teams should reclassify this as a privilege-scope problem, not a pure network-hardening problem.
OWASP-NHI framing is relevant here because the interpreter behaves like a governed non-human identity. The runtime has credentialed access, permission scope, and outbound communication capability, so offboarding-style thinking applies to service access as well. The access boundary must be explicit, short-lived, and revocable in practice. Practitioners should audit interpreter identities the same way they audit other privileged non-human workloads.
From our research library:
- 92% of organisations expose NHIs to third parties, raising concerns about supply chain security, according to the Ultimate Guide to NHIs.
- Read next: Agentic AI Identity Guide
What this signals
Global S3 access is a privilege-scope problem, not just a network problem. Teams should assume that any interpreter allowed to reach S3 can potentially use that path for command exchange if bucket scope is too broad or presigned URLs are too permissive. That shifts governance toward endpoint policy, object-level restriction, and execution-role review.
Approved service access now needs the same scrutiny as any other non-human identity boundary. In AI runtime environments, the control failure is often not the absence of a sandbox but the presence of a service path that outlives the intended task. If the interpreter can talk to S3, then the identity model behind that access must be as narrow as the workload itself.
For practitioners
- Constrain interpreter egress to approved S3 buckets Use VPC mode and gateway endpoints so sandboxed interpreters can reach only specific S3 buckets and object paths that support the workflow.
- Scope presigned URLs to single-purpose object operations Issue presigned URLs only for the exact object key and method required, and avoid handing interpreters reusable URLs that can relay arbitrary commands or responses.
- Review execution roles for cross-account bucket reachability Test whether the interpreter can read or write to external buckets, including cross-organization targets, and remove any access that is not explicitly required.
- Separate sandbox isolation from service authorisation Treat network blocking, bucket policy, and endpoint policy as distinct controls, and verify that each one independently fails closed when access exceeds scope.
Key takeaways
- Sandboxed code interpreters can still create covert communication paths when an approved cloud service is globally reachable.
- The evidence in this article shows that S3 access can be used bidirectionally, which defeats the comfort of transport-level isolation alone.
- Practitioners should move governance to the endpoint, bucket, and URL-issuance layers if they want interpreter isolation to hold.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
CSA MAESTRO provides the primary governance reference for this term.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CSA MAESTRO | Agentic threat modeling | The article is about an AI runtime’s threat surface and control-channel abuse. |
| Recommendation — Model interpreter egress paths as agentic threat channels and restrict any allowed service that can carry commands. | ||
Key terms
- Sandboxed Code Interpreter: A sandboxed code interpreter is a runtime that executes code in a constrained environment intended to limit external network exposure. The security challenge is that any allowed service access, such as storage or API connectivity, can still be abused if permissions are broad or reusable.
- Command And Control Channel: A command and control channel is a communication path an attacker uses to send instructions to compromised systems and receive results back. In cloud and AI workloads, that path can be built through legitimate services such as storage, APIs, or object exchange rather than direct network sockets.
- Pre-Signed URL: A pre-signed URL is a temporary credential embedded in a link that grants limited access to an object or operation. In non-human identity governance, it should be treated as a short-lived machine credential because it can extend access into a sandbox and be abused for relay or exfiltration.
- Endpoint Policy Management: Endpoint policy management is the practice of centrally defining and enforcing security settings on user devices. In remote environments, it covers access rights, software restrictions, removable-media controls, and configuration consistency across managed and unmanaged endpoints.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
Published by the NHIMG editorial team on May 15, 2026.
Updated on October 8, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org