The mental model
AgentCore Code Interpreter is a managed tool for executing generated code and processing files in isolated sessions. It serves a different role from hosting the whole agent loop: the agent can call it for computation while other components manage planning, user access, and tool authorization. The uploaded data, execution role, returned artifacts, and session lifecycle all need explicit boundaries.
The network mode changes what code can reach. Sandbox mode has limited external access and can access S3 for data operations; it does not mean absolutely no AWS access. Public mode permits public internet resources. VPC mode connects to your configured private network, whose routes and controls determine reachability. Review mounted filesystems, IAM permissions, timeouts, session limits, and output handling rather than relying on the mode name.
Decisions to make
- Use Code Interpreter when the agent needs a managed code-execution tool instead of a custom runtime for its whole loop.
- Choose network and data permissions from the smallest set of sources and destinations the computation requires.
Design exercise · no AWS resources needed
Work through a scenario
An assistant analyzes a private CSV and returns a chart.
- Specify the input data path, allowed S3 access, and returned artifact types.
- Choose network mode and remove unnecessary outbound destinations.
- Set a session deadline, an output review step, and a cleanup policy.
Check your understanding
Does Code Interpreter Sandbox mode mean no access to AWS services?
Choose an answer to see the reasoning.
Continue with AWS documentation
- Code Interpreter resource and network management (opens in a new tab)
- AgentCore Code Interpreter (opens in a new tab)
Before following a deployment guide, review current pricing, permissions, and cleanup steps. Budget alerts are not a hard spending cap.