Environment variables
What Veris reads from your shell, and what it sets for the code under test.
You sign in with veris login, which saves the key it pairs under a profile in
~/.veris/twin.yaml, and a project’s environments live in .veris/twin.yaml. So
none of the variables below is needed to get started. Each is read when it is set,
and where a flag says the same thing the flag wins.
Vendor credentials are not among them: your code keeps the ones it already has, and any well-formed value authenticates by default. See Credentials.
What Veris reads
| Variable | What it is |
|---|---|
VERIS_API_KEY | The key every command sends, ahead of the profile’s own |
VERIS_API_BASE | Control plane. Defaults to https://svc.api.veris.ai. Only set it for a non-production deployment |
VERIS_PROFILE | Which login to use, when you hold more than one |
VERIS_ENV | Which environment in .veris/twin.yaml a command acts on |
VERIS_ENVIRONMENT_ID | An environment id, for when nothing else names an environment |
VERIS_SANDBOX_ID | Attach runs to one sandbox instead of the one this folder remembers |
VERIS_PROXY_CONFIG | A proxy config file, used exactly as written |
VERIS_TUNNEL_TOKEN | cloudflared named-tunnel token: the default for --expose-token |
VERIS_SYSTEM_CA_BUNDLE | The file to read the system trust roots from, when they are not at one of the usual paths |
VERIS_API_KEY outranks the profile you logged in with, and unless the shell names
the plane as well the shell’s key is sent to the profile’s plane. veris doctor
warns when the two differ, and veris whoami names which key a command would use.
Precedence
Every value takes the most explicit source that says anything:
environment --env → $VERIS_ENV → the folder's "use" → the project default →
the profile's default_environment → $VERIS_ENVIRONMENT_ID
profile --profile → $VERIS_PROFILE → the environment's own "profile" →
active_profile → "default"
api key --api-key → $VERIS_API_KEY → the profile
api base --api-base → $VERIS_API_BASE → the profile → https://svc.api.veris.ai
sandbox --sandbox → $VERIS_SANDBOX_ID → the sandbox this folder remembers
routing --config → --sandbox → $VERIS_PROXY_CONFIG → $VERIS_SANDBOX_ID →
the sandbox this folder remembersNot every command defines every flag named there. --profile is a global of the
command tree, and the three commands that parse their own flags — run, serve
and check — take none; --api-key is the other way round, a flag of run and
serve that no tree command defines, and check defines neither. A flag a
command does not define is a usage error rather than a no-op, so across that line
the variable is the way in: $VERIS_PROFILE picks the login a run resolves
with, and $VERIS_API_KEY the key any command sends. veris <command> --help
lists what that command takes.
Layers never merge. A local file naming an environment hides the project’s default
entirely, rather than filling in around it. The pointer at the end of the routing
chain is the one veris up wrote into .veris/twin.local.yaml, which is why a bare
veris run in that folder routes at the right sandbox with no flag at all.
Installing
The install script reads two of its own: VERIS_INSTALL_DIR for where the binary
goes, ~/.local/bin otherwise, and VERIS_PROXY_VERSION to pin a version instead of
taking the latest release.
What Veris sets
Inside a run, so the code under test needs no change of its own:
| Variable | When | What it is |
|---|---|---|
VERIS_SANDBOX_ID | Always | So a nested run attaches to the same sandbox |
VERIS_PUBLIC_URL | With --expose | Where callbacks reach your app |
| One per unrouted twin | When a twin serves no vendor hostname | That twin’s URL, under the variable name the twin already uses |
Alongside those, a run sets the proxy and certificate variables each runtime reads —
HTTP_PROXY and its lowercase twin, NO_PROXY, NODE_EXTRA_CA_CERTS,
REQUESTS_CA_BUNDLE, SSL_CERT_FILE, CURL_CA_BUNDLE and the rest — and
JAVA_TOOL_OPTIONS when a JKS truststore is in play. With --image the redirect
moves into the kernel and the routing half is left out, since the container needs
only to trust the certificate.
The last row is the twin whose traffic is not intercepted at all: a database or
another data plane, or any twin the control plane serves no vendor hostname for. Your
code keeps reading the variable name it already reads, and the run sets that name to
the twin’s URL, announcing each one as
veris: <service>: not proxied; handed <VAR>=<url>. A variable you set yourself with
-e is never overwritten. veris sandbox exports prints every twin’s variable name
and URL for a sandbox that is up, handed over or not.
veris check proves the proxy in front of a command belongs to this run rather than
to an older one, and exits 2 when it does not. It reads $VERIS_PROXY_URL and
$VERIS_CANARY, or takes --proxy and --expect-canary.
The runner image
ghcr.io/veris-ai/veris-cli:runner is the proxy as its own container, which
veris run --image starts for you. Started by hand — from a compose file, or a CI
job that wires the containers itself — it takes its instructions the same way:
| Variable | What it is |
|---|---|
VERIS_SANDBOX_ID | The sandbox to route at. With VERIS_API_KEY for the first fetch |
VERIS_ENVIRONMENT_ID | Deploy a sandbox from this environment instead, with VERIS_TTL_MINUTES to bound it |
VERIS_CONFIG | The config file it routes from when neither is named, /veris/config.json otherwise |
VERIS_STRICT | Block unmapped hosts with 421 instead of letting them reach the real internet |
VERIS_EXPOSE | The local port to publish at a public HTTPS URL, with VERIS_EXPOSE_HOST for the host it is on |
VERIS_TUNNEL_HOSTNAME | The hostname a named tunnel serves, with VERIS_TUNNEL_TOKEN |
VERIS_LOG_LEVEL | debug, info, warn or error. info otherwise |
VERIS_LOG_FORMAT | json, which is this image’s default, or text |
VERIS_PROXY_UID | The uid the proxy drops to, 14741 otherwise. Your container must not run as it |
VERIS_PROXY_PORT | The port the proxy listens on, 8080 otherwise |
VERIS_TRANSPARENT_HTTP_PORT | Where the kernel redirect sends plaintext, 8081 otherwise |
VERIS_TRANSPARENT_HTTPS_PORT | Where it sends TLS, 8443 otherwise |
VERIS_CA_DIR | Where the certificate and its private key live, /veris/ca otherwise |
VERIS_STATE_DIR | Where the proxy writes once it has dropped its privileges, /veris otherwise |
VERIS_SHARE_DIR | Where the workload’s environment file and certificates land, /veris-share otherwise |
It runs veris serve, which reads VERIS_API_KEY, VERIS_API_BASE and
VERIS_TUNNEL_TOKEN inside the container exactly as it would outside one.
With neither a sandbox nor an environment named, it routes from the config file —
/veris/config.json, or wherever VERIS_CONFIG points — and refuses to start when
there is none. Before it runs your command it sets VERIS_PROXY_URL and runs
veris check against that proxy, and refuses the command when interception is not
live.