Proxy command
varlock proxy
Section titled “varlock proxy”Manages credential proxy sessions: running an untrusted child process so it only sees placeholder secrets while real values are injected at the network boundary. Route secrets by adding @proxy(domain=...) to the items you want to protect.
varlock proxy <subcommand> [options]Every subcommand operates on a session. Target one with --session <id>, or let it auto-resolve: run attaches to the daemon for the current directory (else starts its own), and the other subcommands use the single active session (asking for --session if more than one is running).
Subcommands:
run -- <command>: Start a proxy, run<command>through it, and tear down on exit. Attaches to a runningproxy startsession for this directory if one exists; otherwise runs self-contained. With--urlit instead runs through a proxy on another machine (a broker started with--expose), reached over the built-in WebSocket tunnel, self-wiring the placeholder env and CA certs from the broker. See the E2B guide.start: Start a long-lived proxy session that owns the terminal (a live request log appears here). Stop withCtrl+C.rules: Print a static summary of the effective@proxyconfiguration: the rules (host/path/method, block) and each secret’s mode (proxied / placeholder / passthrough / omit), without starting a proxy.env: Print the proxy + CA environment for a session, to source into another shell (eval "$(varlock proxy env)"). Add--fullto emit the whole child-view env a proxied agent runs with (placeholders for secrets, real values for non-secrets), with--proxy-url/--cert-dirto repoint it for a remote sandbox.token: Print a session’s data-plane token, for handing toproxy run --url. Its own verb because the token is a credential: it is never included instatusorenvoutput, and the startup banner withholds it unless stdout is a terminal.status: List active proxy sessions.audit: Print a session’s request audit log (no secret values).reload: Re-resolve the schema and swap a running proxy’s live policy without restarting, after an intentional schema edit. Must be run from a trusted terminal: a reload requested from inside the proxied agent is refused and logged. Requires the proxy’s reload posture to allow it (see--allow-reload/@proxyConfig={reload=...}); otherwise restart the proxy to apply schema changes.stop: Stop a session.
Options:
--session <id>: Target a specific session by id.--new: Forrun, force a fresh proxy instead of attaching to a running one.--port <n>: Forstart/run(when it starts a proxy), bind a fixed loopback port instead of a random one, so you can point tools at a knownHTTP_PROXYbefore the proxy starts. Refuses to start if the port is already in use.--cert-dir <dir>: Forstart/run(when it starts a proxy), write the CA cert (ca-cert.pem+combined-ca.pem) into a known directory instead of a temp one, so tools can trust it at a fixed path. Created if missing; only the cert files are removed on stop.--persist-ca: Forstart/run, keep the CA in--cert-dir(includingca-key.pem, mode 0600) and reuse it on the next start, so a restart does not invalidate clients that already trust it. Requires--cert-dir. Intended for long-lived brokers: the CA private key normally never touches disk, so only use this where the proxy runs alone (not alongside the agent it proxies). A persisted CA is valid for 10 years (effectively for the life of the broker), since any expiry would break agents still running when it hits; to retire one, delete the cert directory and restart.--expose(optionally--expose=<addr>): Forstart/run, make the proxy reachable from another machine: it binds off-loopback (bare--expose=0.0.0.0;--expose=<addr>picks an interface) and serves the built-in WebSocket tunnel for clients behind HTTP-only ingress. Mints a per-session data-plane token (pin it withVARLOCK_PROXY_TOKEN) that off-loopback clients must present; loopback clients stay exempt and the control endpoint stays loopback-only.--url <wss>+--token <token>: Forrun, target a proxy on another machine (a broker started with--expose) over the tunnel, instead of a local session. Prefer passing the token asVARLOCK_PROXY_TOKENrather than--token, so it stays out of process listings and shell history. The local-proxy flags (--sandbox,--port,--cert-dir,--persist-ca,--expose) don’t apply with--url.--tokenalso pinsstart’s minted token to a known value (viaVARLOCK_PROXY_TOKEN), so an orchestrator can hand the same token to the broker and its agents.--all: Forstatus/stop, include all sessions (statusalso shows ended sessions).--allow-reload/--no-allow-reload: Forstart/run, override the reload posture.--allow-reloadforcesmanual(human-applied from a trusted terminal; agent-context reloads refused),--no-allow-reloadforcesoff. Otherwise@proxyConfig={reload=...}applies, defaulting toauto(manual for an interactiveproxy start, off for headless or one-shotproxy run). On a shared uid this is a bar-raiser, not a hard boundary, so prefer a sandbox.--inject <all|vars|blob>: Forrun, control what is injected into the child env (defaultall).--redact-stdout/--no-redact-stdout: Forrun, override the automatic per-stream redaction. By default output is redacted only when piped or redirected; streams attached to an interactive terminal pass through as a raw TTY, so interactive tools likeclaudework.--no-redact-stdoutdisables redaction entirely;--redact-stdoutforces it for piped output (and errors on a TTY). Also settable via_VARLOCK_REDACT_STDOUT.--watch: Forstatus, continuously refresh.--format <text|json>: Output format foraudit(text/json) andenv(shell/json).
Examples:
# Run an agent through the proxyvarlock proxy run -- claude
# Daemon in one terminal, attach from anothervarlock proxy startvarlock proxy run -- node agent.js
# Inspect activityvarlock proxy statusvarlock proxy audit --format json
# Reach a broker proxy from another machine / a remote sandbox (see the E2B guide)varlock proxy start --exposevarlock proxy token # read the minted token to hand to clientsVARLOCK_PROXY_TOKEN=… varlock proxy run --url wss://8080-abc.e2b.app -- claudeSee the credential proxy guide for the full workflow.