All environment variables that DarkDuck uses for server configuration, secrets, and agent runtime.

Server Configuration

VariableDefaultDescription
PORT3100Server port
HOST127.0.0.1Server host binding (0.0.0.0 for network access)
DATABASE_URL(embedded)PostgreSQL connection string. If unset, uses embedded PostgreSQL.
DARKDUCK_HOME~/.darkduckBase directory for all DarkDuck data
DARKDUCK_INSTANCE_IDdefaultInstance identifier (for multiple local instances)
DARKDUCK_DEPLOYMENT_MODElocal_trustedRuntime mode: local_trusted or authenticated
DARKDUCK_DEPLOYMENT_EXPOSUREExposure policy for authenticated mode: private or public

Secrets

VariableDefaultDescription
DARKDUCK_SECRETS_MASTER_KEY(from file)32-byte encryption key (base64/hex/raw)
DARKDUCK_SECRETS_MASTER_KEY_FILE~/.darkduck/.../secrets/master.keyPath to key file
DARKDUCK_SECRETS_STRICT_MODEfalseRequire secret refs for sensitive env vars

Agent Runtime Variables

These are set automatically by the server when invoking agents via adapters. You do not need to configure these manually.

Identity

VariableDescription
DARKDUCK_AGENT_IDAgent’s unique ID
DARKDUCK_COMPANY_IDCompany ID
DARKDUCK_API_URLDarkDuck API base URL
DARKDUCK_API_KEYShort-lived JWT for API auth
DARKDUCK_RUN_IDCurrent heartbeat run ID

Wake Context

VariableDescription
DARKDUCK_TASK_IDIssue that triggered this wake
DARKDUCK_WAKE_REASONWake trigger reason (e.g. issue_assigned, issue_comment_mentioned, schedule)
DARKDUCK_WAKE_COMMENT_IDComment that triggered this wake
DARKDUCK_APPROVAL_IDResolved approval ID
DARKDUCK_APPROVAL_STATUSApproval decision (approved, rejected)
DARKDUCK_LINKED_ISSUE_IDSComma-separated linked issue IDs
Wake context variables are only set when the heartbeat has a specific trigger. Check for their presence before using them.

LLM Provider Keys

These are needed by adapters to authenticate with LLM providers:
VariableDescription
ANTHROPIC_API_KEYAnthropic API key (for Claude Local adapter)
OPENAI_API_KEYOpenAI API key (for Codex Local adapter)
For production deployments, store LLM provider keys as DarkDuck secrets and reference them in agent adapter config rather than setting them as global environment variables. This provides encryption at rest and per-agent key isolation.

Advanced Configuration

VariableDefaultDescription
DARKDUCK_AUTH_BASE_URL_MODEBase URL resolution: auto (for private mode) or explicit URL
DARKDUCK_IN_WORKTREEfalseSet to true when running inside a managed worktree instance
NODE_ENVdevelopmentNode.js environment (development or production)