Environment Variables

Environment Variables

All environment variables across TAP components. On managed hosting, environment variables are configured in the dashboard. These are only needed for self-hosted deployments.

Proxy (Required)

VariableDescription
AGENTSEC_ENCRYPTION_KEY64 hex chars (32 bytes). Used for HMAC-SHA256 agent key hashing and AES-256-GCM credential encryption. Generate with openssl rand -hex 32
TELEGRAM_BOT_TOKENTelegram bot token from @BotFather

Proxy (Optional)

VariableDefaultDescription
TELEGRAM_CHAT_IDDefault Telegram chat ID for approval messages. Teams can configure their own via the admin API
AGENTSEC_DB_PATH./agentsec.dbPath to the SQLite database
AGENTSEC_AUDIT_LOG./audit.jsonlPath to audit log file
AGENTSEC_LISTEN_ADDR0.0.0.0:3100Listen address
AGENTSEC_FORWARD_TIMEOUT_SECS30Timeout for upstream API requests (seconds)
AGENTSEC_APPROVAL_TIMEOUT_SECS300Timeout waiting for human approval (seconds)
AGENTSEC_CACHE_TTL_SECS30Cache TTL for DB lookups (seconds)

Stripe Billing (Managed Hosting)

Required only if you are running managed hosting with Stripe subscriptions. Not needed for self-hosted deployments.

VariableDescription
STRIPE_SECRET_KEYStripe secret API key (starts with sk_live_ or sk_test_)
STRIPE_WEBHOOK_SECRETWebhook signing secret from Stripe Dashboard (starts with whsec_)
STRIPE_PRICE_STARTERStripe Price ID for the Starter tier (starts with price_)
STRIPE_PRICE_PROStripe Price ID for the Pro tier (starts with price_)
AGENTSEC_BASE_URLBase URL for Stripe redirect URLs (default: https://toolsec.org)

WebAuthn (Optional)

For passkey-based approval (Face ID, fingerprint, YubiKey):

VariableDescription
WEBAUTHN_RP_IDRelying party ID (e.g., toolsec.org)
WEBAUTHN_RP_ORIGINRelying party origin (e.g., https://proxy.toolsec.org)
WEBAUTHN_BASE_URLBase URL for WebAuthn endpoints

OAuth 1.0a Signer (Per-Credential)

VariableDescription
OAUTH_CRED_{NAME}_CONSUMER_KEYOAuth consumer key
OAUTH_CRED_{NAME}_CONSUMER_SECRETOAuth consumer secret
OAUTH_CRED_{NAME}_ACCESS_TOKENOAuth access token
OAUTH_CRED_{NAME}_ACCESS_TOKEN_SECRETOAuth access token secret

Example: Credential twitter uses OAUTH_CRED_TWITTER_CONSUMER_KEY, etc.

The signer auto-discovers credentials by scanning for OAUTH_CRED_*_CONSUMER_KEY env vars at startup.

OAuth 1.0a Signer (Optional)

VariableDefaultDescription
OAUTH_SIGNER_PORT8080Signer listen port

Naming Convention

For AGENTSEC_CRED_* environment variables (used during migration from env-based setup):

  1. Take the credential name (e.g., twitter-holonym)
  2. Convert to uppercase (TWITTER-HOLONYM)
  3. Replace hyphens with underscores (TWITTER_HOLONYM)
  4. Prepend the prefix (AGENTSEC_CRED_TWITTER_HOLONYM)

Note: In the current multi-tenant architecture, credential values are stored encrypted in the SQLite database via the admin API. The AGENTSEC_CRED_* env var pattern is only relevant for the CLI add command in self-hosted setups.