Synced from Hive. This page is pulled from hivecommons/hive@v5 during the docs build. Edit the canonical source in the Hive repository.

Environment variable reference

This reference is compiled by hand from the Go source under src/, the deployment manifests, and the top-level helper scripts. The code is authoritative: hive.yaml may also expand arbitrary ${NAME} placeholders through the config resolver, but the variables below have built-in behavior.

Core hive runtime

VariableRequiredDefaultPurpose
HIVE_CONFIGNo/etc/hive/hive.yamlDefault config path used before the --config flag is parsed; an explicit --config outranks it, so entrypoint.sh also appends --config "$HIVE_CONFIG" to the launch argv when it is set (#4973). The dashboard also uses it when reporting config provenance — which is why the two must not disagree.
HIVE_MODENospoke/dashboard modeSet to hub to run the hub server instead of the spoke dashboard.
HIVE_HUB_PORTNo3001Hub listen port when HIVE_MODE=hub.
HIVE_SINGLETON_LOCKNo/var/run/hive-metrics/hive.singleton.lock when available, otherwise OS temp dirOverrides the process singleton lock path. Set exactly off for local development where duplicate processes are intentional.
HIVE_GITHUB_TOKENRequired unless GitHub App auth is configurednoneMain PAT fallback for github.token; also used by fleet/stat fallback paths and some deployment manifests. Missing PAT scopes surface as request-time 403s — see Required PAT scopes.
GH_APP_KEY_FILENoconfigured github.key_file, then /data/gh-app-key.pem or /secrets/gh-app-key.pem in provisioned pathsGitHub App private-key file fallback.
DASHBOARD_AUTH_TOKENNononeDashboard shared-token value used by Kubernetes/provisioned deployments; read before HIVE_DASHBOARD_TOKEN when dashboard.auth_token is empty. Same format rules as HIVE_DASHBOARD_TOKEN — see Generating and rotating HIVE_DASHBOARD_TOKEN.
HIVE_DASHBOARD_TOKENNononeDashboard/API shared-token fallback and default hivectl --token-env variable. See Generating and rotating HIVE_DASHBOARD_TOKEN.
HIVE_DASHBOARD_COOKIENononeClient-side - read by hivectl tui, never by the server. Cookie header value (e.g. hive_session=...) carrying a per-user session, for hives that do not accept the shared token: hub-hosted, and spokes with an authorized_users allowlist. See hivectl.md, Credentials.
HIVE_DASHBOARD_BINDNo127.0.0.1 for the legacy dashboard/server.jsLegacy Node dashboard listen address. Leave unset for loopback-only binding; set HIVE_DASHBOARD_BIND=0.0.0.0 when an authenticated reverse proxy or equivalent network control protects the unauthenticated legacy control endpoints.
HIVE_AUTHORIZED_USERSNononeComma-separated direct-route dashboard allowlist, with optional user:role entries. Used when dashboard.authorized_users is empty.
HIVE_SELF_AUTHORIZATION_HOLDNogithub.self_authorization_hold / project.repo_policies[].self_authorization_hold; when all are unset, default true through ACMM L5 and false at ACMM L6 Fully AutonomousProcess-level override for the #5117 self-authorization hold. Set false to let this hive skip and release self-authorization holds for every repo while preserving unrelated human holds; set true to keep the hold enabled even at L6.
HIVE_REPORTER_TRUST_HOLDNogithub.reporter_trust_hold / project.repo_policies[].reporter_trust_hold; when all are unset, follows project.issue_filter.reporter_trust.enabledProcess-level override for the #9665 reporter-trust hold (a PR whose rationale traces to an issue from an untrusted reporter is held at every ACMM level). When set, the dashboard toggle and per-repo overrides are locked and say so.
HIVE_REPONononeBootstrap shortcut in owner/repo form; fills project.org, project.repos, and project.primary_repo if missing.
HIVE_RELEASE_SENTINEL_ENABLEDNorelease_sentinel.enabled (default false)Process-level override for the opt-in release sentinel (#9585). true/1/on/yes turns it on and false/0/off/no turns it off regardless of config; any other value leaves the config in charge. See release-sentinel.md.
HIVE_RELEASE_SENTINEL_RETAG_ENABLEDNorelease_sentinel.retag_enabled (default false)Process-level override for the release sentinel’s separate retag opt-in (#9585): when on, the hive moves the v<version> tag to a merged, marked fix PR’s merge commit with leased, atomic tag push. Same values as HIVE_RELEASE_SENTINEL_ENABLED. It never turns retagging on while the sentinel itself is off. See release-sentinel.md.
HIVE_ATTRIBUTED_CLOSED_PR_LOOKBACKNo14dBounds the per-repo closed-PR attribution scan that feeds dashboard outcome/rework metrics during PR enumeration. The scan lists closed PRs sorted by updated_at descending, stops when results are older than this window, and also stops after five pages so large repositories are never walked from history on every governor tick. Values accept Go durations such as 336h, or day counts such as 14/14d; invalid or non-positive values fall back to 14d.
HIVE_LEVELNoconfig/pack valueACMM level bootstrap/override used by hosted flows and the entrypoint pack selection.
HIVE_IDNoconfig or generated idStable hive/spoke identifier override; passed through to launched agents.
HIVE_CLUSTER_IDNoconfig or hub-provisioned valueHosted cluster identifier override.
HIVE_HUB_URLNohub.url from configHub URL override for spoke heartbeats/registration. On the hub it is also the last environment variable consulted in the hub public-origin chain (see HIVE_HUB_PUBLIC_URL).
HIVE_NPS_ENABLEDNohub.nps_enabled; when both are unset, on for hosted spokes (hub.hive_type: hosted) and off otherwiseTurns the dashboard NPS feedback prompt on or off. Accepts 1/true/yes/on and 0/false/no/off; other values are ignored. Responses are forwarded over the spoke’s hub link or, for a standalone hive with a relay configured, to the NPS relay, never to anyone else. See NPS feedback prompt.
HIVE_NPS_RELAY_URLNohub.nps_relay_url; empty (relay disabled)Base URL of the NPS relay for standalone hives (the hivecommons relay is https://docs.hivecommons.dev/api/nps). A spoke with NPS enabled and no hub link self-registers a generated Ed25519 key at <url>/register and POSTs signed responses here, with no token to configure; a hub pulls from <url>/pending and acks at <url>/ack. Must be https (plain http to a loopback host). See NPS feedback prompt.
HIVE_NPS_RELAY_PULL_SECRETNohub.nps_relay_pull_secret; emptySecret, hub. Authenticates the hub’s periodic pull from the NPS relay. Without it (or without a relay URL) the hub does not pull. Never logged.
HIVE_HUB_TASK_STATUS_PUSHNohub.task_status_push, default trueEnable the separate spoke task-status push loop. Accepts 1/true/yes/on or 0/false/no/off (case-insensitive); empty/invalid values fall back to config. Read at startup; restart after changing. Core heartbeat and hub-managed upgrade/config delivery remain enabled.
HIVE_HUB_PUBLIC_URLNocompiled fallback https://hive.hivecommons.dev; hosted service sets https://hive.hivecommons.devHub canonical public origin used to derive OAuth/OIDC callback URLs, hub Open Graph/notification links, same-origin checks, and the registrable-domain scope for hub SSO cookies. Public hub operators should set this to https://hive.hivecommons.dev for the cutover; leave the legacy value while deliberately serving the redirect hostname. Changing the registrable domain here signs users out of every first-party sibling product left on the old — the hive_hub_user cookie is scoped to this URL’s registrable domain and a browser will not send it anywhere else. See Moving a public hostname.
HIVE_HUB_SPOKE_DOMAINNocompiled fallback hive.hivecommons.dev; hosted service sets hive.hivecommons.devParent domain used for hub-provisioned spoke ingress hostnames (for example <hive-id>.<domain>). Kept separate from HIVE_HUB_PUBLIC_URL because the wildcard spoke domain may differ from the hub’s own hostname.
HIVE_HUB_LEGACY_COOKIE_DOMAINNononeOptional transition-only hub SSO cookie domain to expire alongside the active cookie domain while accepting any carried hive_hub_user cookie value during a host migration. Writes still target the domain derived from HIVE_HUB_PUBLIC_URL; unset disables the extra legacy-domain cleanup.
HIVE_HUB_SECRETRequired for spokes registered to a protected hub; optional for a standalone hub with /data/saas/hub-secret.key/data/saas/hub-secret.key on the hub when present; no fallback for spoke heartbeat authBearer secret for spoke heartbeats and hub/spoke SaaS APIs.
HIVE_HUB_AGENT_RESTART_PROBLEM_THRESHOLDNo5Hosted hub threshold for surfacing agent restart storms on /fleet. When an agent reports at least this many restarts in the last 24 hours (or since the hub-side reset marker), the hive gets a restart problem chip and drift signal.
HIVE_COVERAGE_BADGE_URLNonone (the flagship hivecommons/hive gist for org hivecommons/hivecommons)Where the ci-maintainer card’s coverage percentage comes from. Either an http(s) URL to a shields-style JSON badge ({"message":"85%"}) or an SVG badge, or repo://<ref>/<path> to read the badge file from the hive’s primary repo through the GitHub App client — the form to use for a private repo, e.g. repo://badges/coverage.svg for octocov’s default layout. Unset on a non-flagship hive, the card shows 0.
HIVE_BRANDING_CSSNo<data>/branding/custom.css, where <data> is the parent directory of the configured data.agents_dir, falling back to /data when that config field is empty — so the shipped default is /data/branding/custom.cssAbsolute path of the operator override stylesheet the dashboard serves at /branding/custom.css. The index document links that URL unconditionally, so a missing file is the normal case and simply 404s. Read per request, so an edit takes effect on reload without a restart. The read is guarded (#5854): the file must be a regular file owned by the hive uid or root, not group- or world-writable, at most 128 KiB, and a symlink must resolve inside its own directory — anything else is refused with a logged warning, because whoever can write this path injects CSS into the operator’s dashboard. See Branding a hive, What the code enforces.
HIVE_BRANDING_JSONNobranding.json in the same directory as the resolved HIVE_BRANDING_CSS — so /data/branding/branding.json by default, and it follows HIVE_BRANDING_CSS when that is overriddenAbsolute path of the branding strings file (product_name, tagline, mark, title) baked into the served SPA document. Read once at startup, because the index carries a precomputed gzip body and strong ETag; editing it needs a restart. A missing or malformed file is a no-op (a parse failure is logged and ignored). Because the strings are substituted into the served bytes, they are inside the document CSP hashes are computed over — see branding.md. The same ownership/mode/size/symlink guards as HIVE_BRANDING_CSS apply at startup (#5854).
HIVE_BRANDING_ALLOW_UNSAFE_OWNERNofalseWaives only the ownership check on branding file reads (#5854), for deployments whose branding files legitimately cannot be owned by the hive uid or root. It never relaxes the group/world-writable refusal, the size cap, or the symlink containment check — those have no legitimate exception. Enable when every writer of the branding path is trusted, since branding CSS renders in the operator’s browser under a CSP that allows img-src https:.
HIVE_WORK_DIRNo/data/agentsAgent manager working directory.
HIVE_SHANobuild SHAPassed to launched agents and used in hub upgrade/status paths.
HIVE_ADVISORY_ISSUENononePassed to launched agents so advisory findings can target a configured issue.
HIVE_TTYD_PORTNo7681Web terminal port used by the entrypoint and terminal proxy.
HIVE_TTYD_CREDENTIALNohive:<HIVE_DASHBOARD_TOKEN> when a token is set, else nonettyd basic-auth credential (user:pass) the entrypoint starts the web terminal with. Also read by hivectl tui’s remote attach (#5644), which must present the same credential through the terminal proxy and derives the same default from HIVE_DASHBOARD_TOKEN — set it on the client if the deployment overrode it on the server.
HIVE_METRICS_ENABLEDNodisabledRegisters Prometheus /metrics when set to 1, true, yes, or on. Requires HIVE_METRICS_TOKEN — enabled-but-tokenless returns 403 (#3804).
HIVE_METRICS_TOKENYes when metrics enablednoneBearer token read by pkg/dashboard/metrics_prometheus.go for /metrics (Authorization: Bearer ...; Prometheus bearer_token). /metrics bypasses dashboard session auth, so this token is its guard; enabled-but-tokenless fails closed and the cost/agent series are never served without it.
HIVE_METRICS_FILENo/var/run/hive-metrics/contribute.jsonContributor metrics JSON file override.
HIVE_PUBLIC_KNOWLEDGENodisabledEnv fallback for the anonymous, read-only MCP knowledge endpoint POST /mcp/knowledge (1, true, yes, or on — same spelling as HIVE_METRICS_ENABLED). The owner dashboard toggle in the Knowledge header and Settings → Knowledge takes precedence saved; with no saved setting this remains the switch. Off → 404 even for authenticated callers. Resolved on each request so it can be closed without a pod roll. operational fact types (pattern, gotcha, regression, test_scaffold, integration, coverage_rule, general) are served; ideation/governance types, sources, and usage data never leave the hive. See public-knowledge-mcp.md (#10615).
HIVE_PUBLIC_KNOWLEDGE_TAGSNonone (all public-type facts)Env fallback comma-separated tag allow-list that further narrows what /mcp/knowledge serves to facts carrying at least listed tag (case-insensitive). A saved dashboard tag list takes precedence.
HIVE_COPILOT_INTEGRATION_IDNocompiled Copilot integration idOverrides the integration id used by Copilot model discovery.
HIVE_CONTRIBUTORS_DIRNohub defaultContributor registry directory override.
HIVE_CONTRIBUTE_SKIP_LABELSNoblocked,tracking,epic,discussion,question,needs-decision,needs-triageComma-separated, case-insensitive label patterns for issues that are not contributor work and must never be offered by the relay. Patterns use path.Match-style * globs; blocked is always unioned into the effective set even if omitted. Same setting as hub.contribute_skip_labels.
HIVE_FEDERATION_REGISTRY_PATHNo/data/federation/registry.jsonFederation registry path override.
HIVE_WEBHOOK_SECRETNononeHMAC secret for the spoke /webhook channel.
GITHUB_WEBHOOK_SECRETNo/data/saas/webhook-secret.key when presentHub GitHub webhook HMAC secret.
HIVE_DASHBOARD_URLNononeBase URL the hive tui client targets (pkg/tui/client). A bad value surfaces as a request error on the first call, not at startup. On the hub it is also consulted (fourth) in the hub public-origin chain (see HIVE_HUB_PUBLIC_URL).
HIVE_CONVERGENCE_MODENoconvergence.mode in hive.yaml, else shadowProcess-level override of the convergence mode (off, shadow, enforce) so an operator can flip the mode without editing hive.yaml. An unset mode takes the default, shadow, which computes and records admission decisions without withholding any work. A non-empty but unrecognised value — a typo, or a mode this build does not know — still resolves to off.
HIVE_RELEASE_LINE_LAG_MAXNo5Alarm threshold for the release-line drift surface (#6960): how many commits the hosted edge line (v5) may sit behind the stable default branch (v4) before the dashboard status flags the line as drifting (releaseLineLag.exceeded). An unset, empty, non-numeric, or negative value falls back to the default — it can never silently disable the alarm. An unknown lag (tips unresolved or the compare failed) is reported as unknown, never a healthy zero.
HIVE_WATCHDOG_PAUSENounset (not paused)Fleet-wide watchdog kill switch (1, true, yes, on). Read at every config resolve, so it takes effect without a restart. It can ever REDUCE authority: it never turns a watchdog on and never promotes observe to heal.
HIVE_DELEGATION_CHAIN_ENABLEDNodisabledEnables delegation chain minting (1, true, yes, on — same spelling as HIVE_METRICS_ENABLED). Read on each call rather than cached, so disabling it on a misbehaving spoke does not require a pod roll.
HIVE_ALLOW_PRIVATE_GIT_SOURCENofalseExact true opt-in read by pkg/knowledge/gitsource.go to allow knowledge Git sources whose host resolves to a private/internal address (self-hosted GitLab and similar). Off by default as SSRF protection.
HIVE_SHARED_AGENT_HOMENoper-agent HOMEEscape hatch (1) restoring the legacy shared-HOME layout for agents.
HIVE_WORKSPACE_CLEANUP_ENABLEDNoenabledSet 0 to opt out of automatic agent workspace cleanup.
HIVE_WORKSPACE_CLEANUP_INTERVALNo1hHow often the workspace cleanup sweep runs (Go duration, e.g. 30m). Unset, unparseable, or non-positive values fall back to the default.
HIVE_WORKSPACE_CLEANUP_MAX_AGENo2hHow old an entry under /data/agents/*/ must be before the cleanup sweep removes it (Go duration, e.g. 6h). Unset, unparseable, or non-positive values fall back to the default.
HIVE_DOSSIER_CACHE_MAX_ENTRIESNo512Caps each public dossier cache. Bounds username-spray memory while keeping normal contributor reuse hot.
HIVE_CONTRIBUTOR_KNOWLEDGE_EXPORT_MAX_FACTSNo80Caps the number of facts returned by the contributor knowledge export API. Unset, non-numeric, or non-positive values fall back to the default.
HIVE_PUBLIC_REPOSNononeComma-separated, case-insensitive allowlist of additional Gource project names the dashboard’s public war-room view may render, beyond the always-allowed default (hive).

Generating and rotating HIVE_DASHBOARD_TOKEN

HIVE_DASHBOARD_TOKEN (and the dashboard.auth_token config key it falls back to) is an opaque shared secret. The server does not enforce any format:

  • Format: any non-empty string is accepted. It is not parsed as a UUID, JWT, or hex value — it is compared byte-for-byte (in constant time) against the Authorization: ****** value on each API request.
  • Validation: there is no startup validation and no minimum-length or entropy check. A weak or predictable value is accepted silently, so the burden of picking a strong value is entirely on the operator.
  • What it protects: on a self-hosted (non-direct-route) hive this token is the only API credential — it gates agent logs, kick controls, and config reads/writes, and it doubles as the server-to-server X-Hive-Internal credential used by the local proxy. Treat it like a root password for the hive. On direct-route or hub-proxied spokes identity is per-user and the shared token is server-to-server.
  • Transport: clients must send the shared token in the Authorization header (Bearer <token> or the raw token value for legacy API clients). ?token= query-string credentials are rejected because URLs are routinely recorded in ingress/access logs, browser history, screenshots, and shared links. Browser terminal opens first POST to /api/terminal/handoff with the caller’s normal Authorization header or session cookie, then navigate with a short-lived single-use code that cannot be replayed. If a new spoke returns 401 for an old ?token= terminal/log URL, upgrade the hub or client that generated that link.
  • Empty value: leaving it unset leaves the dashboard API unauthenticated (unless direct-route per-user authorization is configured). Never deploy an internet-reachable hive without it.

Precedence: dashboard.auth_token, DASHBOARD_AUTH_TOKEN, HIVE_DASHBOARD_TOKEN

Three sources can supply the same shared token. The first non-empty value wins and the rest are ignored:

  1. dashboard.auth_token in hive.yaml (note that the shipped manifests set it to the ${HIVE_DASHBOARD_TOKEN} placeholder, which the config resolver expands — so in those deployments the env var is what actually supplies it).
  2. DASHBOARD_AUTH_TOKEN environment variable.
  3. HIVE_DASHBOARD_TOKEN environment variable.

Both env vars hold the token value, not a Kubernetes Secret name. In src/deploy/k8s/deployment.yaml the name of the Secret is hive-secrets; the env var is populated from a key inside it via secretKeyRef. Setting either var to something like hive-secrets configures that literal string as your dashboard password.

Because both resolve to the same field, setting them to different values is never useful — the lower-precedence is silently discarded, which is a common source of “I rotated the token but the old still works” confusion. Pick variable per deployment and rotate that.

Generate a strong value with a CSPRNG; 32 bytes (256 bits) of entropy is recommended:

openssl rand -hex 32
# or
head -c 32 /dev/urandom | base64 | tr -d '=+/'

Placeholders like your-dashboard-auth-token in deployment examples must be replaced — any string “works”, but a guessable token is a full-access credential.

Rotation: the token is read at process start and compared per request, so rotating is: update the env var / Kubernetes Secret / config.env, then restart the container or pod. The old token stops being accepted as soon as the process restarts with the new value; there is no separate session invalidation step (browser device-flow sessions use their own cookies and are unaffected). Update any hivectl environments and other API clients to the new value at the same time.

Deployment entrypoint and proxy knobs

VariableRequiredDefaultPurpose
HIVE_API_PORTNo3002Internal Go API port used by src/deploy/entrypoint.sh.
HIVE_PROXY_PORTNo3001Node reverse-proxy/front-door port used by src/deploy/entrypoint.sh.
HIVE_STATIC_DIRNo/opt/hive/proxy/publicStatic asset directory for the Node proxy.
HIVE_PROXY_EGRESS_MARKNo0x1112Packet mark exempted from the MITM egress redirect.
HIVE_PROXY_ADVISORY_OKNofalseAllows the spoke to start when the forced-proxy egress redirect cannot be installed (no CAP_NET_ADMIN/iptables). Enforcement becomes advisory-only — agents can bypass the proxy. Also gates whether the Go proxy trusts a self-asserted Proxy-Authorization header as agent identity when its UID map is unavailable (N7, #3841) — off by default, an unidentified caller is treated as ADVISORY (writes blocked) rather than whatever name it claims. See security-model.md.
HIVE_PROXY_INJECT_GH_AUTHNounset (off; opt-in on every hive, hosted or not)Proxy-side GitHub credential injection (#1861). Opt-in: on exclusively when set to true; unset, false and any other value are off, and the hub renders no value newly provisioned spokes (a brief default-on for hosted App spokes from #9597/#9625 was reverted, #9586). true: the hive keeps each agent’s tier-scoped App token in memory, the MITM proxy strips any agent-supplied Authorization on GitHub hosts and attaches the UID-identified agent’s real token, and the agent’s readable token cache (and the GH_TOKEN/GITHUB_TOKEN derived from it) holds the inert placeholder hive-proxy-injected-&lt;agent&gt;. false is the explicit opt-out (same as unset, but recorded on the pod spec). The resolved state is logged at boot as `proxy GitHub auth injection: on
HIVE_DEPLOYMENT_RUNTIMENonone (config deployment.runtime fallback; hub-registered Kubernetes hives are auto-detected)Declares the deployment runtime (kubernetes, podman-quadlet, or docker-compose) so the dashboard can offer standalone upgrades. Unset/unrecognized means unknown and the upgrade button stays hidden. See dashboard-standalone-upgrades.md.
HIVE_DEPLOYMENT_PODMAN_MODEwhen runtime is podman-quadletnone (config deployment.podman_mode fallback)rootless (systemctl --user) or rootful (system manager). Without an explicit mode the Podman/Quadlet upgrade path stays disabled.
HIVE_DASHBOARD_UPGRADE_HELPERNoconfig deployment.upgrade_helper fallback, then /usr/local/libexec/hive-dashboard-upgrade-helperAbsolute path to the standalone upgrade helper executable the dashboard invokes. Must be a regular, executable file at an absolute path or the upgrade button stays hidden. See dashboard-standalone-upgrades.md.
HIVE_GIT_BOT_EMAIL_DOMAINNohive.hivecommons.devDomain of the bracket-free bot sign-off address <slug>@<domain>. With github.app_signed_commits on, the PR-request watcher re-addresses any <slug>[bot]@users.noreply.github.com Signed-off-by trailer it copies into the GitHub-signed commit to this form, because probot-dco rejects the bracketed local-part as a malformed email (#6251); on v4 src/deploy/entrypoint.sh mints the agents’ pane identity under the same domain (#6276). A plain hostname ([A-Za-z0-9.-]); anything else falls back to the default.
HIVE_TMUX_HISTORY_LIMITNo50000tmux scrollback depth applied when an agent session is created (positive integer; the authoritative knob for terminal scrollback and full-log capture).
HIVE_TTYD_HISTORY_LIMITNo50000Defense-in-depth history-limit raise applied at browser attach time; affects panes created after attach.
HIVE_TMUX_PANE_WIDTHNo200Column count agent tmux sessions are created with. A detached tmux session defaults to 80 columns because no attached client supplies a size.
HIVE_KICK_LOG_DIRNo/data/logs/kicksRoot directory per-kick log archives are written under. On the persistent volume so archives survive restarts, pod rolls, and image upgrades.
HIVE_KICK_LOG_RETENTIONNo10Archived kick logs kept per agent. 0 disables archiving entirely.
HIVE_KICK_LOG_MAX_BYTESNo67108864 (64 MiB)Per-agent total size cap across archived kick logs.
HIVE_PR_FOLLOWUP_RESUMENoturn.pr_follow_up.enabled (default false; also a toggle under Settings > Features)Process-level override for PR follow-up session resume (#9583): true routes CI failures, changes-requested reviews, new review-bot threads and comments from people with write access on a PR this hive opened back into the CLI session that authored it while that session is still live, and adds the PR’s handoff note to the agent’s next fresh kick when it is not; false is the-step rollback to the fix-before-new path. Wins over the dashboard toggle. See PR follow-up session resume.
HIVE_PR_FOLLOWUP_MAX_AGENoturn.pr_follow_up.max_age, then 24hHow long after a PR opens its authoring session stays eligible for resume (Go duration). Invalid or non-positive values fall back to 24h.
HIVE_PR_FOLLOWUP_RETENTIONNoturn.pr_follow_up.retention, then 336hHow long a PR follow-up pointer and its handoff note are kept at all (Go duration). Pointers are deleted as soon as the PR merges or closes; this is the backstop for PRs whose end the hive never observes. Invalid or non-positive values fall back to 336h (14 days).
HIVE_PR_FOLLOWUP_RESUME_ID_MAX_AGENoturn.pr_follow_up.resume_id_max_age, then 72hHow long a backend-native resume id captured when the PR opened (#9606) is still offered to a later session (Go duration). Past it, or the transcript is gone, the handoff note is handed on. Invalid or non-positive values fall back to 72h.
HIVE_PR_FOLLOWUP_DIRNo/data/turn/pr-followupsDirectory the per-PR follow-up pointers (pkg/turn envelopes) are persisted under. On the persistent volume so pointers and queued follow-ups survive restarts.
OTEL_EXPORTER_OTLP_ENDPOINTNononeOTLP trace exporter endpoint. Tracing stays disabled while unset.
HIVE_WIKI_GIT_URLNononeOptional wiki vault URL cloned into /data/vaults/hive-wiki on first boot.

Inference, CLI backends, and agents

VariableRequiredDefaultPurpose
HIVE_VLLM_ENDPOINTNounset in code; hosted provisioning or an explicit deployment may set a cluster-reachable endpointComma-separated vLLM endpoint list. Unset disables the built-in vLLM gateway route.
HIVE_LLMD_ENDPOINTNohttp://hive-llm-d-epp.hive-inference.svc.cluster.local:8000 (code default; src/deploy/k8s/deployment.yaml sets the same value)Comma-separated llm-d endpoint list.
HIVE_LITELLM_ENDPOINTNoYAML governor.litellm.endpoint; unset means LiteLLM is unregistered unless local_proxy is trueRuntime LiteLLM base URL override.
HIVE_VLLM_API_KEYNononeDefault bearer token for vLLM model discovery when no backend-specific api_key_env or file resolves.
HIVE_LLMD_API_KEYNononeDefault bearer token for llm-d model discovery when no backend-specific api_key_env or file resolves.
HIVE_LITELLM_API_KEYNo/secrets/litellm_api_key or /data/secrets/litellm_api_key may be used firstDefault LiteLLM API key environment variable.
HIVE_VLLM_MODELSNostatic fallback aliasesComma-separated vLLM model IDs used when discovery returns none.
HIVE_LLMD_MODELSNostatic fallback aliasesComma-separated llm-d model IDs used when discovery returns none.
HIVE_LITELLM_MODELSNostatic fallback aliasesComma-separated LiteLLM model IDs used when discovery returns none.
HIVE_BOB_API_KEYRequired for Bob agents in pods unless a key file is mounted or saved on /data/secrets/bob_api_key or /data/secrets/bob_api_key may be used firstHive-side Bob API key source. The value is injected into Bob as BOBSHELL_API_KEY; Bob HTTP 401 / invalid-or-expired verification failures are surfaced as credential refresh / login-required problems.
HIVE_BOB_API_URLNohttps://api.us-east.bob.ibm.comBob key-test endpoint base URL override.
BOBSHELL_API_KEYRequired by Bob CLI when Hive injects or contributor mode uses BobnoneAPI key name read by bobshell itself.
COPILOT_GITHUB_TOKENNodashboard device-flow token file, if presentCopilot completion/model-discovery token and explicit agent injection.
ANTHROPIC_API_KEYRequired by cmd/apiproxy to inject an upstream key; agent inference backends receive a synthetic valuenoneAnthropic-compatible upstream API key. Never used to authenticate callers of cmd/apiproxy.
PROXY_AUTH_TOKENRequired by cmd/apiproxy; the binary exits at startup when unset and the proxy handler returns 503noneClient auth token callers must present to cmd/apiproxy via Authorization: Bearer or X-Api-Key. Validated in constant time and stripped before the upstream request. Mandatory because an unauthenticated proxy would let any co-resident loopback caller spend the host ANTHROPIC_API_KEY.
CONTEXT7_API_KEYNononeOptional key for Context7 knowledge API integration.
GOOSE_PROVIDERNoGoose CLI defaultProvider passed through Goose backend/model resolution.
GOOSE_MODELNoGoose CLI defaultModel passed through Goose backend/model resolution and contributor relay fallback.
HIVE_EXPLAIN_MODENooffFallback for the hive-wide default agent explain mode (off, brief, full) — see agent-configuration.md. governor.explain_mode in hive.yaml (Settings → Governor → General in the dashboard) takes precedence; this variable applies when that is unset. Either way it applies to agents that leave explain_mode unset; an agent with an explicit value, including off, keeps it. Hive also injects the resolved mode into every agent process under this same name. An unrecognized value resolves to off.
JEV_API_KEYNonone (falls back to the connected OpenRouter gateway key)Key the hive uses for Jev typed decisions on behalf of agents with jev_mode: assist (see agent-configuration.md). The variable name is configurable via jev.api_key_env. Read by the hive; never exported to agents. Secret.
BD_DIRNocurrent directorybd beads CLI data directory.
BD_DASHBOARD_URLNononeDashboard URL used by bd kb integration.
OPENAI_API_KEYNononeOpenAI-compatible API key consulted by agent credential probing (pkg/agent/authprobe.go) for Codex API-key mode, including CODEX_HOME/auth.json entries written under the same key.
OPENAI_HOSTNoGoose CLI defaultOpenAI-compatible API host consumed by Goose and forwarded into contributor containers.
OPENROUTER_API_KEYNononeOpenRouter API key, forwarded into contributor containers so a Goose backend configured with GOOSE_PROVIDER=openrouter can authenticate. Also of the per-model credential names the pi backend resolves (bin/pi-backend.js).
OPENAI_BASE_PATHNoGoose CLI defaultOpenAI-compatible API request path consumed by Goose and forwarded into contributor containers.
CODEX_API_KEYNononeAPI key read by pkg/agent/authprobe.go for the Codex CLI backend; either this or OPENAI_API_KEY makes Codex API-key mode count as configured.
HIVE_AGENT_TOKEN_REFRESH_INTERVALNo40mGo duration overriding the per-agent token refresh interval. Invalid or non-positive values fall back to the default.
HIVE_CREDENTIAL_WATCHDOG_INTERVALNo5mGo duration overriding how often the credential watchdog verifies each in-use backend credential file. 0 does NOT disable the watchdog — disabling is intentionally not offered.
HIVE_PROVIDER_ERROR_BACKOFF_BASENo2mGo duration for the first inference-provider error backoff before another kick is allowed. Invalid or non-positive values fall back to the default.
HIVE_PROVIDER_ERROR_BACKOFF_MAXNo30mGo duration cap for exponential inference-provider error backoff. Invalid or non-positive values fall back to the default.
HIVE_START_FAILURE_BLOCK_THRESHOLDNo3Consecutive identical start failures (positive integer) before an agent is blocked from automatic relaunch (pkg/agent/start_failure.go). Backoff is applied from the first failure regardless; invalid values fall back to the default.
HIVE_START_FAILURE_BACKOFF_LADDERNo1m,5m,15m,30mComma-separated positive Go durations pacing the automatic relaunch loop after start failures, indexed by consecutive-failure count and capped at the last entry. Any invalid entry discards the whole override. Explicit relaunches (a saved key, the dashboard restart button) clear the backoff outright.
HIVE_COPILOT_SESSION_REFRESH_INTERVALNo10mGo duration overriding the Copilot session refresh interval.
HIVE_COPILOT_SESSION_REFRESH_START_DELAYNo30sGo duration overriding the delay before the first Copilot session refresh.
HIVE_CLAUDE_DANGEROUSLY_ALLOW_HOST_STATENounsetBypasses the Claude host-state isolation guard. As the name says, unsafe outside local development.
HIVE_CONN_<NAME>_URLNogenerated from agent connection configAgent API connection URI variable when a connection omits env_name; <NAME> is the uppercased connection name with - replaced by _.
Custom connection auth env varsNononeIf an agent API connection uses auth.type: env, Hive reads auth.env_var and injects that exact variable into the agent.

Linear agent integration

Part 2 of RFC #4492: the hive can join a Linear workspace as an agent (actor=app OAuth), receive AgentSessionEvent webhooks, and narrate work back as agent activities. Setup and verification steps live in linear-agent.md.

VariableRequiredDefaultPurpose
LINEAR_API_KEYYes for work_source.type: linearnoneRead-only Linear API key used by the Linear work-source adapter. Reference it from hive.yaml with api_key: ${LINEAR_API_KEY} rather than storing the secret directly. The same ${LINEAR_API_KEY} form works when the work source is set from the dashboard: the reference is resolved from the hive’s environment when the work source is built (an unset variable is a startup error), and the reference is ever persisted.
JIRA_API_TOKEN / JIRA_DATACENTER_PATYes for Jira Cloud, preferred for Jira Data CenternoneSecret referenced from governor.work_source.jira.api_token. Cloud sends it as the Basic-auth password with email; Data Center sends it as Authorization: Bearer <PAT>.
JIRA_DATACENTER_PASSWORDfor Jira Data Center basic authnoneSecret referenced from governor.work_source.jira.password when a Data Center/Server instance cannot use PATs. Prefer PAT bearer auth when available.
JIRA_DATACENTER_CA_BUNDLENononeOptional PEM CA bundle referenced from governor.work_source.jira.ca_bundle. Hive appends these roots to the system trust store for Jira Data Center/Server.
JIRA_DATACENTER_CLIENT_CERTNononeOptional PEM client certificate referenced from governor.work_source.jira.client_cert for Jira Data Center mTLS. Must be set with JIRA_DATACENTER_CLIENT_KEY.
JIRA_DATACENTER_CLIENT_KEYNononeOptional PEM private key referenced from governor.work_source.jira.client_key for Jira Data Center mTLS. Must be set with JIRA_DATACENTER_CLIENT_CERT.
LINEAR_CLIENT_IDYes for the Linear agent integrationnoneOAuth client id of your Linear application (Linear → Settings → API → Applications). Without it the install endpoint returns 412 and the integration stays off.
LINEAR_CLIENT_SECRETYes for the Linear agent integrationnoneOAuth ****** for the code exchange and token refresh. Secret — deliver via Kubernetes Secret / env, never config files.
LINEAR_WEBHOOK_SECRETYes for Linear webhooksnoneHMAC-SHA256 signing secret from the Linear app’s webhook settings. The receiver fails closed: with this unset every delivery to /api/linear/webhook is rejected 401.
LINEAR_AGENT_STORENo/data/linear-agent.jsonPath of the persisted install record (workspace identity + OAuth grant, mode 0600). Override for tests or non-container runs.

Inside an agent session (set by the hive, never by the operator): ISSUES_ONLY+ agents receive LINEAR_ACCESS_TOKEN (the connected app’s OAuth token, Authorization: Bearer) or, when no workspace is connected, LINEAR_API_KEY (the work-source key, bare Authorization). Advisory agents receive neither and have both stripped. See linear-agent.md.

Backend launch controls

VariableRequiredDefaultPurpose
HIVE_AGY_LAUNCH_MODENoheadlessControls server-managed agy agents. The default headless shim leaves the tmux pane at a shell prompt and runs each kick as hive agy-turn (agy stream-json on stdin, conversation resumed by id across kicks), avoiding the upstream interactive TUI CPU wake loop tracked in google-antigravity/antigravity-cli#945. Set to interactive (or tui) to opt back into the old attachable TUI launch.
HIVE_OMP_APPROVAL_MODENoyoloApproval mode passed to omp --approval-mode when the manager launches a server-managed omp agent.

Inside an agent session

Everything in this section is set by the hive, never by the operator - the same convention as the Linear note above. The source of truth is agentEnvPairs in src/pkg/agent/manager.go (the Linear pairs are injected alongside it by the same manager); this table is the contract that agent policies, custom agent definitions, and helper scripts may rely on. Variables marked secret are delivered via tmux set-environment and never appear on a command line, in ps, or in pane scrollback.

Always set:

VariableValue
HIVE_AGENTThe agent’s name.
HIVE_AGENT_DISPLAY_NAMEThe configured display name, falling back to the agent name.
HIVE_BACKENDThe effective CLI backend (config value or dashboard override).
HIVE_MODELThe effective model (config value or dashboard override).
HIVE_ACMM_LEVELThe project’s ACMM level as a decimal integer.
HIVE_AGENT_MODEThe agent’s effective operating mode (from tools.mode when set, otherwise the resolved mode).
HIVE_EXPLAIN_MODEThe resolved explain mode (off, brief, full) after hive-wide default inheritance - always exported, off included, so scripts can branch on it without re-deriving precedence.
HTTP_PROXY, HTTPS_PROXYThe local hive proxy (http://127.0.0.1:<port>) all agent HTTP(S) traffic must traverse.
HIVE_PROXY_AGENTThe agent’s own name, so tooling (e.g. hive-panes) can identify and skip the calling agent.
GIT_TERMINAL_PROMPT0 - git never prompts for credentials.
NODE_EXTRA_CA_CERTS, GIT_SSL_CAINFOPath of the proxy CA certificate. SSL_CERT_FILE is deliberately not set (it breaks Copilot API TLS).

Set conditionally:

VariableWhenValue
HIVE_ID, HIVE_SHA, HIVE_ADVISORY_ISSUEWhen set in the hive’s own environmentPassed through unchanged.
HIVE_REPO, HIVE_REPOSWhen the project has an org and at least repoorg/primary-repo, and the full comma-separated org/repo list. Policy templates target gh issue create --repo "$HIVE_REPO".
GH_HOSTGHE spokes with a configured forge hostForge hostname for the gh CLI; the gh wrapper pairs it with GH_ENTERPRISE_TOKEN.
ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, NO_PROXY, CLAUDE_CODE_MAX_OUTPUT_TOKENS, DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICInference-routed backendsLocal inference-translate endpoint, a synthetic per-agent key (sk-hive-<agent> - not a real credential), loopback proxy bypass, an output-token cap every fronted model accepts, and telemetry switched off at the source.
COPILOT_GITHUB_TOKENWhen the hive holds a Copilot auth tokenCopilot OAuth token (authenticates the AI model, not GitHub writes). Secret.
GITHUB_TOKENwhen App-authored PRs are enabled (AppAuthoredPRs), an App is configured, and the agent’s mode can pushThe per-agent tier-scoped App installation token, so the built-in GitHub MCP server writes as the App bot. Advisory agents have GITHUB_TOKEN deliberately stripped. Secret.
LINEAR_ACCESS_TOKEN / LINEAR_API_KEYISSUES_ONLY+ agents on Linear-connected hivesSee the Linear agent integration note above.
CLAUDE_CODE_OAUTH_TOKENLast resort: claude backend and no readable credential fileDashboard-obtained access token; never injected when the agent can read (and refresh) ~/.claude/.credentials.json itself. Secret.
BOBSHELL_API_KEY, BOBSHELL_DEFAULT_AUTH_TYPEbob backendThe resolved Bob API key (secret) and the literal api-key auth-type selector (non-secret by design - see the #2228 relaunch note in code).
BD_DIRWhen the agent has a configured beads_dirBeads data directory for the bd CLI.
HIVE_CAVEMAN_MODEWhen set in the agent’s configPassed through from caveman_mode.
HIVE_JEV_MODE, HIVE_JEV_ENDPOINTwhen the agent’s jev_mode is assistThe mode (assist) and the hive’s loopback Jev decision endpoint (http://127.0.0.1:18446) that hive jev decide calls. The Jev API key itself is never exported — the hive attaches it server-side.
HIVE_AGENT_TOKEN_CACHEPer-UID agentsPath of the agent’s cached scoped GitHub token (see hive-open-pr.md and troubleshooting.md).
HOME, XDG_DATA_HOME, XDG_STATE_HOME, DISABLE_AUTOUPDATERPer-UID agentsPer-agent home (#4596) and XDG data/state roots (#6238); XDG_CONFIG_HOME is deliberately not set (~/.config stays the shared credential/config bridge). The Claude CLI self-updater is disabled - the image pins the CLI version.
CODEX_HOMEcodex backendPer-agent Codex state directory (pre-created by the manager; codex refuses to create it itself).
HIVE_CONN_<NAME>_URL and connection auth varsPer configured api connectionSee the connection rows in Inference, CLI backends, and agents.

This table documents injected values, not operator knobs - setting any of these in hive.env does not configure the hive, and several (the secrets above) are overwritten or stripped per agent regardless. When agentEnvPairs gains, renames, or removes an injection, update this section in the same PR, exactly as the Keeping this reference current section requires for lookups.

Hub, SaaS, alerts, and backups

VariableRequiredDefaultPurpose
HIVE_HUB_OAUTH_CLIENT_IDRequired to enable hub OAuthnoneEnables hub /login and OAuth callback routes.
HIVE_CONTRIBUTE_DISCONNECT_GRACENo5sGo duration the contribute hub waits after a contributor socket dies before booking the task as abandoned_disconnect (activity row + run-log row). A relay that reconnects and resumes the task — or finishes it — inside the window withdraws the booking; the short #2356 release cooldown is still booked immediately. 0 restores the pre-#7838 synchronous booking.
HIVE_HUB_OAUTH_CLIENT_SECRETRequired when hub OAuth is enablednoneOAuth client secret used during callback token exchange.
HIVE_HUB_SLACK_BOT_TOKENNononeSlack bot token for hub Slack notifications.
HIVE_NTFY_SERVERNononentfy server for hub auth-audit alerts.
HIVE_NTFY_TOPICNononentfy topic for hub auth-audit alerts.
HIVE_BACKUP_KEYYes for hub DR backups; optional for spoke backupsnone64-character hex AES-256 key. For spoke backups it is now a fallback: owners set the key from Governor Config → Security → Backup (governor.backup.key_file), which takes precedence and needs no deployment access. With no key from any source, backup creation fails rather than writing plaintext.
HIVE_BACKUP_BUCKETRequired for OCI upload modenoneOCI Object Storage bucket for hub backup archives.
HIVE_BACKUP_DATA_DIRNo/dataHub data directory used by hive-backup.
HIVE_BACKUP_RETENTIONNo30Number of backup archives to retain.
HIVE_BACKUP_OCI_ENDPOINTNoOCI SDK default endpointOCI Object Storage endpoint override.
HIVE_HUB_NAMESPACENocurrent/default namespaceHub namespace override for backup collection.
HIVE_KUBECONFIG_DIRNo/etc/hive/kubeconfigsDirectory containing per-cluster kubeconfigs for remote spoke backup collection.
HIVE_SPOKE_BACKUP_DATA_DIRNo/dataSpoke data directory for on-demand spoke backup.
OCI_TENANCY_OCIDRequired for OCI FSS/Object Storage flowsnoneOCI tenancy OCID.
OCI_USER_OCIDRequired for OCI FSS/Object Storage flowsnoneOCI user OCID.
OCI_FINGERPRINTRequired for OCI FSS/Object Storage flowsnoneOCI API key fingerprint.
OCI_PRIVATE_KEYRequired for OCI FSS/Object Storage flowsnoneOCI API private key PEM content.
OCI_REGIONRequired for Object Storage backupnoneOCI Object Storage region.
OCI_FSS_REGIONRequired for OCI FSS provisioning unless region is otherwise configurednoneOCI File Storage region.
OCI_COMPARTMENT_IDRequired for OCI FSS provisioningnoneOCI compartment OCID.
OCI_AVAILABILITY_DOMAINRequired for OCI FSS provisioningnoneOCI availability domain.
OCI_MOUNT_TARGET_IDRequired for OCI FSS provisioningnoneOCI mount target OCID.
OCI_EXPORT_SET_IDRequired for OCI FSS provisioningnoneOCI export set OCID.
HIVE_HUB_ADMIN_USERNAMENoclubandersonSingle root hub admin GitHub username when HIVE_HUB_ADMINS is unset. Root admins are configuration-managed and cannot be revoked from the UI.
HIVE_HUB_ADMINSNononeComma-separated root hub admin identities (bare GitHub logins are treated as github:<login>). When set, this replaces HIVE_HUB_ADMIN_USERNAME. Root admins may grant or revoke additional hub admins from the dashboard; those UI grants are persisted in /data/hub-admins.json and do not become root admins.
HIVE_HUB_GITHUB_TOKENNononeHub-side GitHub token attached to every hub-originated api.github.com read: branch-tip polling, commit compares (channel distances, reach checks), commit messages/dates, workflow runs, the dibs public-repo check, and Hub Admin user affiliation/public-activity refreshes when a user token is unavailable. Unset = anonymous (60 req/h per IP, exhausted by the branch poller alone; distances and timestamps then vanish from the My Hives channel rows). Set it for 5000 req/h.
HIVE_REACH_REPO_DIRNonone (GitHub compare API)Local clone the reach ancestry check resolves against via git merge-base --is-ancestor. The hub image ships no clone, so the compare-API adapter is the default.
HIVE_REACH_NEVER_RAN_DAYSNo3Never-ran grace period in days (integer, > 0). Absent or invalid values fall back to the default.
HIVE_PROVISION_WORKERSNosaved scale setting, else built-in defaultProvision queue worker count. The saved dashboard scale setting takes precedence over this variable.
HIVE_PROVISION_PER_CLUSTERNosaved scale setting, else built-in defaultMaximum concurrent provisions per cluster.
HIVE_KUBECTL_MAX_PER_CLUSTERNosaved scale setting, else built-in defaultMaximum concurrent kubectl executions per cluster.
HIVE_UPGRADE_WAVE_SIZENosaved scale setting, else built-in defaultNumber of spokes upgraded per wave.
HIVE_UPGRADE_DEBOUNCE_SECONDSNobuilt-in defaultDebounce window before an upgrade wave starts.
HIVE_UPGRADE_MAX_HOLD_SECONDSNobuilt-in defaultMaximum time an upgrade may be held before proceeding.
HIVE_VANITY_REPAIR_SUCCESS_COOLDOWNNo24hGo duration a hive is skipped by the heartbeat-kick vanity-URL repair after a successful repair (mint or drift-adopt). of the #5923 guardrails (pkg/hub/saas_provision.go); the env overrides exist for emergency production tuning without a rebuild. Invalid or non-positive values fall back to the default.
HIVE_VANITY_REPAIR_FAILURE_BACKOFFNo1hGo duration the same repair path waits after a failed attempt before retrying a hive, preventing tight loops against unreachable clusters or an exhausted mint budget.
HIVE_VANITY_MINT_BUDGETNo20Fleet-wide cap (positive integer) on vanity-host certificate mints from the repair path per window — sized well under Let’s Encrypt’s 50 certificates / registered domain / 168h limit so the remainder stays reserved for claim-time provisioning.
HIVE_VANITY_MINT_WINDOWNo168hGo duration of the rolling window HIVE_VANITY_MINT_BUDGET is counted over.
HIVE_IMAGE_BUILD_STALE_AFTERNo90mGo duration a branch HEAD may stay non-ready (docker workflow queued/building, image not yet on GHCR) before the hub reports its latest_sha_image_status as stale on the dashboard (pkg/hub/saas.go).
HIVE_ADVISORY_ISSUE_AGING_AFTERNo45mAge (Go duration) after which a hive’s advisory digest is bucketed aging in hub fleet-row freshness reporting (pkg/hub/advisory_issue_activity.go). Must be set below HIVE_ADVISORY_ISSUE_STALE_AFTER: if stale ≤ aging, both thresholds silently revert to their defaults.
HIVE_ADVISORY_ISSUE_STALE_AFTERNo1h30mAge (Go duration) after which the same advisory-digest freshness struct is bucketed stale and drives the advisory-stale verdict. Same pairing rule as above: a value ≤ the aging threshold makes both revert to defaults.
HIVE_HUB_PUBLIC_URLNonone (chain continues)First variable in the hub public-origin chain used to build notification deep links and to match the hub domain suffix. Precedence: HIVE_HUB_PUBLIC_URL → HIVE_PUBLIC_URL → HIVE_HUB_BASE_URL → HIVE_DASHBOARD_URL → HIVE_HUB_URL, then the compiled-in canonical public origin (links) or the default cluster domain (suffix match).
HIVE_PUBLIC_URLNonone (chain continues)Second variable in the hub public-origin chain — see HIVE_HUB_PUBLIC_URL for the full precedence order.
HIVE_HUB_BASE_URLNonone (chain continues)Third variable in the hub public-origin chain — see HIVE_HUB_PUBLIC_URL for the full precedence order.

Spoke-side derived keys

A hub-hosted spoke is provisioned with the derived sub-keys it needs and never receives the master HIVE_HUB_SECRET. When of these is unset, the spoke derives the same domain-separated sub-key from HIVE_HUB_SECRET, so a spoke still rolling on an older Deployment keeps working. Both sources yield the identical key, so hub verification succeeds either way; a lookup fails closed when neither is configured.

VariableRequiredDefaultPurpose
HIVE_HEARTBEAT_KEYNoderived from HIVE_HUB_SECRETSpoke heartbeat signing sub-key.
HIVE_SESSION_KEYNoderived from HIVE_HUB_SECRETSpoke session-cookie signing sub-key.
HIVE_INVITE_KEYNoderived from HIVE_HUB_SECRETPer-hive contributor-invite signing key. Symmetric: the spoke both mints and verifies invite tokens with it.
HIVE_TERMINAL_KEYNoself-derived per-hive from HIVE_HUB_SECRET + HIVE_IDPer-hive terminal-assertion signing key. It never falls back to a fleet-uniform key.
HIVE_SSO_PUBLIC_KEYNononeEd25519 public key a spoke verifies hub-minted SSO handoff tokens with. Holding the public key, a spoke can verify but cannot mint.
HIVE_SSO_PUBLIC_KEY_PREVNononePrevious SSO public key, accepted during rotation so a spoke bridges a hub key change.
HIVE_SSO_KEYNononeLegacy symmetric SSO key, still read for release so spokes on a pre-cutover Deployment keep working.
HIVE_SESSION_PUBLIC_KEYNononeEd25519 public key (exactly 64 hex characters) the spoke’s Node proxy (src/proxy/server.js) verifies hub-minted session cookies with. Set at provisioning and kept converged by the hub’s per-hive env reconcile sweep (pkg/hub/perhive_env_reconcile.go) — do not hand-edit it on hosted spokes.
HIVE_SESSION_PUBLIC_KEY_PREVNononePrevious-generation session public key, also accepted by the proxy so terminal sessions keep verifying while a hub key rotation’s reconcile sweep walks the fleet (pkg/hub/hub_pubkey_generations.go). A deliberately separate variable — a <hex>,<hex> list in the primary would be silently truncated by Node and rejected by the Go verifier. Unset on an un-rotated fleet.

Hub login providers

HIVE_HUB_OAUTH_CLIENT_ID/_CLIENT_SECRET enable GitHub login. Additional human-login providers are OIDC-based and each is enabled by setting its client id (#3664). Per provider <P> in GOOGLE, IBMID, REDHAT, MICROSOFT, CUSTOM:

VariableRequiredDefaultPurpose
HIVE_HUB_OIDC_<P>_CLIENT_IDEnables the providernoneProvider is absent from the login picker until set.
HIVE_HUB_OIDC_<P>_CLIENT_SECRETYes when enablednoneOIDC client secret.
HIVE_HUB_OIDC_<P>_ISSUERRequired for IBMID and CUSTOMGoogle/Red Hat/Microsoft have built-in issuersOIDC issuer URL (discovery + JWKS).
HIVE_HUB_OIDC_<P>_SCOPESNoopenid email profileSpace- or comma-separated scope override.
HIVE_HUB_OIDC_<P>_DISPLAYNoprovider nameLogin button label override.
HIVE_HUB_OIDC_<P>_SUBJECT_CLAIMNosub (IBMid: uid)Claim used as the stable subject.
HIVE_HUB_OIDC_MICROSOFT_TENANTNoorganizationsEntra tenant segment of the issuer URL.
HIVE_HUB_OIDC_MICROSOFT_ALLOWED_TENANTSNononeRestricts accepted Entra tenants.

With two or more providers configured, /login renders a provider picker; with exactly it redirects straight into it. A provider with a client id but missing/invalid issuer is silently skipped so it cannot take down login for the others — check the hub login enabled providers= startup log line when a button is missing.

Kubernetes downward API and platform variables

VariableRequiredDefaultPurpose
POD_NAMESPACENoNAMESPACE, then defaultPreferred downward-API namespace value for dashboard/spoke identity.
NAMESPACENodefaultFallback namespace when POD_NAMESPACE is unset.
KUBERNETES_SERVICE_HOSTSet by KubernetesnoneUsed with KUBERNETES_SERVICE_PORT to detect in-cluster execution and build API URLs.
KUBERNETES_SERVICE_PORTSet by KubernetesnoneKubernetes API service port.
HOMESet by OS/containernoneUsed to locate CLI credentials in several backend probes.
PATHSet by OS/containernoneUsed by helper tests and inherited by subprocesses.

Contributor relay and top-level helper scripts

VariableRequiredDefaultPurpose
HIVE_HUBRequired after registration for contributor relay; just can discover/set itwss://hive.hivecommons.dev/contribute (the Justfile default; the legacy wss://hive.hivecommons.dev/contribute value is treated as unset and triggers the hive lookup)Contributor WebSocket hub URL. Comma-separated values are supported with matching HIVE_REGISTRATION_TOKEN entries.
HIVE_REGISTRATION_TOKENYes for contributor relaynoneContributor registration token. Comma-separated values match HIVE_HUB by position.
HIVE_COMMONS_STRATEGYNorankedMulti-hive routing strategy for The Commons. ranked keeps strict rank order and falls through when a hive has no work; spread does rank-weighted rotation with periodic mixing; neediest scores subscribed hubs by actionable_items plus idle contributor capacity from /api/contribute/status. Read between tasks.
HIVE_COMMONS_SPREAD_MIX_EVERYNo7In spread, choose randomly from the weighted rank cycle every N completed/failed tasks. 0 disables random mixing.
HIVE_COMMONS_NEEDIEST_REFRESH_MSNo60000In neediest, milliseconds between /api/contribute/status refreshes per subscribed hub. 0 disables the interval.
AGENT_BACKENDNoclaudeContributor/agent CLI backend selector.
AGENT_MODELNobackend default, or GOOSE_MODEL for Goose fallbackContributor/agent model override.
CONTRIBUTOR_MODENointeractiveContributor relay mode: interactive uses tmux; headless uses-shot CLI execution for supported backends.
HIVE_SESSIONNobackend name (AGENT_BACKEND)Optional session label for running multiple relays concurrently under GitHub account. The hub keys task leases, assignment cooldowns, failure streaks, and ownership fences on ContributorID#session, so distinctly labeled relays hold independent task slots; auth, trust tier, model admission, and rate-limit accounting stay per-account. Sanitized to [A-Za-z0-9._-], max 32 bytes. Set to the empty string to opt out (bare per-account identity, the historical single-session behavior). See src/docs/contributor-relay.md, “Running multiple backends under account”.
HIVE_AGENT_ROLENoempty stringOptional contributor role claim sent during relay authentication (for example scanner, quality, or outreach) so the hub can apply role-aware policy. Whitespace is trimmed.
HIVE_CONTRIBUTOR_QUOTA_POOL_ACCOUNTNononeAccount label attached to the published contributor quota reading (provider rotation, #6987). Deliberately independent of whether rotation itself is enabled — see src/docs/contributor-relay.md.
HIVE_CONTRIBUTOR_QUOTA_POOL_DIRNoper-install directory under the platform user config dir ($XDG_CONFIG_HOME honoured explicitly, then os.UserConfigDir()), joined with hive/contributor-quotaOverrides where the contributor quota reading is published and read from. An explicit value always overrides the derived default in both directions (publisher and relay); bin/contributor-relay.js must derive the identical default path or the two never see each other’s writes.
HIVE_CONTRIBUTOR_QUOTA_PUBLISHNoonOpt-out for the standalone contributor quota publisher (#10299). The contributor image entrypoint and just contribute-hive <cli> local start hive-quota-publisher alongside the relay, so an unattended contributor feeds its own quota guard with no custom reader and no local Hive server. Set to 0, false, off or no to launch without it; the publisher also stands down by itself when the guard is off, when HIVE_CONTRIBUTOR_QUOTA_READING_FILE/_JSON already supplies readings, or when the backend is not a supported subscription backend.
HIVE_AGENT_SESSIONNocontributortmux session name the interactive relay drives and prints in attach/restart commands. Distinct from HIVE_SESSION, which is the hub identity label.
HIVE_AGENT_CWDNorelay process working directoryDirectory the relay cds into before relaunching the backend CLI in tmux. Contributor entrypoints set it to the neutral launch directory so recovery does not restart the CLI inside the hive checkout.
HIVE_CONTRIBUTOR_USERNAMENoempty stringGitHub login for this contributor, exported by the contributor entrypoint after registration. The relay uses it to attribute detected PR URLs and skips authorship checks when it is unavailable.
HIVE_GH_TOKEN_CACHENo/var/run/hive-metrics/contributor-gh-token.cache when /var/run/hive-metrics exists, otherwise /tmp/hive-gh-token.cacheOwner-only file where the relay writes the task-scoped GitHub token delivered by the hub. The separate filename avoids clobbering the hub’s full-privilege installation-token cache.
HIVE_HEADLESS_STATUS_FILENo/tmp/contributor-headless-status.jsonStatus file written by headless contributor relay.
HIVE_TASK_FILENo/tmp/contributor-task.jsonOwner-only JSON snapshot of the current assigned task, with any task-scoped GitHub token stripped. A write failure is logged and does not abort the assignment.
HIVE_WORKSPACE_DIRNorelay process working directoryWorking directory for headless-shot CLI subprocesses. Contributor entrypoints set it to the task workspace granted to the backend CLI. The relay also substitutes this literal path for every $HIVE_WORKSPACE_DIR in the hub’s task prompt before typing it, on both the tmux and the headless path, so the agent’s non-shell file tools — which do not expand shell variables — get a real path (#7908).
HIVE_REPO_TOOLCHAIN_TIMEOUT_MSNo180000 (3 min)Time box, in milliseconds, on the relay’s bin/repo-toolchain.sh run that installs a repository’s declared .hive/tools manifest into the container venv before the task prompt is typed (#7925). Expiry kills the script and never fails the task: the relay logs it and the task proceeds on the baseline image alone, exactly as it does when the script is missing or errors. See contributor-relay.md, “Beyond the baseline, the repository declares what it needs”.
HIVE_REPO_TOOLCHAIN_PIP_TIMEOUTNo120Timeout, in seconds (not milliseconds — this wraps timeout(1)), that bin/repo-toolchain.sh puts on its single python3 -m pip install -- … call for the manifest’s pip lines, when the timeout command is available. A timed-out install is logged (the usual cause is a container without egress) and the task proceeds without the declared tools. Keep it below the overall HIVE_REPO_TOOLCHAIN_TIMEOUT_MS budget or the relay’s kill fires first.
HIVE_REPO_TOOLCHAIN_MAX_PIPNo32Cap on the number of pip requirement lines honoured from a .hive/tools manifest. A manifest declaring more than the cap installs nothing — the overflow is logged and the task runs on the baseline — rather than silently installing a prefix of the list.
HIVE_HEADLESS_TASK_TIMEOUT_MSNoHIVE_ABSOLUTE_TASK_DEADLINE_MS (default 14400000)Hard wall-clock ceiling, in milliseconds, for headless-shot CLI invocation. When it expires the relay kills the child and reports the task failed instead of leaving the pod hung.
HIVE_RELAY_MAX_OUTPUT_BYTESNo16777216 (16 MiB)Cap on the headless relay’s in-memory capture of the-shot CLI child’s combined stdout/stderr, so a chatty CLI cannot grow the buffer without bound (#7739). the last N bytes are kept — the tail is what matters for the audit trail, mirroring TMUX_TAIL_LINES on the interactive path — and when the cap trips, the reported output is prefixed with a [relay: captured output truncated to the last N bytes] notice before token redaction and tail/PR-URL extraction. Must be a positive integer; anything else silently falls back to the default. This bounds what the relay holds, not what it sends: the tail that travels in a task_complete/task_failed is separately clamped to fit the hub’s 64 KiB WebSocket read limit (#7932), so raising this cannot produce a frame the hub refuses.
HIVE_ABSOLUTE_TASK_DEADLINE_MSNo14400000 (4 h)Un-re-armable wall-clock ceiling, in milliseconds, on total elapsed time from task assignment. It bounds pathological tasks that keep producing output forever and is reported as an environment failure when crossed.
HIVE_PANE_STALL_TIMEOUT_MSNo1200000 (20 min)Interactive relay stall window, in milliseconds: if a task is considered working but the tmux pane stays byte-identical this long, the relay starts handing the task back as an environment failure.
HIVE_PANE_STALL_CONFIRM_TICKSNo2Number of consecutive progress ticks (minimum 1) that must confirm a pane stall before the relay gives up. Each tick rechecks for completion or new output first.
HIVE_CHROME_IDLE_GRACE_TICKSNo3Number of consecutive idle-complete progress ticks (minimum 1) the interactive relay waits before accepting an unverdicted completion as chrome_idle. New output resets the count.
HIVE_HUMAN_PRESENCE_IDLE_MSNo300000 (5 min)tmux client idle-age threshold, in milliseconds, used to decide whether an attached client still counts as active human presence. Active presence suppresses automatic retry/nudge actions that could type over a person.
HIVE_TMUX_COMMAND_TIMEOUT_MSNo15000Timeout, in milliseconds, for tmux commands issued while stopping, relaunching, or inspecting the live CLI.
HIVE_LIVE_CLI_FIRST_INTERRUPT_DELAY_MSNo1000Delay, in milliseconds, after the first Ctrl-C sent while quitting a live CLI for task exit/recovery.
HIVE_LIVE_CLI_SECOND_INTERRUPT_DELAY_MSNo2000Delay, in milliseconds, after the second Ctrl-C sent while quitting a live CLI for task exit/recovery.
HIVE_LIVE_CLI_SHELL_WAIT_TIMEOUT_MSNo5000Timeout, in milliseconds, for waiting until the tmux pane returns to a shell before respawning it during live-CLI recovery.
HIVE_LIVE_CLI_SHELL_WAIT_POLL_MSNo250Poll interval, in milliseconds, while waiting for the tmux pane to return to a shell.
HIVE_LIVE_CLI_RESPAWN_SETTLE_MSNo500Delay, in milliseconds, after tmux respawn-pane -k before the relay rechecks shell readiness.
HIVE_CLAUDE_PROJECTS_DIRNo$HOME/.claude/projectsClaude transcript directory used for best-effort model auto-detection. The relay reads tail bytes needed to find the latest model field.
HIVE_COPILOT_SESSIONS_DIRNo$HOME/.copilot/session-stateCopilot session-state directory used for best-effort model auto-detection. The relay reads tail bytes needed to find the latest model field.
HIVE_BOB_DIRNo$HOME/.bobBob CLI home directory used for best-effort model auto-detection from local transcript state.
HIVE_OMP_AGENT_DIRNoPI_CODING_AGENT_DIR, then $HOME/.omp/agentOMP agent directory used for model/advisor auto-detection; the relay reads config.yml and session sidecars under this directory when present.
HIVE_RELAY_TEST_TIMINGNodisabledTest-only timing accelerator. Set exactly 1 to shorten the relay progress-report interval from 120000 ms to 100 ms. Production runs should leave it unset.
HIVE_RELAY_TEST_MODENodisabledTest-only module mode. Set exactly 1 to export relay internals, skip opening a hub connection, make sleeps no-ops, and avoid exiting on unsupported headless backends. Production runs should leave it unset.
HIVE_ENTRYPOINT_HOOK_DIRNo/etc/hive/entrypoint.dDirectory of *.sh hooks sourced by the contributor entrypoint after contributor.env/backends.conf load and before backend detection and the tmux launch — the extension seam for derived contributor images (#2393 item 4). Hooks can export env the agent inherits and override helpers like backend_binary(). See “Extending the contributor image” in contributor-relay.md.
HIVE_PRE_AGENT_HOOKNononeShell snippet eval’d by the contributor entrypoint immediately after the HIVE_ENTRYPOINT_HOOK_DIR hooks, with the same ordering and override semantics. Runs verbatim with the entrypoint’s privileges — treat its value as trusted code.
HIVE_CONTRIBUTOR_IMAGENoghcr.io/hivecommons/hive-contributor:latestImage used by just contribute-hive.
HIVE_CONTAINER_RUNTIMENoautodetect docker or podmanContainer runtime override for contributor helpers. just contribute-hive also passes the runtime it resolved into the container, so the attach hints printed from inside it name the engine that actually launched it rather than assuming docker (#5145).
HIVE_CONTAINER_NAMENohive-contributorSet by just contribute-hive on the container it starts. The contributor entrypoint and relay read it for their attach hints; unset means the relay is running in local mode, where the hint is a plain tmux attach.
HIVE_SKIP_VERSION_CHECKNofalseSkips just version freshness check when set to true.
HIVE_SKIP_PULLNofalseSkips contributor image pull when set to true.
HIVE_KEEP_CONTAINERNoremove failed contributor containerKeeps failed contributor containers for debugging when set to true.
HIVE_OMP_CREDENTIAL_SYNC_SECONDSNo300How often just contribute-hive omp (container mode) copies an OAuth credential the container’s omp refreshed back into the host’s ~/.omp/agent/agent.db while the container runs; the same copy-back always runs more when the container exits. An OAuth refresh token is single-use, so without this the host’s copy is revoked by the container’s first refresh (#7922). Set 0 to sync at exit.
HIVE_PROJECT_CONFIGNo/etc/hive/hive-project.yamlPath read by bin/hive-config.sh for deterministic pipeline/project metadata.
HIVE_PROJECT_YAMLNo/etc/hive/hive-project.yaml, then first example foundPath read directly by pipeline stages, and by the hive binary for the project-file key it consumes, classification.review_bots (see review-bot-threads.md).
HIVE_RUNTIME_CONFIGNo/etc/hive/hive-runtime.yamlRuntime overlay read by bin/hive-config.sh.
HIVE_REPO_DIRNo/tmp/hiveHive checkout path used by top-level deployment scripts. Must not be empty or /.
HIVE_BINNo/usr/local/binDirectory containing helper binaries such as gh-app-token.sh.
HIVE_REPOSRequired by v1/top-level supervisor scripts if project config is absentnoneSpace-separated repos for legacy/top-level script workflows.
HIVE_BACKENDSNocopilot in bootstrap exampleBackend list for legacy/top-level script setup.
HIVE_MODEL_SERVICESNononeOptional local model stack selector in legacy bootstrap scripts.
HIVE_AUTO_INSTALLNoscript defaultControls CLI auto-install in legacy bootstrap scripts.
AGENT_SESSION_NAMENohive in config/agent.env.exampletmux session name for legacy/top-level supervised agent scripts.
AGENT_LOOP_PROMPTNoexample executor promptPrompt sent by legacy/top-level supervisor scripts.
AGENT_READY_MARKERNoconfigured in agent.envTUI marker used by legacy/top-level supervisor readiness checks.
AGENT_AUTO_APPROVE_PHRASENononeLegacy/top-level supervisor phrase used to auto-dismiss a known prompt.
AGENT_LOG_FILENoconfigured in agent.envLegacy/top-level heartbeat/healthcheck log path.
NTFY_TOPICNohive in bin/kick-agents.sh; blank disables bin/notify.shntfy topic for top-level script notifications.
NTFY_SERVERNohttps://ntfy.shntfy server for top-level script notifications.
SLACK_WEBHOOKNononeSlack incoming webhook for top-level script notifications.
DISCORD_WEBHOOKNononeDiscord webhook for top-level script notifications.

Issue triage

VariableRequiredDefaultPurpose
HIVE_QUESTION_AUTOCLOSENounset (config governor.question_autoclose.enabled, default false)Turns question auto-close on or off, overriding the config value when set to a boolean (true/false/1/0). See labels-and-control-signals.md (#9584).
HIVE_QUESTION_AUTOCLOSE_HOURSNo4 (config governor.question_autoclose.hours)Hours an answered question stays open for the author to react 👎 before Hive closes it as completed. Non-positive or non-numeric values are ignored.

Credly badge integration (proposed — not implemented)

No code reads these variables. The Credly integration is a design (Credly badges); Hive ships the contributor-card placeholder and the milestone mapping. There are no live Credly API calls, credentials, or badge issuance. Setting these today has no effect.

They are listed here so the central reference does not appear to contradict credly-badges.md, and so the names are reserved. Treat the table as a design record until the feature ships — at which point these rows move into the sections above and gain real defaults.

VariableRequiredDefaultPurpose
HIVE_CREDLY_ORG_IDn/a — proposednoneCredly issuing organization id.
HIVE_CREDLY_API_TOKENn/a — proposednoneCredly Issuer API token. A live issuing credential when the feature ships: supply it by environment or secret reference, never in hive.yaml and never committed. Until then, unset leaves the card in placeholder mode.
HIVE_CREDLY_TEMPLATESn/a — proposednoneJSON map of milestone id → Credly badge template id.

Keeping this reference current

The code is authoritative and this table is hand-maintained, so it drifts unless PRs update it. If your change adds, renames, or removes an environment variable lookup, update this file in the same PR.

A CI guard (TestEnvVarsDocDocumentsOnlyRealVariables, in src/pkg/config/env_vars_doc_parity_test.go) enforces one direction of this: every variable given a table row here must actually appear in the implementation, so the reference cannot document something nothing reads. It is-directional on purpose — env var names reach os.Getenv through package constants, config-resolved struct fields, injected getenv parameters, and local wrapper helpers, so no static check can enumerate the full set of variables the code reads.

The converse is therefore not enforced: adding a lookup without adding a row here will not fail CI. Keeping this file complete remains a human responsibility, which is what the rest of this section is for.

What counts as a change that needs an entry:

  • A new os.Getenv or os.LookupEnv call in src/ — most live in src/pkg/hub, src/pkg/dashboard, src/pkg/agent, and src/pkg/config.
  • A new variable referenced from a deployment manifest under src/deploy/, or from a top-level helper script in bin/.
  • A change to an existing variable’s default, or to whether it is required.

What each column means:

ColumnWhat to write
VariableThe exact name, in backticks.
RequiredNo for anything with a working default. Spell out the condition when it is conditional (see HIVE_GITHUB_TOKEN).
DefaultThe literal fallback value, or none. If the fallback is a lookup chain, describe the order — precedence is the part operators get wrong.
PurposeWhat it controls and which component reads it. Link to a deeper section when the variable has real setup steps.

Add the row to the section matching the component that reads the variable, and run the searches below to confirm nothing else was missed. exception to “the code is authoritative”: a proposed variable that no code reads yet may be listed, but in a section explicitly marked as such (see Credly badge integration). The marking is the whole point — an operator must never set a variable from this file and have it silently do nothing. When the feature ships, move those rows into the section for the component that reads them.

Verification commands

The table above was cross-checked with these mechanical searches from the repository root:

rg 'os\.(Getenv|LookupEnv)\(' src --glob '*.go'
rg '\bHIVE_[A-Z0-9_]+\b|\bBD_DIR\b|\bGH_APP_KEY_FILE\b|\bAGENT_BACKEND\b' src bin config Justfile
rg '\b(ANTHROPIC|COPILOT|GOOSE|BOBSHELL|OCI|KUBERNETES|POD|NAMESPACE|DASHBOARD|PROXY|SLACK|DISCORD|NTFY)_[A-Z0-9_]+\b' src bin config Justfile
rg 'HIVE_[A-Z0-9_]+|BD_DIR|GH_APP_KEY_FILE|AGENT_BACKEND' src/deploy