Documentation Index
Fetch the complete documentation index at: https://docs.crewai.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide configures AWS Secrets Manager as a secret provider using Workload Identity Federation: CrewAI Platform mints short-lived OIDC tokens, exchanges them for AWS credentials via STS, and reads your secrets — without a long-lived AWS access key being stored anywhere.Why this path: secrets are resolved at automation execution time, so rotated values propagate to the next kickoff with no re-deploy. If you only need static credentials and don’t care about rotation propagation, see the simpler AWS — static keys / AssumeRole guide.
How it works at runtime
- The deployment worker requests a fresh OIDC JWT from CrewAI Platform.
- The worker calls
sts:AssumeRoleWithWebIdentityon the IAM role you set up below, presenting the JWT. - AWS STS validates the JWT against CrewAI Platform’s public OIDC issuer (so your platform installation must be reachable from AWS), then returns short-lived AWS credentials.
- The worker uses those credentials to call
secretsmanager:GetSecretValue. - The fetched value is injected as the environment variable’s value for that automation kickoff.
Prerequisites
Before starting, make sure you have:
- The automation pod image must include CrewAI runtime version
1.14.5or later. - An AWS account with permission to create IAM OIDC providers, IAM roles, and IAM policies.
- The AWS region where your secrets live (or will live), e.g.
us-east-1. - A CrewAI Platform organization where your user has the
workload_identity_configs: manageandsecret_providers: managepermissions. See Permissions (RBAC). - Your CrewAI organization UUID. Find it on the organization’s settings page in CrewAI Platform — the trust policy in Step 3 binds the IAM role to this specific organization.
- Your CrewAI Platform installation must be reachable from AWS over HTTPS so that AWS STS can fetch the OIDC discovery document and JWKS during token validation. Confirm with your platform administrator that the host is internet-accessible (or that AWS has network reach to it via VPC peering / equivalent).
Step 1 — Find Your CrewAI Platform OIDC Issuer URL
Your CrewAI Platform installation publishes an OpenID Connect discovery document athttps://<your-platform-host>/.well-known/openid-configuration. The issuer field in that document is the URL AWS will register as a trusted OIDC provider.
Open the URL in a browser (replacing <your-platform-host> with your actual hostname, e.g. app.crewai.com):
issuer — you’ll use it in Step 3.
Step 2 — Register CrewAI Platform as an IAM OIDC Identity Provider
Open the IAM → Identity providers console and click Add provider.- Provider type: OpenID Connect.
- Provider URL: the
issuervalue from Step 1 (e.g.https://app.crewai.com). - Audience:
sts.amazonaws.com
AWS does not actually validate the thumbprint for STS WebIdentity calls — it always re-fetches the JWKS at validation time — but the API requires the field to be present.
Step 3 — Create the IAM Role
Save astrust-policy.json, replacing <YOUR_ACCOUNT_ID>, <your-platform-host> (the issuer host without https:// or http://, e.g. app.crewai.com), and <YOUR_CREWAI_ORG_UUID> (from the Prerequisites):
aws_role_arn. You’ll paste it into CrewAI Platform in Step 6.
Step 4 — Create and attach the IAM policy for Secrets Manager + KMS access
Save assecrets-policy.json, replacing the placeholders with your account ID, region, secret-name prefix, and the KMS key ARN(s) that encrypt those secrets:
SecretsManagerListForUI powers the Secret Name autocomplete in the Environment Variables form and the Test Connection button on the credential. secretsmanager:ListSecrets only accepts Resource: "*" — it is account-scoped at the IAM layer.
Attach the policy to the role using either the CLI (inline policy, simplest) or the console UI; for environments that reuse the same permissions across many roles, use the Managed policy tab for a reusable, named policy.
- Inline policy (CLI)
- Managed policy (CLI, reusable)
- Console (UI)
Step 5 — Create at Least One Secret in AWS
If you don’t already have a secret to test against, create one now:Step 6 — Add a Workload Identity Configuration in CrewAI Platform
In CrewAI Platform, navigate to Settings → Workload Identity and click Add Workload Identity Config. Fill the form:- Name: A descriptive name, e.g.
aws-prod. - Cloud Provider:
AWS. - AWS Role ARN: the Role Arn from Step 3.
- AWS Region: the region where your secrets live, e.g.
us-east-1. - (Optional) Check Set as default for AWS if you’d like this WI config to be the default selected when creating an AWS-backed secret credential.
Step 7 — Add a Secret Provider Credential Bound to the WI Config
Navigate to Settings → Secret Provider Credentials and click Add Credential. Fill the form:- Name: A descriptive name, e.g.
aws-prod-wi. - Provider:
AWS Secrets Manager. - Authentication Method:
Workload Identity(instead of static keys / AssumeRole). - Workload Identity Configuration: select the config you created in Step 6 (e.g.
aws-prod). - (Optional) Check Set as default credential for this provider.
Step 8 — Test the Connection
After saving the credential, click Test Connection. For workload-identity credentials this verifies the OIDC handshake: CrewAI Platform mints a JWT, exchanges it with AWS STS viasts:AssumeRoleWithWebIdentity, and confirms the resulting credentials can call sts:GetCallerIdentity against the assumed role. A green result means the federation binding is healthy.
A successful Test Connection proves the trust policy, OIDC provider registration, and audience condition are all wired correctly. It does not prove per-secret IAM is correct — secretsmanager:GetSecretValue on a specific secret ARN is exercised separately when an environment variable resolves at kickoff. See Troubleshooting for handshake failure modes.
Step 9 — Reference the Secret in an Environment Variable
Now reference the secret on an automation, exactly as you would for any other Secrets Manager-backed env var. See Using the Secrets Manager for the form fields and behavior. The only difference between WI-backed and static-keys-backed env vars is when the secret is read:- WI-backed: secret value is read fresh on every automation kickoff.
- Static-keys-backed: secret value is read at deploy time and baked into the deployment image.
Step 10 — Verify Rotation
After the deployment is running, rotate the secret in AWS:"rotated value" — no re-deploy, no worker restart, no waiting on a TTL.
To confirm in logs (if you have access to the worker), look for:
GetSecretValue call against AWS.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Test Connection fails with a handshake error | The sts:AssumeRoleWithWebIdentity call was rejected. Verify the trust policy’s federated principal ARN references oidc-provider/<your-platform-host> (host without https:// or http://, no trailing slash), the audience condition is exactly sts.amazonaws.com, the sub condition matches your CrewAI organization UUID, and the platform’s OIDC discovery URL is reachable from AWS over the public internet. |
InvalidIdentityToken: Couldn't retrieve verification key from your identity provider | AWS STS can’t reach your CrewAI Platform host to fetch JWKS. Confirm the host is internet-accessible from AWS, the OIDC discovery URL returns 200, and the JWKS endpoint is reachable. |
AccessDenied: Not authorized to perform sts:AssumeRoleWithWebIdentity | Trust policy mismatch. Re-check Step 3: the federated principal ARN must include oidc-provider/<your-platform-host> (host without https:// or http://, no trailing slash), the audience condition must be exactly sts.amazonaws.com, and the sub condition must equal organization:<YOUR_CREWAI_ORG_UUID>. |
Secret Name autocomplete shows AccessDenied: secretsmanager:ListSecrets | The role is missing secretsmanager:ListSecrets with Resource: "*". Add the SecretsManagerListForUI statement from Step 4. |
| Kickoff fails to resolve a secret even though Test Connection passes | The WI binding is healthy, but resource-scoped IAM is missing on the failing secret. Audit the role’s secretsmanager:GetSecretValue and kms:Decrypt permissions for that specific secret’s ARN and KMS key. |
RegionDisabledException / no secrets found | The region in the Workload Identity Config doesn’t match where the secret lives. Re-check Step 6. |
| Rotated value isn’t picked up on the next kickoff | Confirm the env var on the automation is referencing a Workload Identity-backed credential (not a static-keys credential). The static path bakes values into the deploy image. |
Reference Links
- AWS: Creating OpenID Connect (OIDC) identity providers
- AWS: Configuring a role for OpenID Connect federation
- AWS: STS:AssumeRoleWithWebIdentity API reference
Next Steps
- Use secrets in environment variables and manage permissions
- For multi-cloud, see also GCP Workload Identity Federation and Azure Workload Identity Federation.
