When running beats downloading
When running beats downloading
If a download would take longer than running the task, vx runs the task. 500 remote hits finish in 1.15 s instead of 3.12 s.
Your shell holds dozens of variables, some of them secrets. A task gets a short fixed list plus the names you write down, and secrets print as ***.
Your shell holds tokens, cloud keys and leftovers. A vx task gets a short fixed list plus the names you write down.
$ env | wc -l189$ vx run packages/d#envcount # command: env | wc -l9Linux x64 · vx 69617eb · 2026-10-23
import { defineProject } from '@vzn/vx/config'
export default defineProject({ tasks: { env: { exec: { command: 'echo "FOO=$FOO" && echo "NODE_ENV=$NODE_ENV" && echo "DEPLOY_TOKEN=$DEPLOY_TOKEN" && echo "GH_PAT=$GH_PAT"', env: { passThrough: ['DEPLOY_TOKEN', 'GH_PAT'], define: { NODE_ENV: 'production' }, secret: ['GH_PAT'], }, }, }, },})$ FOO=leaked DEPLOY_TOKEN=s3cr3t-value-123 GH_PAT=ghp_abcdef123456 vx run packages/d#env┌─ packages/d#env > $ echo "FOO=$FOO" && echo "NODE_ENV=$NODE_ENV" && echo "DEPLOY_TOKEN=$DEPLOY_TOKEN" && echo "GH_PAT=$GH_PAT"FOO=NODE_ENV=productionDEPLOY_TOKEN=***GH_PAT=***└─ packages/d#env ── (4ms) successFOO never reached the task. NODE_ENV came from the config. Both
tokens arrived, and both printed as ***.
flowchart LR SH["your shell: 189 vars"] -->|always| B["PATH, HOME, TMPDIR, locale, CI, NODE_OPTIONS"] SH -->|passThrough| P[named tokens] CF[config] -->|define| D[literal values] B --> T[task: 9 vars] P --> T D --> T D -.->|in cache key| K[key]
| Layer | Example | In the cache key? |
|---|---|---|
| always passed | PATH, HOME, TMPDIR, locale, CI, NODE_OPTIONS |
no |
passThrough |
a token from your environment | no |
define |
a literal value in the config | yes |
passThrough stays out of the key, so a laptop and CI still share
cache hits.
A name with TOKEN, SECRET, KEY, PASSWORD, PASSWD or
CREDENTIAL in it is masked without asking. GH_PAT has none, so it
goes in secret.
Masking covers every place vx prints: logs, cache replays, vx show,
vx why, vx last, telemetry and JSON.
A value split across two output chunks is still caught. Split by a pause, it can show on screen, but no stored copy keeps it.
Some variables change the build output, like NODE_OPTIONS loading a
loader. vx doesn’t guess which. Name it, and its value joins the key:
inputs: { files: ['src/**'], env: ['NODE_OPTIONS'] }, outputs: { files: ['dist/**'] }, cache: trueDropping variables keeps builds the same across machines. It doesn’t stop a task that goes looking, because an unsandboxed task runs as you.
VX_DEBUG_DUMPABLE=1 turns that off for debuggers.ps eww would show.To keep a task away from your files, use exec.sandbox.
Rules: schema. More at vznjs.github.io/vx.