Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

5.6 KB
Raw Blame
# --- backend (central product API) configuration ---

# The single port the web connects to. Serves the control API (/api/auth, /api/users,
# /api/agents, /api/health) locally and reverse-proxies every other /api/* + the /api/ws
# WebSocket to the agent-manager (data plane).
PORT=8085

# Dedicated PUBLIC subdomain app-proxy port. Traffic to <sub><APP_DOMAIN_SUFFIX> hits this listener
# (Host-header routed → owning manager's app-proxy), separate from the api-key control/proxy plane on PORT.
PORT_APP_PROXY=8087
# Domain suffix stripped from the Host header to get the subdomain (e.g. foo.harness.autonomous.ai → "foo").
APP_DOMAIN_SUFFIX=.harness.autonomous.ai

NODE_ENV=development

# Shared registry DB — MUST be the same MongoDB (and database) the agent-manager uses, so the
# backend reads `managers` (publicHost + apiKey + capacity) and resolves which manager to reach
# per agent. Backend owns `users` + `agent_bindings`. Prisma needs a replica set (single-node ok).
DATABASE_URL=mongodb://localhost:27017/harness?replicaSet=rs0

# Redis for the cross-instance data bus (inverted WS transport). Behind a load balancer an agent's web
# socket and its manager socket may land on different backend instances; Redis pub/sub bridges them
# (channels up:{agentId}/down:{agentId} + presence). Run redis on the host (or a container published on
# 6379). See docs/plans/2026-07-09_invert-ws-transport-backend-hub-redis.md.
REDIS_URL=redis://127.0.0.1:6379

# STUN-only direct WebRTC for CLI-to-CLI remote terminals. If ICE cannot connect, terminal traffic
# stays on the existing WebSocket relay; no TURN service is used. Set to 0 for the kill switch.
TERMINAL_P2P_ROLLOUT_PERCENT=100
# Comma-separated, sliced to 8. The CLI probes them all at once and uses whichever answers first.
TERMINAL_P2P_STUN_URLS=stun:stun.cloudflare.com:3478,stun:stun.cloudflare.com:53,stun:stun.l.google.com:19302,stun:stun2.l.google.com:19302,stun:global.stun.twilio.com:3478,stun:stun.nextcloud.com:443,stun:stun.ekiga.net:3478,stun:stun.voipgate.com:3478
# 2500 so a TURN-relayed channel (measured ~1372ms to open) wins the first-terminal gate.
TERMINAL_P2P_OPEN_WAIT_MS=2500

# Cloudflare Realtime TURN. Leave the key id empty to disable TURN entirely (STUN-only, pre-TURN
# behaviour) — that is also the kill switch. https://developers.cloudflare.com/realtime/turn/
TERMINAL_P2P_TURN_KEY_ID=
TERMINAL_P2P_TURN_API_TOKEN=
TERMINAL_P2P_TURN_TTL_SECONDS=7200
TERMINAL_P2P_TURN_TIMEOUT_MS=5000

# Public app-proxy safety limits.
APP_PROXY_MAX_REQUEST_BYTES=104857600
APP_PROXY_MAX_RESPONSE_BYTES=536870912
APP_PROXY_MAX_WS_FRAME_BYTES=8388608
APP_PROXY_MAX_STREAMS_PER_SUBDOMAIN=128
APP_PROXY_IDLE_TIMEOUT_MS=300000

# No MANAGER_URL / MANAGER_API_KEY here — the backend gets each manager's publicHost + apiKey
# from the `managers` collection (each manager publishes its own via PUBLIC_HOST + MANAGER_API_KEY).

# Production is the default for new users. Existing pre-split rows are backfilled as staging;
# admins opt individual new users into staging via User.autonomousEnv.
SSO_ISSUER=https://auth.autonomous.ai
SSO_PROFILE_URL=https://apiv2.autonomous.ai/api/v1/me/profile
# Asked before SSO_PROFILE_URL (which stays the fallback on a 404). '' turns it off. Move this whenever you move SSO_PROFILE_URL.
SSO_IDENTITY_URL=https://apiv2.autonomous.ai/api/v1/me/identity
STAGING_SSO_ISSUER=https://auth.staging.autonomousdev.xyz
STAGING_SSO_PROFILE_URL=https://apiv2.staging.autonomousdev.xyz/api/v1/me/profile
STAGING_SSO_IDENTITY_URL=https://apiv2.staging.autonomousdev.xyz/api/v1/me/identity
# Optional when staging uses a different OAuth client; otherwise SSO_CLIENT_* is reused.
# STAGING_SSO_CLIENT_ID=
# STAGING_SSO_CLIENT_SECRET=
SSO_PROFILE_TIMEOUT_MS=5000
# How long a token the profile API accepted is trusted before asking again (0 = ask every request).
# Also the longest a token revoked at the SSO keeps working here.
SSO_PROFILE_CACHE_TTL_MS=60000

# New managed harness checkout (enabled by default). Before production boot, both backend + manager
# must share the same random 32-byte base64 encryption key (`openssl rand -base64 32`). Set false
# only as a rollback switch; then only Remote is offered for new harnesses.
HARNESS_BILLING_ENABLED=true
AUTONOMOUS_BFF_URL=https://apiv2.autonomous.ai
STAGING_AUTONOMOUS_BFF_URL=https://apiv2.staging.autonomousdev.xyz
# Worker-only subscription sync. Keys require subscriptions:read and are intentionally separate
# because production and staging campaign services have independent credentials.
AUTONOMOUS_CAMPAIGN_API_URL=https://campaign-api.autonomous.ai
STAGING_AUTONOMOUS_CAMPAIGN_API_URL=https://campaign-api.staging.autonomousdev.xyz
AUTONOMOUS_CAMPAIGN_API_KEY=
STAGING_AUTONOMOUS_CAMPAIGN_API_KEY=
AUTONOMOUS_CHECKOUT_ORIGIN=https://autonomous.ai
STAGING_AUTONOMOUS_CHECKOUT_ORIGIN=https://staging.autonomousdev.xyz
AUTONOMOUS_BFF_TIMEOUT_MS=10000
HARNESS_CAMPAIGN_CODE=ai-harness-device
HARNESS_DEVICE_TYPE=15
HARNESS_DEVICE_TIMEZONE_DEFAULT=Asia/Saigon
# Optional explicit page; default is WEB_URL/harness-checkout. Stripe-hosted plan changes require
# HTTPS, so local end-to-end billing must set this to an HTTPS tunnel pointing at the web app.
HARNESS_CHECKOUT_CALLBACK_URL=
HARNESS_CREDENTIAL_ENCRYPTION_KEY=

# Comma-separated emails that get role=admin when first created (login auto-creates users).
ADMIN_EMAILS=

# Creature availability (daemons/README.md, "Off switches"). Every account must still opt in through
# Experimental settings; missing choices are off. Explicit false disables the module and its routes.
# HARNESS_DAEMONS_USERS optionally limits availability to comma-separated user ids or emails.
HARNESS_DAEMONS=true
HARNESS_DAEMONS_USERS=