> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vendo.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables for Vendo host, sandbox, and peers

> Every environment variable Vendo reads across host process, sandbox runs, and peer providers, with the effect each has on the composition and CLI.

## Host process

| Variable                                         | Effect                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `VENDO_API_KEY`                                  | activates cloud-gated sharing, publishing, org overlays, pinning, organization workspaces (`orgs` capability), and the hosted `vendoSandbox()` broker after entitlement verification                                                                                                                                                                                                                         |
| `VENDO_CLOUD_URL`                                | overrides the Vendo Cloud base URL for the runtime and CLI; defaults to `https://console.vendo.run`                                                                                                                                                                                                                                                                                                          |
| `VENDO_TELEMETRY_DISABLED=1`                     | disables build and development telemetry                                                                                                                                                                                                                                                                                                                                                                     |
| `VENDO_TICK_SECRET`                              | bearer secret required by `POST /tick`                                                                                                                                                                                                                                                                                                                                                                       |
| `VENDO_BASE_URL`                                 | trusted host origin used for server-side execution of extracted route tools, for marking the anonymous-session cookie `Secure` behind a TLS-terminating proxy, and as the MCP door's canonical public base: discovery metadata (issuer, endpoints, `resource`) and token audience binding derive from it instead of the proxy-internal request origin; set it in every proxied deployment with the door open |
| `VENDO_URL`                                      | base URL that `vendo doctor` probes for the live `/status` check and that `vendo sync` queries for blast-radius impact; defaults to `http://localhost:3000/api/vendo`, overridden per run by `--url`                                                                                                                                                                                                         |
| `VENDO_PROXY_URL`                                | tool-proxy URL injected into app machines by the default composition                                                                                                                                                                                                                                                                                                                                         |
| `VENDO_POSTHOG_KEY`                              | overrides the telemetry project key                                                                                                                                                                                                                                                                                                                                                                          |
| `DO_NOT_TRACK=1`                                 | disables telemetry and is also honored by Scarf                                                                                                                                                                                                                                                                                                                                                              |
| `CI`                                             | disables telemetry                                                                                                                                                                                                                                                                                                                                                                                           |
| `NODE_ENV=production`                            | disables build and development telemetry at runtime                                                                                                                                                                                                                                                                                                                                                          |
| `E2B_API_KEY`                                    | default key read by the E2B SDK when `e2bSandbox` receives no explicit `apiKey`; also auto-selects the E2B execution venue in `createVendo` when no `sandbox:` is passed and the optional `e2b` package is installed                                                                                                                                                                                         |
| `MODAL_TOKEN_ID`, `MODAL_TOKEN_SECRET`           | together auto-select the Modal execution venue in `createVendo` when no `sandbox:` is passed, `E2B_API_KEY` is unset, and the optional `modal` package is installed                                                                                                                                                                                                                                          |
| `VERCEL`, `CF_PAGES`, `AWS_LAMBDA_FUNCTION_NAME` | prevent the default PGlite store from opening on an ephemeral serverless filesystem; pass a Postgres URL instead                                                                                                                                                                                                                                                                                             |
| `VENDO_STORE_ENCRYPTION_KEY`                     | 32-byte base64 key the default composition uses to encrypt secret values in `vendo_secrets`; provisioned by `vendo init` and read when no store is passed to `createVendo`. An explicitly configured store ignores it                                                                                                                                                                                        |

`VENDO_TICK_SECRET`, `VENDO_BASE_URL`, `VENDO_PROXY_URL`, and
`VENDO_POSTHOG_KEY` are implementation-level environment configuration. The
frozen contracts define the corresponding bearer, route origin, proxy, and
telemetry seams without requiring those names from custom compositions.

## App machine environment

The apps runtime injects these values:

| Variable              | Contents                                                             |
| --------------------- | -------------------------------------------------------------------- |
| `PORT`                | port on which the app server must listen                             |
| `VENDO_PROXY_URL`     | guarded host-tool and secret-egress proxy for the run                |
| `VENDO_RUN_TOKEN`     | short-lived bearer token scoped to app, principal, run, and presence |
| declared secret names | opaque `vendo-secret:<name>:<nonce>` handles, never values           |

When `VENDO_PROXY_URL` and `VENDO_RUN_TOKEN` are both present, the runtime's
in-machine fetch shim routes outbound `fetch()` calls to external hosts through
the proxy's egress route, where secret handles are substituted for allowlisted
hosts only. See [Secrets and outbound requests](/concepts/generated-ui#secrets-and-outbound-requests).

The proxy authenticates every request with `VENDO_RUN_TOKEN` and enforces the
app's declarations. It exposes:

| Path                        | Methods            | Purpose                                                               |
| --------------------------- | ------------------ | --------------------------------------------------------------------- |
| `/state`                    | GET · PUT          | the app's own `/state` document (JSON, 256 KB cap)                    |
| `/data/<collection>`        | GET                | list records with `refs.<key>=<value>`, `limit`, and `cursor` filters |
| `/data/<collection>/<id>`   | GET · PUT · DELETE | read or write a declared record (JSON, 256 KB cap)                    |
| `/files/<collection>`       | GET                | list blob keys in a declared file collection                          |
| `/files/<collection>/<key>` | GET · PUT · DELETE | read or write a blob (5 MB cap; `Content-Type` required on PUT)       |
| `/egress`                   | POST               | outbound call gated by the app's egress declaration                   |

Collections not present in the app's `storage` declaration return `403`.
Records reject unknown or empty `refs` keys with `400`.

## Peer configuration

Vendo receives an AI SDK `LanguageModel`; model provider keys are configured by
that provider, not selected by a Vendo environment-variable ladder. Connector
keys are passed to connector constructors. Modal credentials are passed to
`modalSandbox({ tokenId, tokenSecret })`. The hosted `vendoSandbox()` adapter
reads `VENDO_API_KEY` and `VENDO_CLOUD_URL` from the process; see
[Vendo Cloud](/deploy/vendo-cloud) for the full setup.

The store receives its Postgres URL through `createStore({ url })` and its
PGlite directory through `createStore({ dataDir })`. Those option names are the
contract; V0 does not define storage environment-variable aliases.
