Environment variables
| Variable | Used by | Default |
|---|---|---|
CUSTODIAN_SDK_API_KEY | Python & TypeScript SDKs | — |
CUSTODIAN_SDK_BASE_URL | SDKs — Platform API host | https://platform.custodianlabs.io/v1 |
CUSTODIAN_MASKING_BASE_URL | SDKs — Guardian Layer host | https://privacy.custodianlabs.io |
CUSTODIAN_API_KEY | curl examples for the Platform API and Guardian Layer API | — |
The SDK key and the raw-API key are the same key — the two names just reflect different code. Guardian Layer and the Platform API both accept it.
Connected apps
Optional. Read by the SDK on your machine or backend when you connect an app without
passing values in code. The SDK sends them to Custodian on deploy(), where they're stored
encrypted with that agent. Never set them on a shared server for other people's agents.
| Variable | Used by | Read by |
|---|---|---|
CUSTODIAN_SLACK_BOT_TOKEN | Python & TypeScript SDKs — Connect Slack | with_slack_credential() / withSlackCredential() |
CUSTODIAN_SLACK_DEFAULT_CHANNEL | Python & TypeScript SDKs — optional default channel ID (C0123ABCD) | with_slack_credential() / withSlackCredential() |
Legacy aliases (still read)
AI_SDK_API_KEY → CUSTODIAN_SDK_API_KEY · AI_SDK_BASE_URL → CUSTODIAN_SDK_BASE_URL ·
GUARDIAN_LAYER_BASE_URL → CUSTODIAN_MASKING_BASE_URL
Notes
Backend / secret manager only — never browser code or commits. Restart the app after
changing a value; the SDKs don't load .env files themselves.
See also
SDK install and authentication · MCP authentication · Use API keys securely