# AWS AgentCore Code Interpreter

Create the AWS access key that lets Sandcovery run sandboxes on AgentCore's code interpreter in your own AWS account.

Sandcovery runs each sandbox as a session of AgentCore's managed code interpreter, `aws.codeinterpreter.v1`, in your AWS account in US West (Oregon).

## What runs

| Option           | Support                                        |
| ---------------- | ---------------------------------------------- |
| Size             | `2x8` only                                     |
| Egress           | `deny_all` only, which still reaches Amazon S3 |
| Lifetime         | Up to 8 hours                                  |
| Pause and resume | No                                             |
| Command timeout  | Up to 900 seconds                              |
| Region           | `us-west-2`                                    |

The managed code interpreter runs in sandbox network mode, which AWS describes as limited network access to AWS services, including Amazon S3. So a sandbox here can still reach S3, though Sandcovery routes it only `deny_all` requests.

Snapshots, port previews, custom images, environment variables set at create, disk sizes, idle timeouts, and GPUs are not available on this provider.

## Create the access key

Create an IAM user with this policy, then create an access key for it. The policy allows only the five session calls Sandcovery makes, on the managed code interpreter alone.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:StartCodeInterpreterSession",
        "bedrock-agentcore:InvokeCodeInterpreter",
        "bedrock-agentcore:GetCodeInterpreterSession",
        "bedrock-agentcore:ListCodeInterpreterSessions",
        "bedrock-agentcore:StopCodeInterpreterSession"
      ],
      "Resource": "arn:aws:bedrock-agentcore:us-west-2:aws:code-interpreter/aws.codeinterpreter.v1"
    }
  ]
}
```

## Add the credential

In **Provider Credentials** in the [dashboard](/app/credentials), add these two fields for AWS AgentCore Code Interpreter:

- Access key ID
- Secret access key

## Costs

AWS bills code interpreter sessions to your AWS account, for the CPU a session uses and its peak memory, per second. Sandcovery's estimates and spend limits count a `2x8` session at full use at the US West (Oregon) [list price](/providers/aws), so a session below full use costs less.
