Skip to main content
Copy .env.sample to .env. None of these are required to boot — set the ones whose feature you use. A missing key surfaces when that feature runs: the built-in tools raise their own clear error at call time, and the model provider raises a key-named error when the agent is built.

Provider / tool keys

Env varPurpose
OPENAI_API_KEYDefault openai:gpt-5.4 model. Skip it if you pass your own model.
LINKUP_API_KEYThe web_search example tool (examples/tools/websearch.py).
TAVILY_API_KEYThe fetch example tool (examples/tools/fetch.py).
LANGFUSE_SECRET_KEY / LANGFUSE_PUBLIC_KEYTracing (optional).
LANGFUSE_HOSTOptional Langfuse host override.

SDK defaults

Env varPurpose
HEXGATE_DEFAULT_MODELModel used when you don’t pass model= explicitly (default openai:gpt-5.4).
HEXGATE_DEFAULT_SEARCH_ENGINEEngine for the web_search example tool (default linkup).

Platform connection

Env varPurpose
HEXGATE_API_KEYfty_live_… / fty_test_… token. Wakes up the platform path; without it, adapters and load_agent fall back to local / registered resolution.
HEXGATE_API_URLPlatform endpoint. Defaults to Hexgate Cloud (https://app.hexgate.ai). Set to http://localhost:8000 only when self-hosting locally — the key must be minted by whichever platform this points at.
HEXGATE_LOCAL_MODETruthy value forces local audit and shorts the platform auto-bind path, even when HEXGATE_API_KEY is set. hexgate chat sets this automatically.
HEXGATE_BIND_AGENTSTruthy value opts a code-built agent into the platform path at construction time (requires HEXGATE_API_KEY — the platform path is otherwise opt-in).
The key and the URL are coupled: a fty_live_… key only verifies against the platform instance that minted it.
HEXGATE_API_KEY was renamed from HEXGATE_KEY, which is no longer read. If you’re upgrading, rename it in your .env — an old HEXGATE_KEY is silently ignored and the platform path never wakes up.

Policy-bundle enforcement

All optional — see WASM bundles and local override.
Env varPurpose
HEXGATE_LOCAL_POLICYPath to a bundle directory or a policy.yaml; routes enforcement through the WASM engine and hot-reloads on save.
HEXGATE_BUNDLE_PUBKEY_PATHbase64url Ed25519 public key used to verify a bundle’s signature.
HEXGATE_BUNDLE_SIGN_KEY_PATHbase64url Ed25519 private key used to sign locally-compiled yaml sources (so bundle.is_signed is True).
HEXGATE_BUNDLE_REQUIRE_SIGNATUREtrue to refuse unsigned or unverifiable bundles (default: warn only).
HEXGATE_OPA_BINOverride the opa binary location (default: search PATH).

Self-hosted platform (control plane)

Read from the real environment or platform/api/.env. See control plane and email.
Env varPurpose
DATABASE_URLPostgres DSN. Unset → local SQLite. Bare postgres:// URLs are normalized to the asyncpg driver.
RESEND_API_KEYResend API key — enables ResendEmailSender when paired with HEXGATE_EMAIL_FROM.
HEXGATE_EMAIL_FROMFrom-address on a verified Resend domain, e.g. "Hexgate <noreply@yourdomain.com>".
HEXGATE_DASHBOARD_URLLink host embedded inside verification / reset emails.