Skip to main content

Environment variables

VariableUsed byDefault
CUSTODIAN_SDK_API_KEYPython & TypeScript SDKs—
CUSTODIAN_SDK_BASE_URLSDKs — Platform API hosthttps://platform.custodianlabs.io/v1
CUSTODIAN_MASKING_BASE_URLSDKs — Guardian Layer hosthttps://privacy.custodianlabs.io
CUSTODIAN_API_KEYcurl 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.

VariableUsed byRead by
CUSTODIAN_SLACK_BOT_TOKENPython & TypeScript SDKs — Connect Slackwith_slack_credential() / withSlackCredential()
CUSTODIAN_SLACK_DEFAULT_CHANNELPython & 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