Skip to main content
Cordon ships dedicated integrations for Claude Code, Codex, Hermes, and OpenClaw. For anything else — a Next.js app, a Python service, a Go binary, a shell script — you route traffic through cordon by setting a handful of environment variables. This guide documents that contract.

The env-var contract

Cordon terminates TLS locally, which requires the calling process to:
  1. Send HTTP(S) traffic through the Cordon proxy URL from cordon env, and
  2. Trust the cordon CA so the terminated TLS handshakes validate.
The env vars below express both. They are the same vars every cordon integration sets under the hood — there is nothing special about “generic” mode. The combined bundle (combined-ca.pem) is generated at setup time by concatenating your system CA trust store with the cordon CA. Runtime-specific exceptions are covered in SDK Compatibility. Tokenized proxy URLs are sensitive local configuration; do not commit them or paste them into logs and shared chats. In tokenized proxy URLs, <audience> is Cordon’s local token audience: user for the user scope or a project namespace such as myapp-a1b2c3d4. This is not an OAuth/OIDC audience claim; it is a local guardrail that helps Cordon reject a token presented to the wrong Cordon daemon.

Getting the values

You don’t derive these by hand. cordon env prints them for the current scope’s cordon.toml:
Output (shell format, default):
See cordon env for the full command reference (fish, dotenv, and json formats, and the --scope flag).

Applying them

Pick whichever fits your workflow.

Current shell (bash / zsh)

fish

direnv (.envrc)

Reload with direnv allow after adding. Traffic from commands run in that directory flows through cordon.

mise (.mise.toml)

Then reference _.file = ".mise.cordon.env" in your .mise.toml.

dotenv (.env)

Programmatic / CI

Pipe into jq or parse with your language’s JSON library. The output is a flat object of environment variable names to string values, so scripts can safely export every top-level entry.

Verifying it works

With the env vars exported and cordon running (cordon start), make a request to a host you’ve configured a route for:
Expect a response from the real API with cordon injecting the Authorization header on its way out. If TLS verification fails, see TLS troubleshooting. Run cordon doctor if anything feels off.

When to use which scope

  • cordon env (default, --scope project) reads ./cordon.toml. Use this when you have a per-project setup.
  • cordon env --scope user reads ~/.config/cordon/cordon.toml. Use this for a user-wide cordon instance shared across projects.
Scopes map to separate daemons with separate ports — see Scopes for the reference.