> For the complete documentation index, see [llms.txt](https://docs.warp.dev/llms.txt).
> Markdown versions of each page are available by appending .md to any URL.

# Cloud providers

Configure AWS and GCP federation for factory runs or standalone cloud agents using short-lived OIDC credentials.

Cloud agents access AWS, GCP, and other cloud providers using short-lived OpenID Connect (OIDC) credentials instead of long-lived keys. For a factory, [configure its default environment](#configure-a-factory-environment) from the factory’s settings. For standalone runs, configure an environment in the Oz web app.

* * *

## Prerequisites

-   A Warp account. You can [create an account in the Oz web app](https://oz.warp.dev).
-   A cloud provider account

Follow the section for your cloud provider.

## Configure a factory environment

Configure cloud access from your factory’s **Settings** > **Integrations** in the [Warp Factories web app](https://platform.warp.dev). These settings apply to the factory’s default environment; you don’t need to create a separate environment.

You need permission to edit the factory’s cloud-provider settings and an administrator who can configure federation in your cloud account. Reuse an existing trusted provider and role or pool when their access matches the factory’s needs. Otherwise, create them with the shared [AWS](#aws) or [GCP](#gcp) instructions below.

### Configure AWS for a factory

1.  In AWS, create or reuse the [OIDC identity provider](#step-1-create-an-oidc-identity-provider) and [IAM role](#step-2-configure-an-iam-role). Restrict the role’s trust to the intended Warp team or principals and grant only the resource permissions the task needs.
2.  In the factory’s **Settings** > **Integrations**, open **Amazon Web Services** and click **Set up**. To edit saved settings, choose **Connection Settings** from the connection’s menu.
3.  In “Role ARN,” enter the IAM role ARN, then click **Save**.
4.  Confirm the “Amazon Web Services connected” notification. Reopen **Connection Settings** and confirm the saved role ARN.
5.  Start a controlled factory run using an agent whose runtime includes the AWS CLI. Ask it to run `aws sts get-caller-identity` and report whether the returned role and account match the authorized test account. Don’t print tokens or credentials.

Saving confirms the configuration, not cloud access. If the read-only check fails, review the role’s trust conditions and permissions; don’t broaden the trust policy to bypass a mismatch.

### Configure GCP for a factory

1.  In Google Cloud, create or reuse a [Workload Identity Pool and Provider](#step-1-create-a-workload-identity-pool-and-provider) and configure [IAM policies](#step-2-configure-iam-policies) for the resources the factory needs. Keep the Warp team restriction on the provider.
2.  In the factory’s **Settings** > **Integrations**, open **Google Cloud** and click **Set up**. To edit saved settings, choose **Connection Settings** from the connection’s menu.
3.  Enter “Project number,” “Workload Identity Federation pool ID,” and “Workload Identity Federation provider ID” for the pool you configured.
4.  Leave “Service account to impersonate (optional)” empty for direct federated access. If your cloud administrator configured service account impersonation, enter that service account’s email. Click **Save**.
5.  Confirm the “Google Cloud connected” notification. Reopen **Connection Settings** and confirm the saved values.
6.  Start a controlled factory run using an agent whose runtime includes `gcloud`. Ask it to perform a non-mutating operation permitted by the test account’s policy, such as listing Compute Engine instances when you granted the viewer role in the [IAM example](#step-2-configure-iam-policies). Confirm the result belongs to the authorized test project. Don’t print access tokens or credential files.

If saving succeeds but the access check fails, confirm the project number, pool, provider, attribute condition, and IAM grant. An optional service account email doesn’t itself grant permission to impersonate that account.

* * *

## AWS

### Step 1: Create an OIDC identity provider

The first step is to configure your AWS account to trust OIDC tokens produced by the Automation Platform.

1.  Open the [AWS IAM console](https://console.aws.amazon.com/iam).
2.  Click **Identity Providers**, then click **Add provider**.
3.  Set the provider type to **OpenID Connect**.
4.  Set the **Provider URL** to `https://app.warp.dev`.
5.  Set the **Audience** to `sts.amazonaws.com`.
6.  Copy the ARN of the new identity provider, which will look like: `arn:aws:iam::<account-id>:oidc-provider/app.warp.dev`.

Note

Verify that the provider was created correctly by:

1.  Clicking on the `app.warp.dev` link in the list of identity providers.
2.  Clicking on **Endpoint verification**
3.  Checking that the thumbprint is `08745487e891c19e3078c1f2a07e452950ef36f6`

* * *

### Step 2: Configure an IAM role

Next, you will need to set up an AWS IAM role with a trust policy that links it to the OIDC provider.

1.  Open the [AWS IAM console](https://console.aws.amazon.com/iam).
2.  Click **Roles**, then click **Create role**.
3.  Select **Custom trust policy**, and fill in the following JSON trust policy:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowOzFederation",
      "Effect": "Allow",
      "Principal": {
        "Federated": "<oidc-provider-arn>"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "app.warp.dev:aud": "sts.amazonaws.com"
        },
        "StringLike": {
          "app.warp.dev:sub": "scoped_principal:<team-uid>/*"
        }
      }
    }
  ]
}
```

You will need to replace:

-   `<oidc-provider-arn>` with the ARN of the OIDC provider added in Step 1.
-   `<team-uid>` with your Warp team UID. This is the last component of your [Admin Panel](https://docs.warp.dev/enterprise/team-management/admin-panel/) URL. For example, if the Admin Panel URL is `https://app.warp.dev/admin/abc123def456`, your team UID would be `abc123def456`. You can also get your team UID from the `oz whoami` command.

The example above uses `StringLike` with the `scoped_principal:<team-uid>/*` pattern to allow any user or automation on your team to assume the role. See [the subject claim](#subject-sub) for the full format of `app.warp.dev:sub`.

To restrict the role to a specific user, use `StringEquals` with the fully qualified subject:

```json
...
"Condition": {
  "StringEquals": {
    "app.warp.dev:aud": "sts.amazonaws.com",
    "app.warp.dev:sub": "scoped_principal:<team-uid>/user:<user-uid>"
  }
}
...
```

To allow multiple specific principals, use a list of subjects:

```json
...
"Condition": {
  "StringEquals": {
    "app.warp.dev:aud": "sts.amazonaws.com",
    "app.warp.dev:sub": [
      "scoped_principal:<team-uid>/user:<user-uid-1>",
      "scoped_principal:<team-uid>/user:<user-uid-2>",
      "scoped_principal:<team-uid>/service_account:<sa-uid>"
    ]
  }
}
...
```

4.  Click **Next** and add permissions policies. These policies determine what agents can access in your AWS account.
5.  Click **Next** and enter a role name and optional description.
6.  Click **Create role**, then open the role and note down the role ARN. This will be of the form `arn:aws:iam::<account-id>:role/<role-name>`.

* * *

### Step 3: Enable AWS federation in your cloud agent environment

For standalone runs, configure the cloud agent environment to use your new AWS role. For a factory’s default environment, use [factory AWS settings](#configure-aws-for-a-factory) instead.

1.  Open the [Oz web app](https://oz.warp.dev).
2.  Create or edit an environment. See [Environments](https://docs.warp.dev/platform/oz-web-app/#environments) for instructions.
3.  Expand the **AWS** section and enter the AWS role ARN from Step 2.
4.  Save the environment.

Caution

Standalone environment AWS federation is configured in the Oz web app, not the CLI.

Agents running in this environment will now automatically assume the configured role when using the `aws` CLI or a compatible SDK.

Note

The Automation Platform uses the [**Assume role with web identity**](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html#cli-configure-role-oidc) AWS authentication mechanism. The following environment variables are set while the agent is running:

-   `AWS_ROLE_ARN`: the ARN of the role configured above
-   `AWS_WEB_IDENTITY_TOKEN_FILE`: the path to a temporary file containing the agent’s Automation Platform OIDC token
-   `AWS_ROLE_SESSION_NAME`: a derived session name, of the form `Oz_Run_<run-id>`.

* * *

## GCP

### Step 1: Create a Workload Identity Pool and Provider

The Automation Platform GCP integration uses [Workload Identity Federation](https://docs.cloud.google.com/iam/docs/workload-identity-federation). You will need to configure a pool and provider to trust OIDC tokens produced by the Automation Platform.

These instructions use the `gcloud` tool. You can also follow the OIDC instructions in [Configure Workload Identity Federation with other identity providers](https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-other-providers) to use the GCP console or Terraform.

1.  Create a Workload Identity Pool using the `gcloud` CLI:

```bash
gcloud iam workload-identity-pools create "<pool-id>" --location=global
```

Replace `<pool-id>` with the desired identifier for your pool, such as `oz-agent-pool`.

2.  Create a Provider within the pool:

```bash
gcloud iam workload-identity-pools providers create-oidc \
    "<provider-id>" \
    --location=global \
    "--workload-identity-pool=<pool-id>" \
    --issuer-uri="https://app.warp.dev" \
    "--attribute-mapping=google.subject=assertion.sub,google.groups=assertion.teams,attribute.environment=assertion.environment" \
    "--attribute-condition='<team-uid>' in assertion.teams"
```

Replace `<pool-id>` with the ID you used above, and `<provider-id>` with the desired identifier for your provider, such as `oz-oidc-provider`.

Replace `<team-uid>` with the UID of your Warp team. This is the last component of your [Admin Panel](https://docs.warp.dev/enterprise/team-management/admin-panel/) URL. For example, if the admin panel URL is `https://app.warp.dev/admin/abc123def456`, your team UID would be `abc123def456`.

Caution

If you do not set an attribute condition, then *any cloud agent* will be able to use your Workload Identity Federation provider, even if it does not belong to your team.

### Step 2: Configure IAM policies

You will need to configure IAM policies in GCP that allow agents in the Workload Identity Federation pool access to resources.

To give all agents on your team read-only access to all Compute Engine resources in a project, for example, you would run:

```bash
gcloud projects add-iam-policy-binding <project-id> \
    --member "principalSet://iam.googleapis.com/projects/<project-number>/locations/global/workloadIdentityPools/<pool-id>/group/<team-uid>" \
    --role "roles/compute.viewer"
```

See [Workload Identity Federation principal types](https://docs.cloud.google.com/iam/docs/workload-identity-federation#principal-types) for the full syntax supported.

### Step 3: Enable Workload Identity Federation in your cloud agent environment

For standalone runs, configure the cloud agent environment to use your Workload Identity Federation provider. For a factory’s default environment, use [factory GCP settings](#configure-gcp-for-a-factory) instead.

1.  Open the [Oz web app](https://oz.warp.dev).
2.  Create or edit an environment. See [Environments](https://docs.warp.dev/platform/oz-web-app/#environments) for instructions.
3.  Expand the **GCP** section and enter the project number, pool ID, and provider ID from Step 1.
4.  Save the environment.

Caution

Standalone environment Workload Identity Federation is configured in the Oz web app, not the CLI.

Agents running in this environment will now automatically configure [Application Default Credentials](https://docs.cloud.google.com/docs/authentication/application-default-credentials) to use the configured pool. Both the `GOOGLE_APPLICATION_CREDENTIALS` and `CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE` environment variables are set, so both the `gcloud` CLI and official Google SDKs will use the Automation Platform federated credentials. The Automation Platform uses [**executable-sourced credentials**](https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-other-providers#create-credential-config) to configure ADC for automatic token rotation.

#### Automatic `gcloud` sign-in

Environment variables alone are enough for the Google SDKs, but `gcloud` reports no active account until it signs in through its own auth system, and some tooling depends on an active account. During provider setup, the Automation Platform therefore also runs `gcloud auth login` against the federated credential file so `gcloud` reports the federated identity as its active account.

This step is best-effort and never blocks the run:

-   **`gcloud` isn’t installed** - The Automation Platform skips the sign-in. The ADC environment variables still provide credentials to the Google SDKs.
-   **Sign-in fails or times out** - The Automation Platform logs the failure and continues. The ADC environment variables still work, so a run only loses the active-account convenience.

To confirm the account inside a run, use `gcloud auth list`.

## Other providers

To authenticate from the Automation Platform to another provider that supports OIDC federation, you can issue tokens directly.

Within the agent environment, use the `oz federate issue-token` command to produce an OIDC token with your provider as the audience:

```bash
oz federate issue-token --run-id "$OZ_RUN_ID" --audience AUDIENCE --output-format json
```

Cloud agent runs set `OZ_RUN_ID` to the current run’s ID. Replace `AUDIENCE` with the identifier expected by your provider.

See the [`oz federate issue-token` reference](https://docs.warp.dev/agents/cli/oz-cli/federate/#oz-federate-issue-token) for token lifetime and subject customization options.

You can then exchange this token for provider-specific credentials.

## OIDC token claims

All Automation Platform OIDC tokens include the following standard claims:

| Claim | Value |
| --- | --- |
| `iss` | The issuer, `https://app.warp.dev`. |
| `aud` | The intended recipient of the token. |
| `sub` | The subject, built from the selected subject template. |
| `iat` | The time the token was issued. |
| `nbf` | The time before which the token isn’t valid. |
| `exp` | The token expiration time. |
| `jti` | The unique token identifier. |

### Audience

The `aud` claim will reflect the default for your cloud provider. For AWS, this is always `sts.amazonaws.com`. For GCP, it is derived from the Workload Identity Federation provider, such as `https://iam.googleapis.com/projects/<project-number>/locations/global/workloadIdentityPools/<pool-id>/providers/<provider-id>`.

### Subject (`sub`)

The `sub` claim identifies the principal that an agent is executing as: a Warp user or a dedicated agent.

By default, the `sub` claim uses the format `<principal-type>:<principal-id>`:

-   `user:abc123def456`: Identifies a user with ID `abc123def456`
-   `service_account:abc123def456`: Identifies your autogenerated team account

Use [`--subject-template`](https://docs.warp.dev/agents/cli/oz-cli/federate/#subject-template-components) to include other available claims in `sub`.

When authenticating to AWS, the Automation Platform uses a different `sub` claim format because AWS trust policies can’t match on custom OIDC claims. The format above is prefixed with your team UID:

-   `scoped_principal:xyz789/user:abc123def456`: Identifies the user `abc123def456`, who is a member of team `xyz789`.
-   `scoped_principal:user:abc123def456`: Identifies the user `abc123def456`, who is not on any team.
-   `scoped_principal:xyz789/service_account:abc123def456`: Identifies the autogenerated account for team `xyz789`.

The `scoped_principal` component isn’t available for users who belong to multiple teams.

To get possible user ID values, use the `oz whoami` command:

```bash
oz whoami
User ID: abc123
Email: user@warp.dev
Team ID: xyz789
Team Name: My Team
```

You can also check the user IDs from past runs using the Warp Platform API:

```bash
curl https://app.warp.dev/api/v1/agent/runs -H "Authorization: Bearer $WARP_API_KEY"
{
    "runs": [
        {
            ...
            "creator": {
                "type": "user",
                "uid": "<user-id>",
                "display_name": "User Name",
                "email": "user@warp.dev"
            }
        }
    ]
}
```

### Principal claims

Tokens include claims that describe the user or agent:

-   `user`: the user’s UID. Included only for user tokens.
-   `service_account`: the service account UID. Included only for agent tokens.
-   `email`: the user’s email address. Included only for user tokens with an email address.
-   `teams`: the UIDs of the teams the principal belongs to. Users on multiple teams get multiple values, and users on no team don’t get this claim.
-   `factory_uid`: the factory UID. Included only for service agents belonging to a factory.
-   `agent_type`: the configured factory agent type. Included only for agent tokens with a configured agent type.

### Run claims

The following claims are derived from an agent run:

-   `run_id`: the unique identifier for the individual run. This is not suitable for configuring access, but is useful to log for debugging.
-   `environment`: the unique identifier for the agent’s [Environment](https://docs.warp.dev/factories/environments/).
-   `agent_name`: the configured agent name.
-   `skill_spec`: the canonical identifier for the skill, such as `github-org/github-repo:.warp/skills/skill-name/SKILL.md`.
-   `host`: the execution host. This is `warp` for Warp-hosted agents or the configured worker host for [self-hosted agents](https://docs.warp.dev/factories/self-hosting/).

### Example token

The following OIDC token references an agent running as a specific Warp user:

```json
// JWT Header
{
    "typ": "JWT",
    "alg": "ES256",
    "kid": "<example-key-id>"
}
// JWT Payload
{
    "aud": ["sts.amazonaws.com"],
    "sub": "user:<example-user-id>",
    "user": "<example-user-id>",
    "email": "user@warp.dev",
    "teams": ["<example-team-id>"],
    "run_id": "<example-id>",
    "environment": "<example-id>",
    "agent_name": "<example-name>",
    "skill_spec": "<example-spec>",
    "host": "warp",
    "iss": "https://app.warp.dev",
    "jti": "<example-id>",
    "exp": 1775210175,
    "iat": 1775206575,
    "nbf": 1775206575
}
```

## Related pages

-   [Environments for factory agents](https://docs.warp.dev/factories/environments/) - Choose factory defaults or an existing environment
-   [Configuring cloud agent environments](https://docs.warp.dev/factories/environments/configuring-environments/) - Manage standalone environments
