All environment variables that Baton uses for server configuration.
Server Configuration
| Variable | Default | Description |
|---|
PORT | 3100 | Server port |
HOST | 127.0.0.1 | Server host binding |
DATABASE_URL | (embedded) | PostgreSQL connection string |
BATON_HOME | ~/.baton | Base directory for all Baton data |
BATON_INSTANCE_ID | default | Instance identifier (for multiple local instances) |
BATON_DEPLOYMENT_MODE | local_trusted | Runtime mode override |
Secrets
| Variable | Default | Description |
|---|
BATON_SECRETS_MASTER_KEY | (from file) | 32-byte encryption key (base64/hex/raw) |
BATON_SECRETS_MASTER_KEY_FILE | ~/.baton/.../secrets/master.key | Path to key file |
BATON_SECRETS_STRICT_MODE | false | Require secret refs for sensitive env vars |
Agent Runtime (Injected into agent processes)
These are set automatically by the server when invoking agents:
| Variable | Description |
|---|
BATON_AGENT_ID | Agent's unique ID |
BATON_COMPANY_ID | Company ID |
BATON_API_URL | Baton API base URL |
BATON_API_KEY | Short-lived JWT for API auth |
BATON_RUN_ID | Current heartbeat run ID |
BATON_TASK_ID | Issue that triggered this wake |
BATON_WAKE_REASON | Wake trigger reason |
BATON_WAKE_COMMENT_ID | Comment that triggered this wake |
BATON_APPROVAL_ID | Resolved approval ID |
BATON_APPROVAL_STATUS | Approval decision |
BATON_LINKED_ISSUE_IDS | Comma-separated linked issue IDs |
LLM Provider Keys (for adapters)
| Variable | Description |
|---|
ANTHROPIC_API_KEY | Anthropic API key (for Claude Local adapter) |
OPENAI_API_KEY | OpenAI API key (for Codex Local adapter) |