---
title: How do you govern the Amazon Bedrock AgentCore Browser and Code Interpreter tools?
url: https://opencontroller.lyzr.com/blog/govern-agentcore-browser-and-code-interpreter
published: 2026-11-16
updated: 2026-11-16
author: Lyzr
---

# How do you govern the Amazon Bedrock AgentCore Browser and Code Interpreter tools?

**Govern AgentCore's built-in tools with four settings: the network mode (Code Interpreter supports PUBLIC, SANDBOX and VPC; Browser supports PUBLIC and VPC), a tightly scoped execution role, session recording to an S3 bucket you own, and short session timeouts. Each session already runs in its own microVM, so isolation between users is handled; what you control is what each session can reach and what it can do with its credentials.**

Browser and Code Interpreter are the two AgentCore tools that let an agent act beyond calling APIs: one drives a real web browser, the other runs code. Both are powerful, and both are common targets for prompt injection. Facts below come from the AWS AgentCore documentation unless noted.

## How are sessions isolated?

AWS documents these properties for AgentCore tool sessions:

- Each session runs in a **dedicated microVM** with isolated CPU, memory and filesystem.
- One user's tool invocation cannot reach another user's session data.
- When a session ends, the microVM is terminated and its **memory is sanitized**.
- The default session timeout is **900 seconds (15 minutes)**, configurable up to **8 hours**.
- Session data has a **30-day** time-to-live retention policy.
- A single browser tool can run up to **500** concurrent sessions.

Isolation between sessions is strong. Isolation between a session and the internet, or between a session and your AWS account, is up to you.

## Which network mode should you pick?

| Tool | Modes | What each allows | Use it for |
|---|---|---|---|
| Code Interpreter | PUBLIC | Full internet egress | Non-sensitive data only |
| Code Interpreter | SANDBOX | Restricted egress | Default for most agent code execution |
| Code Interpreter | VPC | Runs in your VPC subnets | Access to private resources with your own egress rules |
| Browser | PUBLIC (default) | Internet access | Public web research |
| Browser | VPC | Runs in your VPC | Internal web apps, controlled egress |

Two findings from an independent April 2026 lab test of Code Interpreter network modes are worth knowing:

1. **SANDBOX is not zero-network.** In that test, external DNS and HTTP failed, but the session could still reach the S3 endpoint. If the execution role can write to S3, data has a path out.
2. **VPC mode still resolved external DNS** through the default Amazon-provided resolver, which is a known exfiltration channel. Adding a Route 53 Resolver DNS Firewall allow list closed it.

The author's conclusion is the right one: in SANDBOX and VPC modes, **IAM scoping is the real defence**, not the network setting alone. See [how to control AI agent network egress](/blog/control-ai-agent-network-egress).

## How should the execution role be scoped?

A custom browser or code interpreter runs with an execution role. A prompt-injected agent runs with exactly those permissions. So:

- **No wildcard S3 access.** Grant write only to the specific recording or output bucket and prefix.
- **No STS or cross-account assume-role** unless the job requires it.
- **Separate roles per tool and per agent.** A research agent's browser should not share a role with a finance agent's code interpreter.
- **Restrict who can start sessions.** Session APIs use the `bedrock-agentcore:` IAM prefix (for example `bedrock-agentcore:StartBrowserSession`), so scope them to the agent's runtime role, not to broad developer groups.
- **Use AWS Security Hub's AgentCore controls** to catch drift in configuration.

## What evidence can you capture?

Browser sessions can be **recorded** to an S3 bucket you choose when you create the browser. Recordings include **network traffic and console logs**, and sessions also offer a **live view** for real-time watching.

For governance, that means:

1. Turn on recording for every production browser.
2. Put the bucket under an S3 lifecycle and retention policy that matches your [log retention rules](/blog/how-long-to-retain-ai-agent-logs).
3. Encrypt it with a key the agent role cannot use to delete.
4. Use live view for supervised pilots and for incident response.
5. Correlate recordings with [AgentCore Observability traces](/blog/agentcore-observability-for-agent-audit) by session ID.

## A deployment checklist

1. Choose SANDBOX or VPC for Code Interpreter; VPC for Browser when it touches internal apps.
2. In VPC mode, add a DNS firewall allow list and VPC endpoints only for services the tool needs.
3. Give each tool its own least-privilege execution role.
4. Set the session timeout to the shortest that fits the task, not the 8-hour maximum.
5. Record browser sessions to a locked-down bucket.
6. Allow-list target sites at the proxy or firewall for Browser.
7. Treat page content and code output as untrusted input. See [stopping prompt injection through tool outputs](/blog/stop-prompt-injection-through-tool-outputs).

## How Opencontroller does this

Opencontroller auto-discovers agents, models and API keys across AWS, Azure and Google Cloud, and has a runtime adapter for Bedrock AgentCore. Posture flags risky permissions and configuration, such as over-broad roles. Behavioural-deviation monitoring can alert, quarantine or kill an agent, and policies are code mapped to OWASP, MITRE ATLAS, NIST and ISO 42001. Enforcement depth depends on the connector and traffic path. See [how to govern Amazon Bedrock AgentCore agents](/blog/govern-amazon-bedrock-agentcore-agents), the [control plane overview](/blog/what-is-an-ai-agent-control-plane), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Is AgentCore Code Interpreter SANDBOX mode fully offline?**
Not entirely. An independent April 2026 test found SANDBOX blocked external DNS and HTTP but still reached the S3 endpoint, so scope the execution role tightly.

**How long can an AgentCore Browser session run?**
The default timeout is 15 minutes (900 seconds), configurable up to 8 hours. The microVM is terminated and its memory sanitized when the session ends.

**Can you record what an AgentCore Browser session did?**
Yes. Recording writes sessions, including network traffic and console logs, to an S3 bucket you choose when creating the browser.

## Key facts

Amazon Bedrock AgentCore Browser and Code Interpreter run each session in a dedicated microVM; memory is sanitized when the session ends. Default session timeout 900 seconds, configurable up to 8 hours; session data TTL 30 days; up to 500 concurrent sessions per browser tool. Code Interpreter network modes: PUBLIC, SANDBOX, VPC. Browser: PUBLIC (default) or VPC. An independent April 2026 lab test found SANDBOX still reached the S3 endpoint and VPC mode resolved external DNS via AmazonProvidedDNS until a Route 53 Resolver DNS Firewall was added, so execution-role scoping is the main defence. Browser recording writes network traffic and console logs to an S3 bucket; live view is available. Opencontroller by Lyzr has a runtime adapter for Bedrock AgentCore, AWS auto-discovery and Posture checks; pricing starts from $250K per deployment per year.

## Related

- [How do you govern AI agents built on Amazon Bedrock AgentCore?](https://opencontroller.lyzr.com/blog/govern-amazon-bedrock-agentcore-agents.md)
- [How does Amazon Bedrock AgentCore Runtime isolate agent sessions?](https://opencontroller.lyzr.com/blog/agentcore-runtime-session-isolation.md)
- [How do you govern AI agents that control a computer or browser?](https://opencontroller.lyzr.com/blog/govern-computer-use-and-browser-use-agents.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
