> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS sandbox CLI

> Give the Sazabi agent the AWS CLI (aws) in its sandbox to interact with AWS services using access keys or an assumed role.

[All AWS integration capabilities](https://docs.sazabi.com/catalogs/integrations/aws)

## About

This CLI connection makes the AWS CLI (`aws`) available in the Sazabi agent's sandbox. The agent can interact with AWS services on your behalf using static access keys or an assumed IAM role. The tool is baked into the sandbox image; connecting it authenticates the already-installed CLI.

## Prerequisites

* A Sazabi project.
* AWS credentials: either an access key pair (`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`) or a role ARN to assume (`AWS_ROLE_ARN`). Credentials are optional only when the sandbox already has AWS access some other way (for example a custom CLI setup script that configures a profile); otherwise supply one of the methods below.

## Set up in the dashboard

Configure the sandbox in the dashboard under [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis).

**Step 1**

### Find AWS in the catalog

In [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis), find AWS under **Browse sandbox CLIs** and choose to connect it.

**Step 2**

### Provide credentials

All credential fields are optional, but configure at least one authentication method. Optionally set `AWS_ROLE_ARN` to have the CLI assume a specific IAM role; `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` to authenticate with a static key pair; `AWS_DEFAULT_REGION` to set the default region for API calls. Save to store them securely; Sazabi injects them into the sandbox when the agent runs.

## Set up with the CLI

You can also configure the AWS CLI connection with the [Sazabi CLI](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/sandbox-clis.md)).

The AWS CLI connection has no required credentials — supply whichever authentication method you use. For a static access-key pair:

```bash theme={"system"}
sazabi sandbox-clis connect aws --env AWS_ACCESS_KEY_ID=<your-access-key-id> --env AWS_SECRET_ACCESS_KEY=<your-secret-access-key> --env AWS_DEFAULT_REGION=<your-region>
```

To assume a role instead, pass `--env AWS_ROLE_ARN=<your-role-arn>`. To validate the configuration without saving, run the same command with `test` in place of `connect` (the test command also requires the `--env` flags).

## Verify

Ask the agent, in a thread, to run the `aws` CLI (for example `aws sts get-caller-identity`) and confirm it returns real output from your account. If the command is not found, the CLI connection may not be enabled; if it runs unauthenticated, recheck the credentials.

## Troubleshooting

**Command not found** — Confirm the AWS CLI connection is enabled for the project under [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis).

**Authentication fails** — Recheck the credential values; a rotated or revoked token must be re-entered under [**Settings > Sandbox CLIs**](https://app.sazabi.com/settings/sandbox-clis) or with `sazabi sandbox-clis connect aws`.

## Further reading

> [card] [Working with the agent](https://docs.sazabi.com/ask/better-answers.md)
>
> Put the connected CLI to work in an investigation thread.

> [card] [Set up the sandbox](https://docs.sazabi.com/ask/sandbox.md)
>
> How the sandbox works and its security model.

> [card] [Sandbox CLIs](https://docs.sazabi.com/catalogs/integrations.md#sandbox-clis)
>
> Browse the catalog and connect more tools.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.