Skip to content

Environment Variables

OpenParallax uses two categories of environment variables: third-party API keys (standard names, shared with other tools) and OpenParallax-specific variables (prefixed with OP_).

Third-Party API Keys

These use standard names so you don't need to duplicate credentials already in your shell profile. OpenParallax reads them but doesn't own the naming convention.

VariablePurposeRequired?
ANTHROPIC_API_KEYAnthropic Claude API keyIf using Anthropic for chat or shield
OPENAI_API_KEYOpenAI API key (chat, embeddings)If using OpenAI for chat, shield, or embeddings
GOOGLE_AI_API_KEYGoogle Gemini API keyIf using Google for chat or shield

These variables are referenced by config.yaml through the api_key_env field. You can use any variable name — the config just says "read the key from this env var":

yaml
models:
  - name: chat
    provider: anthropic
    model: claude-sonnet-4-6
    api_key_env: MY_CUSTOM_KEY_VAR  # reads $MY_CUSTOM_KEY_VAR at runtime

OpenParallax Variables (OP_*)

All OpenParallax-specific environment variables use the OP_ prefix to avoid collisions with other tools.

Core

VariableTypeDefaultDescription
OP_DATA_DIRpath~/.openparallaxRoot data directory. All workspaces, models, and global config live under this path.
OP_WORKSPACEpathOverride the workspace path for the current session. When set, OpenParallax uses this directory instead of resolving from the agent name.
OP_LOG_LEVELstringinfoLogging level. One of: debug, info, warn, error. Affects engine.log verbosity.
OP_NO_COLORboolfalseDisable colored output in CLI. Set to 1 or true. Respected by both the CLI and the Bubbletea TUI.

Web Server

VariableTypeDefaultDescription
OP_WEB_PORTintOverride the web server port. Takes precedence over config.yaml. Useful for running multiple agents or in CI.
OP_WEB_HOSTstringOverride the web server bind address.

Shield

VariableTypeDefaultDescription
OP_SHIELD_POLICYpathOverride the policy file path. Takes precedence over config.yaml.
OP_SHIELD_CLASSIFIER_DIRpath~/.openparallax/models/prompt-injectionDirectory containing the ONNX classifier model, tokenizer, and runtime library.

gRPC

VariableTypeDefaultDescription
OP_GRPC_PORTintOverride the gRPC server port. By default, the engine allocates a dynamic port and communicates it to the process manager via stdout.

Development

VariableTypeDefaultDescription
OP_NO_SANDBOXboolfalseDisable kernel sandboxing. Development only. When set, the agent starts without sandbox restrictions. Canary probes are skipped. Never use in production — it removes a critical security layer.

Channel Credentials

Channel adapters read credentials from environment variables specified in config.yaml:

Variable (conventional)PlatformDescription
WHATSAPP_ACCESS_TOKENWhatsAppMeta Cloud API access token
TELEGRAM_BOT_TOKENTelegramBot token from BotFather
DISCORD_BOT_TOKENDiscordBot token from Developer Portal
SLACK_BOT_TOKENSlackBot OAuth token
SLACK_SIGNING_SECRETSlackRequest signing secret
SLACK_APP_TOKENSlackApp-level token for Socket Mode
TEAMS_APP_PASSWORDTeamsApp password from Azure AD

These are conventional names — you can use any variable name by changing api_key_env or the equivalent field in config.yaml.

Precedence

When a value is specified in multiple places, this precedence applies (highest to lowest):

  1. Environment variable (OP_* override)
  2. config.yaml (workspace-level)
  3. Built-in default

For example, if config.yaml sets web.port: 3100 but OP_WEB_PORT=3200 is set, the server binds to port 3200.

Shell Profile Setup

Add your API keys to your shell profile for persistence:

bash
# ~/.bashrc or ~/.zshrc

# LLM API keys
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export GOOGLE_AI_API_KEY="AI..."

# OpenParallax (optional overrides)
export OP_LOG_LEVEL="info"
export OP_DATA_DIR="$HOME/.openparallax"

Security

API keys are read from environment variables, never stored in config.yaml. The config file only stores the name of the environment variable (api_key_env: ANTHROPIC_API_KEY), not the key itself. This means config.yaml is safe to commit or share — it contains no secrets.

Internal Variables

These are set automatically at runtime and should not be configured manually:

VariablePurpose
OPENPARALLAX_AGENT_TOKENEphemeral auth token for Agent → Engine gRPC. Generated per spawn.
OPENPARALLAX_SUB_AGENT_TOKENEphemeral auth token for Sub-Agent → Engine gRPC. Generated per spawn.