Skip to content

Environment variables ​

Runtime environment variables for model connections, instance paths, and deployment. Run protoagent config explain to inspect resolved paths and settings provenance.

Model credentials ​

An API key is needed only when the selected endpoint requires one. Subscription connections use OAuth; local endpoints may be keyless.

VariableWhat
OPENAI_API_KEYKey for the legacy gateway connection synthesized when no providers: block exists. Explicit provider entries read their own keys from secrets.yaml.

External secrets manager (ADR 0080) ​

VariableDefaultWhat
INFISICAL_CLIENT_ID(unset)Universal-auth machine-identity client id — the env fallback for secrets_manager.client_id (secrets.yaml wins when present).
INFISICAL_CLIENT_SECRET(unset)Machine-identity client secret — env fallback for secrets_manager.client_secret.
PROTOAGENT_NO_SECRETS_HYDRATE(unset)Any non-empty value disables secrets-manager env hydration entirely (debugging escape hatch).

Identity ​

VariableDefaultWhat
AGENT_NAMEprotoagentShort slug. Used as the Prometheus metric prefix, Langfuse trace tag, and in log labels. Should match what you used when forking.
<AGENT_NAME>_API_KEY(unset — no auth)Expected value of the X-API-Key header if you want to require auth on /a2a and /v1/*. Uppercased, non-alphanumeric → underscore. e.g. MY_AGENT_API_KEY.

Paths & overrides ​

VariableDefaultWhat
PROTOAGENT_BOX_ROOT~/.protoagent, or /sandbox when presentMachine-shared root for host config, credentials, commons, and heartbeats.
PROTOAGENT_HOME<box_root>/<instance>Explicit instance root; takes precedence over the instance id for path selection. Config lives in its config/ directory and stores beneath the root.
PROTOAGENT_INSTANCEdefaultInstance id used to select <box_root>/<id> when PROTOAGENT_HOME is unset. Resolves from the environment, not YAML.
PROTOAGENT_HOST_CONFIG<box_root>/host-config.yamlOverride for the machine-shared config file.
PROTOAGENT_WORKSPACE<instance_root>/workspaceDefault root for fenced file and shell tools.
PROTOAGENT_PLUGINS_DIR<instance_root>/pluginsInstalled-plugin root; must be absolute.
PROTOAGENT_PLUGINS_LOCK<instance_root>/plugins.lockPlugin lockfile path.
PROTOAGENT_MODEL(unset)Overrides model.name on each load, including model sweeps.

PROTOAGENT_CONFIG_DIR is retained only for legacy migration; it no longer selects live runtime paths. See Run multiple instances.

Native OAuth subscription providers (ADR 0097) ​

VariableDefaultWhat
PROTOAGENT_CODEX_BASE_URLhttps://chatgpt.com/backend-api/codexEndpoint for model.provider: openai-codex. Changing it changes the issuer a captured reasoning blob is sealed to, so items minted against the old endpoint stop being replayed (by design — the new one can't decrypt them).
PROTOAGENT_CODEX_OUTPUT_VERSIONresponses/v1Escape hatch for the openai-codex content shape. responses/v1 keeps each reasoning item as its own content block, which is what makes cross-turn encrypted-reasoning replay possible. Set to v0 to fall back to the legacy string-content shape — the turn still works, but reasoning continuity across turns is off.

Deployment / UI tier (ADR 0010) ​

VariableDefaultWhat
PROTOAGENT_UIconsoleUI deployment tier (or --ui): console (React console at /app + API/A2A), none (API + A2A + /metrics only — the lean headless stack). full is a deprecated alias for console (the Gradio tier was removed; it logs a warning). The Docker image defaults to none.
PROTOAGENT_HOST127.0.0.1Bind address (or --host). Defaults to loopback so a local/desktop run isn't exposed on all interfaces — the operator/console API (/api/*, /api/chat, /v1/*) is otherwise reachable by anything that can hit the port. The container entrypoint + deploy manifests set 0.0.0.0 because their boundary is the published port + network policy, not the in-container bind. A single non-loopback IP (say, the tailnet address) is served together with 127.0.0.1, so the local console keeps working; if that IP isn't on the machine at startup, only 127.0.0.1 is served, with a warning. Binding non-loopback without an A2A auth token refuses to start unless PROTOAGENT_ALLOW_OPEN=1.
PROTOAGENT_CONSOLE_CSPreportHow the console page sends its Content-Security-Policy: report (the browser blocks nothing and reports what it would have blocked; each distinct report is logged once as [console-csp] would block: …), enforce, or off. Framing by other sites is refused in every mode.
PROTOAGENT_PUBLIC_CONSOLE_URLunsetFallback for network.public_console_url when the config doesn't set it: your own https:// origin for the console, for pairing a phone without Tailscale (guide). Validated at load (https, origin only, not loopback). With it set and no auth token the agent refuses to start, even with PROTOAGENT_ALLOW_OPEN=1. A hub doesn't pass it to the fleet members it spawns.
FORWARDED_ALLOW_IPSunsetFallback for network.trusted_proxies when the config doesn't set it: comma-separated proxy IPs/CIDRs whose X-Forwarded-* headers are believed. Loopback is always trusted.
PROTOAGENT_TAILSCALE_BIN(auto)Path to the tailscale CLI used for pairing addresses and Use HTTPS via Tailscale (phone access). Found on PATH, or inside Tailscale.app on macOS. Set it to an empty value to turn Tailscale discovery off.
PROTOAGENT_ALLOW_OPEN(unset)Set 1 to allow a non-loopback bind with no auth token — the boot gate otherwise refuses it, because the open operator API includes plugin install+enable (code execution) and config rewrite. Only opt in when a network boundary fences the port (the bundled compose publishes to 127.0.0.1 only and sets this; a k8s NetworkPolicy is the other intended case). The startup log still carries a security WARNING. It never allows a public console URL without a token.
PROTOAGENT_HEADLESS(unset)Deprecated alias for PROTOAGENT_UI=console (or --headless) — it still serves the React console; for no UI use PROTOAGENT_UI=none.
PROTOAGENT_HEADLESS_SETUP(unset)Set 1/true to auto-complete setup from a validated config even outside the none tier (no wizard). The none tier implies this.

Setup without the wizard: python -m server --setup validates the live config (resolved model endpoint and credentials, or a native subscription provider) and writes .setup-complete, then exits. In the none tier the server auto-completes the same way on boot, or fails fast if the config is invalid. Readiness is exposed at GET /healthz (503 until the graph compiles).

Fleet (ADR 0042) ​

The hub spawns local fleet members as detached --ui none processes on their own ports.

VariableDefaultPurpose
PROTOAGENT_FLEET_AUTOSTART(unset)Comma-separated member ids or display names the hub (re)starts on boot (ADR 0072) — a container recreate or host restart kills the members' detached processes and fleet.json keeps now-dead pids, so without this a declared crew stays down until re-activated by hand. The config key fleet.autostart: [id, …] is the durable form; this env var is the Docker/headless fallback, used only when the key is absent (an explicit [] means none — instances seeded before the template dropped autostart: [] must delete that line for the env var to apply). Idempotent (already-running members skipped), best-effort (a missing workspace is logged and skipped), and hub-only. The hub serves its console while the members boot in the background, three at a time; app.loaded fires once they are up. Pairs with the config-as-code deploy pattern — see the fleet guide.
PROTOAGENT_FLEET_KEEP_MEMBERS_ON_EXIT(unset)By default the hub spins its local members down when it shuts down ("host down → fleet down" — keeps a rebuilt hub from leaving members running stale code; sessions resume from their instance-scoped checkpoints on the next switch, so it stops processes, not work). Set 1/true to keep members running across a hub restart — for genuinely long-running detached agents.
PROTOAGENT_FLEET_MEMBER(unset)Set to 1 by the hub on every fleet member it spawns; you do not normally set it yourself. A member runs --ui none, which on its own defaults filesystem.allow_run to off (no operator to answer run_command's approval). The marker says the member is attended through the hub console, so run_command defaults on. An explicit filesystem.allow_run in the member's config still wins.
PROTOAGENT_FLEET_HUB_URL(set by the hub)The hub's own loopback address (http://127.0.0.1:<port>), exported by the hub at boot and inherited by the members it spawns; you do not normally set it yourself. A member uses it to hand its notices to the hub, which owns the operator's paired devices and sends the push (POST /api/fleet/notices). A member started without it keeps its notices local until it is restarted by the hub. Only a loopback http origin is honoured.
PROTOAGENT_FLEET_MAX_WARM0Keep-N-warm cap: at most this many members stay running; switching to another resumes it and evicts the least-recently-active beyond the cap (0/unset = unlimited).
PROTOAGENT_FLEET_WARM_GRACE0Seconds a just-active member is spared from keep-warm eviction (may be mid background turn); 0 = pure LRU.
PROTOAGENT_DISCOVERY_DISABLE(unset)Set 1/true to skip the automatic at-boot fleet-discovery sweep (local port-scan + mDNS browse + tailnet scan across the discovery port range). scripts/live_smoke.py sets this on its spawned server so an "isolated" smoke run never probes a co-located real protoAgent (#2651) — it does not affect manual discovery (GET /api/fleet/discover) or a directly-called discover()/boot_sweep().
PROTOAGENT_TRUSTED_HOSTS(unset)Comma-separated extra Host names an open instance (no bearer, no X-API-Key) is served under. An open instance answers only requests addressed to a name it recognizes, on every path and WebSocket (#3668; the fleet proxy's remote-member gate, #3662, uses the same list). IP literals, localhost/*.localhost, *.ts.net (but see below), this machine's <name>.local mDNS name (not its bare or DNS hostname, which the network's DNS answers), a named bind address and the hosts of A2A_ALLOWED_ORIGINS are already trusted. Set this when a reverse proxy forwards another public name (e.g. nginx proxy_set_header Host $host), or when other containers reach an open, PROTOAGENT_ALLOW_OPEN=1 agent by its compose service name (PROTOAGENT_TRUSTED_HOSTS=agent). Any other Host gets 403 (a WebSocket is closed 1008). A token-gated instance ignores it. A *.ts.net Host is still refused on an open instance unless PROTOAGENT_ALLOW_OPEN=1: on a tokenless agent it can only be tailscale serve forwarding the tailnet to an unauthenticated console.

Authentication — A2A bearer token ​

VariableDefaultWhat
A2A_AUTH_TOKEN(unset — open mode)Required bearer token for the A2A routes and the operator/console + OpenAI-compat APIs — /a2a, /api/*, /api/chat, /v1/*. When set, requests without Authorization: Bearer <token> get 401. Constant-time comparison (hmac.compare_digest).

When unset, startup logs a WARNING ("A2A auth token not configured — endpoint is open") and accepts all traffic — fine for local dev (and safe behind the loopback-default bind, see PROTOAGENT_HOST), not for an exposed deployment. A non-loopback bind with no token refuses to start unless PROTOAGENT_ALLOW_OPEN=1 (see above). When set, the agent card advertises securitySchemes.bearer.

Scope. The guard covers /a2a, /api/*, and /v1/*. Health, agent-card, and static console routes remain public. /metrics requires auth when the instance is token-gated; PROTOAGENT_PUBLIC_METRICS=1 permits anonymous scraping. EventSource streams such as /api/events authenticate with short-lived query tokens, because browser EventSource cannot send bearer headers.

Console. When a token is set, the React console sends it as a bearer on every API + A2A call. On the first 401 the console prompts for the token ("Authentication required") and stores it in localStorage["protoagent.authToken"] — no devtools needed; local/desktop runs (no token) need nothing.

A2A agent-card endpoint ​

VariableDefaultWhat
A2A_PUBLIC_URL(unset — http://127.0.0.1:<bound-port>)The externally-reachable base URL advertised in the agent card's supportedInterfaces[].url (where peers send message/send). Set this for any deployed agent — behind a proxy / in a container the bound port isn't the address clients use. The /a2a JSON-RPC suffix is appended automatically (e.g. A2A_PUBLIC_URL=https://gina.example.com → card url https://gina.example.com/a2a). Unset, it falls back to the actually-bound loopback port (correct for local + the dynamic-port desktop sidecar, where the caller is on the same host). Fleet members don't set this themselves — the supervisor derives it as {hub_public_url}/agents/<slug> so each member advertises its own A2A tenant sub-path (ADR 0042); an explicit per-workspace value still wins. The same base makes media links absolute for non-console clients: an A2A answer's file parts and the links in a /v1 reply (#4252). A fleet member's links therefore route through the hub, which forwards an expiring signed one to the member without the hub's bearer (the member verifies its own signature, #4258). A non-loopback bind with this unset logs a startup warning.

This is independent of the legacy <AGENT_NAME>_API_KEY header-based scheme (X-API-Key) documented above. You can enable one, both, or neither; bearer is the preferred mechanism going forward.

Memory ​

Session memory is enabled by default. See architecture § Session memory for the full rationale.

VariableDefaultWhat
MEMORY_PATH<instance_root>/memoryDirectory where SessionSummaryMiddleware writes JSON session summaries and where KnowledgeMiddleware reads them back as the <prior_sessions> digest. Writes are atomic (temp file + rename). Unset, it resolves to the instance store — ~/.protoagent/<instance>/memory on a host install, /sandbox/memory in the container (where PROTOAGENT_HOME=/sandbox makes /sandbox the instance root). The memory: block in langgraph-config.yaml sizes the digest but does not locate it.
PROTOAGENT_DISABLE_MEMORY(unset)Set to 1 (or any non-empty value) to suppress disk persistence without changing langgraph-config.yaml. Loading still occurs if summaries exist from prior runs.

To persist memory across container restarts, mount a volume covering whatever MEMORY_PATH resolves to — the bundled compose file already does, since its protoagent-sandbox volume covers all of /sandbox. Without a volume the directory is ephemeral.

Knowledge store ​

The bundled KnowledgeStore (sqlite + FTS5) is enabled by default. See Configuration § knowledge for the full guide.

VariableDefaultWhat
KNOWLEDGE_DB_PATH<instance_root>/knowledge/agent.dbExplicit SQLite path override. Legacy /sandbox config defaults resolve through the instance root; an explicit non-/sandbox YAML path is also an override.

To opt out entirely, set middleware.knowledge: false in YAML. The memory tools (memory_save, memory_search, memory_forget, memory_list) and knowledge tools (knowledge_ingest, knowledge_search) are dropped from the agent loop when the store is disabled.

Notes, tasks & goals (agent-global working stores) ​

The agent's notebook, task board, and goals are agent-global — one persistent, instance-scoped store each, shared by the agent's tools and the operator console. They are not per-project (there's no .automaker/notes/ or .beads/ inside project directories). The filesystem fence for the file/shell tools is filesystem.projects (ADR 0007, the console's Work folders), not operator.allowed_dirs — that key is inert and unrelated to these stores. Default stores resolve beneath the instance root.

VariableDefaultWhat
GOAL_PATH<instance_root>/goalsDirectory of per-session goal files.
TASKS_DB_PATH<instance_root>/tasks/issues.dbExplicit task-store path; BEADS_DB_PATH is a legacy alias.
NOTES_DIR<instance_root>/notesNotes-directory override. With an explicit instance id, the plugin adds that id below the override.

The Notes plugin stores note.md in that directory. NOTES_PATH is not its runtime override.

Audit log ​

VariableDefaultWhat
AUDIT_PATH(unset)Where evals/verify.py looks for the audit JSONL when asserting that a tool fired. Read by the eval harness only — the agent's own AuditLogger resolves <instance_root>/audit/audit.jsonl through infra.paths and never consults this variable, so setting it does not move the log. Unset, the harness uses /sandbox/audit/audit.jsonl when that file exists (the container layout), else the instance store — matching where the agent actually writes.

Scheduler ​

The bundled scheduler is enabled by default. See Schedule future work and Configuration § scheduler for the full guide. Enable/disable lives in YAML (middleware.scheduler) so the drawer can toggle without a restart.

VariableDefaultWhat
SCHEDULER_DB_DIR<instance_root>/schedulerExplicit parent-directory override; when set, jobs use <override>/<agent_name>/jobs.db. The default instance-private path is <instance_root>/scheduler/agent/jobs.db; an existing name-keyed store may be adopted.
SCHEDULER_INVOKE_URLhttp://127.0.0.1:<active_port>Where to POST message/send when a job fires. Override only if the agent's A2A endpoint isn't on localhost.
SCHEDULER_FIRE_TIMEOUT_S600How long a fire waits for the turn (message/send blocks until the turn is terminal). Must exceed a real turn — too low false-fails long turns. Fires run off the poll loop, so this doesn't stall the cadence.
SCHEDULER_DISABLED(unset)Runtime escape hatch — set to 1 / true to drop the scheduler tools entirely without editing YAML. middleware.scheduler: false is the canonical opt-out.

Tracing (optional) ​

VariableWhat
LANGFUSE_PUBLIC_KEYLangfuse project public key
LANGFUSE_SECRET_KEYLangfuse project secret key
LANGFUSE_HOSTLangfuse host URL (e.g. https://langfuse.company.com). Falls back to LANGFUSE_URL, then http://host.docker.internal:3001 — never to the tracing.host config key when the keys came from the environment (#3039). With the keys in config instead, this is the fallback a blank tracing.host uses.
PROTOAGENT_FLEET_TRACE_EXPORTFleet trace export (the flywheel Observe, #1897). Unset → off (or the telemetry.fleet_trace_export config toggle decides). 1/on → on at <instance>/fleet-traces/; a path → on there; 0/off → hard-off, overriding the config toggle. See Observability ▸ Fleet trace export.

A complete LANGFUSE_PUBLIC_KEY + LANGFUSE_SECRET_KEY pair wins outright over the tracing.* config block — including over tracing.enabled: false, so a container deploy needs nothing but these vars (#3017). With the pair unset, the config block is the fallback, and it is the only path that reaches a desktop-launched fleet member (nothing in that launch path sets LANGFUSE_*). Env keys never follow a config host (#3039), so config can't aim deployment credentials at a host it names; config keys still fall back to LANGFUSE_HOST, which is what makes host-in-env + keys-in-Settings (and a fleet member inheriting the hub's Langfuse) work. Whichever host loses is named on the boot line. With neither, distributed tracing is disabled and every helper in tracing.py becomes a no-op. Fleet trace export is independent — it needs no Langfuse.

Logging ​

VariableDefaultWhat
LOG_LEVELINFOPython logging level. Valid: DEBUG, INFO, WARNING, ERROR.
LOG_FORMATtextSet to json to emit one JSON object per log line (keys: ts, level, logger, message, plus exc/exc_type on errors and any extra= fields) — parse-stable for aggregators (Loki, CloudWatch, Datadog). Anything else keeps the human-readable format. Same level + stderr stream either way.
LOG_BUFFER_LINES2000Records retained in the in-process ring buffer that backs GET /api/diagnostics/logs (#3168). 0 retains nothing (a full opt-out — the endpoint then reports enabled: false); capped at 50000. Unparseable values keep the default rather than failing startup. Read once when logging is first configured, so a change takes effect on the next process.

The ring buffer is the fleet-diagnostics log source, and it is deliberately not agent.log: that file is a raw stdout/stderr redirect the fleet supervisor sets up for hub-spawned local children only, so registered remote members, foreground runs (python -m server), and desktop-run members have no such file. An in-process ring exists on every member whatever its deployment shape. It holds logging records only — raw print() output and an interpreter crash traceback are not captured (boot-death output is surfaced separately, by the supervisor's spawn watch).

The template configures logging at startup (observability/logging_config.py) — without an explicit level, Python's default WARNING would hide logger.info(...) lines like "webhook delivered", making A2A issues invisible in container logs.

Streaming / origin verification ​

VariableDefaultWhat
A2A_ALLOWED_ORIGINS(unset — check disabled, with WARNING)Comma-separated browser Origin allowlist for protected HTTP routes, including streamed A2A calls. Example: https://app.example.com,https://admin.example.com. Set to * to explicitly disable origin verification without the WARNING log. Origin values are compared case-insensitively.

When unset, this allowlist check is disabled and a WARNING is logged at startup. On requests checked by the HTTP auth middleware, a present Origin outside the configured allowlist receives 403 Forbidden; a missing header is allowed so server-to-server callers continue to work. A console origin declared in network.public_console_url is added to the allowlist automatically when the allowlist is set, so you don't list it twice. Include any other public console origin when using a proxy. Open instances also enforce separate host and browser-request checks; disabling this allowlist does not remove those protections.

Push notifications / SSRF guard ​

VariableDefaultWhat
PUSH_NOTIFICATION_ALLOWED_HOSTS(empty)Comma-separated hostnames that bypass the private-IP check when accepting webhook URLs. Example: automaker-server,internal-hooks.
PUSH_NOTIFICATION_ALLOWED_CIDRS(empty)Comma-separated CIDR blocks explicitly allowed. Example: 10.0.0.0/8,172.16.0.0/12.

Without these set, the handler rejects webhook URLs that resolve to private / loopback / link-local IPs — defends against SSRF where a client registers http://169.254.169.254/... or http://10.0.0.1/... as a callback.

Server bind ​

The server binds host 0.0.0.0; the port is set by the --port CLI flag (default 7870) — uvicorn.run(app, host="0.0.0.0", port=args.port). The A2A handler, REST API, metrics, and agent card are all served on that one port. (There is no GRADIO_SERVER_NAME / GRADIO_SERVER_PORT env — those are not read.)

Plugin env fallbacks ​

Plugins prefer in-app config (Settings), but read env as a Docker/headless fallback. The external Discord plugin (installable from Settings ▸ Plugins ▸ Discover) reads:

VariableWhat
DISCORD_BOT_TOKENBot token for the discord plugin's gateway (fallback for discord.bot_token).
DISCORD_ADMIN_IDSComma-separated Discord user IDs allowed to DM the bot (fallback for discord.admin_ids).

Other external plugins (e.g. a Google or Slack integration) declare and read their own env fallbacks — see that plugin's docs.

Peer federation (A2A peer-consult tools) ​

Register peer agents so this agent can consult them via the peer_list / peer_consult tools (added to the toolset only when at least one peer is set). See tools/lg_tools.py.

VariableWhat
PEER_<HANDLE>_URLBase URL of a peer agent (its /a2a endpoint is derived). <HANDLE> becomes the peer name (e.g. PEER_ALICE_URL → peer alice).
PEER_<HANDLE>_TOKENOptional bearer token sent to that peer if it requires auth.

Release pipeline (shared release-tools Action) ​

These are CI secrets, not env vars the template reads at runtime. The Discord-release step of release.yml delegates to the shared protoLabsAI/release-tools Action, which reads them from the job env.

VariableWhat
GATEWAY_API_KEYBearer token for the protoLabs LLM gateway; the Action rewrites raw commits into themed notes.
DISCORD_RELEASE_WEBHOOKDiscord channel webhook. If unset (post-discord: false), notes generate but aren't posted.

Not set by the template ​

The core runtime stays credential-light, but some bundled tools/plugins do read their own env: the GitHub read tools authenticate via GITHUB_TOKEN / GH_TOKEN (or gh's ambient login), and the Discord plugin reads the fallbacks above. Any other tool-specific credentials belong in your fork's tools/plugins, not the shared runtime.

Part of the protoLabs autonomous development studio.