polyclaw v5.0.0

Configuration

Polyclaw is configured through environment variables loaded from a .env file or the system environment. The configuration singleton is defined in app/runtime/config/settings.py.

Core Settings

VariableDefaultDescription
COPILOT_MODELgpt-4.1Default LLM model for conversations
COPILOT_AGENTOptional Copilot agent name
ADMIN_PORT9090Admin server listen port
ADMIN_SECRETBearer token for API authentication. Supports @kv: prefix.
POLYCLAW_DATA_DIR~/.polyclawRoot directory for all persistent data
DOTENV_PATHCustom path to .env file
POLYCLAW_SERVER_MODEcombinedServer mode: combined, admin, or runtime

Foundry (BYOK)

When FOUNDRY_ENDPOINT is set, Polyclaw operates in Bring Your Own Key (BYOK) mode. The agent uses your Azure AI Services resource directly instead of the GitHub Copilot SDK backend. Authentication is handled via az account get-access-token with Entra ID bearer tokens.

VariableDefaultDescription
FOUNDRY_ENDPOINTAzure AI Services endpoint (e.g. https://<name>.cognitiveservices.azure.com/). Enables BYOK mode when set.
FOUNDRY_NAMEDisplay name of the Foundry resource
FOUNDRY_RESOURCE_GROUPResource group containing the Foundry resource

Bot Framework

VariableDefaultDescription
BOT_APP_IDAzure Bot registration app ID
BOT_APP_PASSWORDAzure Bot app secret. Supports @kv: prefix.
BOT_APP_TENANT_IDAzure AD tenant ID
BOT_PORT3978Bot Framework endpoint port

Voice / Azure Communication Services

VariableDefaultDescription
ACS_CONNECTION_STRINGAzure Communication Services connection string. Supports @kv: prefix.
ACS_SOURCE_NUMBERACS phone number for outbound calls
ACS_CALLBACK_TOKENAuto-generatedToken securing the ACS callback webhook. Auto-generated if not set.
VOICE_TARGET_NUMBERDefault target phone number
AZURE_OPENAI_ENDPOINTAzure OpenAI endpoint for realtime model
AZURE_OPENAI_API_KEYAzure OpenAI API key. Supports @kv: prefix.
AZURE_OPENAI_REALTIME_DEPLOYMENTgpt-realtime-miniRealtime model deployment name

Memory

VariableDefaultDescription
MEMORY_MODELgpt-4.1Model used for memory consolidation
MEMORY_IDLE_MINUTES5Minutes of inactivity before memory formation triggers

Proactive Messaging

VariableDefaultDescription
PROACTIVE_ENABLEDfalseEnable autonomous proactive messaging

Security

VariableDefaultDescription
LOCKDOWN_MODE(Experimental) Reject all admin API requests. Any non-empty value enables this mode. Web UI toggle and terminal recovery are not yet fully implemented.
TUNNEL_RESTRICTEDRestrict tunnel to bot/voice endpoints only. Any non-empty value enables this mode.
TELEGRAM_WHITELISTComma-separated allowed Telegram user IDs

Azure Key Vault

VariableDefaultDescription
KEY_VAULT_URLFull Key Vault URL (https://<name>.vault.azure.net)
KEY_VAULT_NAMEKey Vault name, used for firewall allowlisting CLI commands
KEY_VAULT_RGKey Vault resource group

Derived Paths

All paths are computed relative to POLYCLAW_DATA_DIR:

PathDescription
media_dir<data>/media/incoming/, outgoing/pending/, outgoing/sent/, outgoing/error/
memory_dir<data>/memory/ – daily logs, topic notes
skills_dir<data>/skills/ – user and plugin skill directories
sessions_dir<data>/sessions/ – archived chat sessions
soul_path<data>/SOUL.md – agent personality
scheduler_db_path<data>/scheduler.json – scheduled tasks
conversation_refs_path<data>/conversation_refs.json – stored conversation references

Secret Resolution

The following environment variables support @kv: prefix resolution from Azure Key Vault: ADMIN_SECRET, BOT_APP_PASSWORD, ACS_CONNECTION_STRING, AZURE_OPENAI_API_KEY. The Docker entrypoint additionally resolves all @kv: prefixed variables via a shell-level pass.

For example:

ADMIN_SECRET=@kv:polyclaw-admin-secret
BOT_APP_PASSWORD=@kv:polyclaw-bot-password

This requires KEY_VAULT_URL to be set and valid Azure credentials (via az login or managed identity).

See Key Vault Integration for details.