Quick Setup
The
infra/secrets/ directory is excluded from version control (see .gitignore). Treat these files with the same security as passwords.API Keys
Required
| Service | Get Key At | Used For |
|---|---|---|
| OpenAI | platform.openai.com/api-keys | All agents |
Optional
| Service | Get Key At | Used For |
|---|---|---|
| Exa | dashboard.exa.ai | Pal research feature |
Set your keys
Editinfra/secrets/prd_api_secrets.yml:
infra/secrets/prd_api_secrets.yml
Verify keys work
Before deploying, test that your keys are valid:Database Credentials
Editinfra/secrets/prd_db_secrets.yml:
infra/secrets/prd_db_secrets.yml
How credentials flow
| File | Variable | Becomes in App |
|---|---|---|
prd_db_secrets.yml | DB_USER | DB_USER |
prd_db_secrets.yml | DB_PASS | DB_PASS |
How Secrets Work
Local Development
Apps read secrets directly from YAML files:dev_resources.py
Production
Secrets are stored in AWS Secrets Manager and injected into ECS tasks:prd_resources.py
Why two secrets? API keys and database credentials are stored separately for security isolation. You can rotate one without affecting the other.
Verify Secrets in AWS
After deploying (ag infra up prd:aws), verify secrets were created:
If you changed
infra_name in settings.py, replace agentos-aws-template with your value.Troubleshooting
SecretNotFoundException
SecretNotFoundException
The secret doesn’t exist yet. Run
ag infra up prd:aws to create it from your YAML files.Database connection fails silently
Database connection fails silently
Check for special characters in
DB_PASS. Remove any @, #, %, & characters and redeploy.API key not working in production
API key not working in production
- Verify the key works locally (use the curl commands above)
- Check the secret was updated:
aws secretsmanager get-secret-value --secret-id {name} - Redeploy the task to pick up new secrets:
ag infra patch prd:aws:::service