Repository navigation
Description
A company whose network sends every connection through a proxy that inspects TLS can't run fctl's runners today. The host service ignores HTTPS_PROXY and trusts only Mozilla's certificate authorities, so it doesn't register or come online. In sandboxes, git, gh, npm, pip, cargo, curl and Claude Code (a Node program, which reads NODE_EXTRA_CA_CERTS) all need the company's certificate authority and proxy. Today the only way to give them both is an image of the company's own plus variables in every project, and fctl-agent's own clone and push still go without them. A runner's owner should say once, in host.toml, which proxy and certificates the machine uses, and the host should use them for its own connections and give them to every sandbox it starts.
How it works now
- The host ignores proxies. Everything the host and the CLI fetch goes through
fctl_client.HttpClient::new(crates/fctl-client/src/http.rs) wraps hyper-util'sHttpConnector, andws::connect(crates/fctl-client/src/ws.rs) callstokio_tungstenite::connect_async_tls_with_config. Both connect directly, andCargo.tomldoesn't enable hyper-util'sclient-proxyfeature. That covers the runner connection (crates/fctl-host/src/uplink.rs), releases fromdownload_base(agentbin.rs,update.rs) and GitHub for image builds (build.rs). It also covers the Firecracker driver's registry pulls and downloads (driver/firecracker/registry.rs,retry.rs), and the Anthropic API where the host keeps a session's Claude token (claude_relay::Upstream::anthropic, ADR 0079).fctl loginon people's own machines goes the same way. - What the host trusts.
fctl_client::tls_config(crates/fctl-client/src/lib.rs) trusts Mozilla's roots (webpki-roots) plus any certificates inSSL_CERT_FILE. The services thatfctl host installwrites don't pass that variable: the launchd job setsPATHandFCTL_LOG_FORMAT, and the systemd unitFCTL_LOG_FORMAT(crates/fctl-host/src/service.rs). docs/security.md#hosts promises "rustls with the Mozilla root store", andSSL_CERT_FILEis documented only for debug builds (docs/development.md). - Sandboxes get nothing of the host's network. Docker and Apple container sandboxes start with
run -d … --entrypoint tail IMAGE -f /dev/null, with no environment (ContainerDriver::start_new,crates/fctl-host/src/driver/container.rs). fctl-agent then has the image's environment, which Firecracker VMs pass from the image'sEnv(crates/fctl-agent/src/vm/serve.rs). With the process driver it has the host's (driver/process.rs).AgentConfig.envexists for "extra environment for Claude (host configuration, not secrets)" (crates/fctl-proto/src/agent.rs), butagent_configalways leaves it empty (crates/fctl-host/src/session.rs). - Claude gets almost none of the image's environment.
Claude::spawnclears it and keeps onlyPATH,LANG,LC_ALL,TZ,TMPDIR,USER,LOGNAME,SHELLandTERM. Then it adds the project's variables, its secrets andAgentConfig.env(crates/fctl-agent/src/claude.rs,supervisor.rs). So an image'sENV HTTPS_PROXY=…never reaches Claude or its commands (docs/sandbox-images.md#an-image-from-another-base). - Today's workaround takes every project. An image of the company's own adds the certificate authority to the system store, which git, curl and Python's
sslread. Maintainers then puthttps_proxy,no_proxyandNODE_EXTRA_CA_CERTS(a path in that image) in each project's Settings → Sandbox → Environment (ProjectSettings.env,crates/fctl-proto/src/session.rs). Those reach Claude, its commands and the setup script. - fctl-agent's own git doesn't get those variables. Its clone, fetch, push and
gh pr viewrun with its own environment (workspace::runthroughcrate::user::command, incrates/fctl-agent/src/workspace.rsanduser/mod.rs). Docker'sproxiesin the runner's~/.docker/config.jsondo reach new containers, so fctl-agent's git, but still not Claude (Docker's docs). - The relay chains the session's proxy, but only inside the sandbox. Where the host keeps Claude's token, fctl-agent's proxy for Claude sends every other connection through the session's
https_proxy, skipping whatno_proxylists. It takes only anhttp://proxy (relay::Upstream::parse). It gives Claude the session'sNODE_EXTRA_CA_CERTSfollowed by the host's authority (start_relayincrates/fctl-agent/src/supervisor.rs; docs/architecture.md#keeping-the-token-out-of-sandboxes). The host's own connection toapi.anthropic.comgoes out directly. - Image pulls. Docker and Apple container pull images themselves, with their own settings: Docker's daemon has a proxy setting of its own. The Firecracker driver pulls through
fctl_client. fctl host doctordoesn't check the network (crates/fctl/src/cmd/host.rs). It covers the configuration, the tokens, reaching the server, the driver, images, disk and the service, and has no--json. A TLS failure shows as the raw error.
What should happen
-
fctl_clientreaches everything through a proxy, the WebSocket included. It readsHTTPS_PROXY,HTTP_PROXYandNO_PROXYin either case, the way curl does (hyper-util'sclient-proxyfeature has aMatcherfor that). It trusts a configured certificate file besides Mozilla's roots andSSL_CERT_FILE. This step alone fixes people's CLI behind the same proxy. -
host.tomltakes a[network]table, which the host uses for all its own connections: the control plane, downloads, GitHub, registries and the relay's connection to the Anthropic API. -
fctl host installtakes--proxy,--no-proxyand--ca-file, withFCTL_PROXY,FCTL_NO_PROXYandFCTL_CA_FILEfor boot scripts. It uses them for its own requests and writes them intohost.toml. If the shell has proxy variables and no flags were given, it says the service won't see them and offers to keep them. - The host gives the settings to every sandbox it starts (
AgentConfig.network). Before it clones, fctl-agent adds the certificates to the sandbox's store and sets the variables for Claude, its commands, the setup script and its own git and gh. -
fctl host doctorchecks the settings and gets--json.fctl host statusshows the settings, andfctl host networkshows and changes them. - Runners report the proxy's address and the names of the certificates they trust, never the proxy's credentials. The Runners tab and Admin → Runners show them, with an amber line for problems.
- A clone that fails on a certificate or the proxy says so on the session page, and says who fixes it.
- Docs and
docs/llms.txtdescribe all of it.
The settings.
[network]
https_proxy = "http://proxy.acme.internal:3128" # for http:// too, unless http_proxy names another
no_proxy = "localhost,127.0.0.1,.acme.internal"
ca_file = "/etc/fctl/acme-root-ca.pem" # PEM: one or more certificates, trusted besides the usual onesA proxy's user and password may go in its URL, which the relay already reads. Anything given to a sandbox, its agent can read: the docs and fctl host doctor say so, and suggest proxies that let machines in by their address.
In sandboxes. fctl-agent runs as root in container and VM sandboxes by default. It writes the certificates where the image's store takes them, then runs the image's own update-ca-certificates (Debian, Ubuntu, Alpine) or update-ca-trust (Fedora, RHEL). The store covers git, curl, cargo, Python's ssl, Go and other OpenSSL users. Where it can't (agent_as_root = false, or neither command in the image), fctl-agent writes a bundle of the image's certificates plus the runner's in its own directory, for the variables to point at. For everything in the sandbox it sets:
https_proxy,http_proxyandno_proxy, in both cases;NODE_EXTRA_CA_CERTS, for Claude Code, npm and other Node programs;REQUESTS_CA_BUNDLE, for Python's requests and pip, which bring their own bundle;SSL_CERT_FILE, pointing at the store's bundle.
Java keeps its own keystore, which an image or setup script fills: the docs say so. The process driver uses the machine's own store and the same variables. The session's log says it once: "Runner build-7 goes through proxy.acme.internal:3128 and trusts Acme Root CA: fctl-agent added it to the sandbox's certificates."
Protocol. Two optional fields. AgentConfig.network carries the certificates (PEM) and the three proxy settings. HostHello.network carries the proxy's host:port and, for each certificate, its subject, expiry and SHA-256 fingerprint. FleetDO already keeps each runner's hello as JSON (runners.hello, crates/fctl-control/src/do_fleet.rs). The API's Runner gains the field.
Design and UX
A runner behind a company's proxy should come online with one command, and its owner should learn which connection fails, why and what to change, before any session does.
Runners are set up in a terminal, so the CLI comes first:
$ fctl host install --workspace acme --proxy http://proxy.acme.internal:3128 --no-proxy .acme.internal --ca-file /etc/fctl/acme-root-ca.pem
Network: through proxy.acme.internal:3128 (not for .acme.internal), trusting Acme Root CA (until Mar 1, 2031) besides the usual certificate authorities
✓ reaches https://fctl.acme.dev through the proxy
Registered build-7 for Acme. The host service and every sandbox it starts use this network.
$ fctl host doctor
✓ network: through proxy.acme.internal:3128, trusting Acme Root CA from /etc/fctl/acme-root-ca.pem, until Mar 1, 2031
✓ reaches https://fctl.acme.dev (Acme factory 0.38.0) through the proxy
✓ reaches https://fctl.sh/releases through the proxy, which inspects TLS: Acme Root CA signed its answer
✕ reaches https://api.anthropic.com: the proxy answered 403 Forbidden
sessions that keep their Claude token on this runner can't reach Claude: ask your network's admins to let api.anthropic.com through
✕ sandboxes trust Acme Root CA: ghcr.io/acme/agent:3 has no update-ca-certificates or update-ca-trust
fctl-agent gives its sandboxes a bundle of their own: tools that read only the system's store won't trust the proxy
· Docker's daemon has no proxy (docker info): it pulls only from registries it reaches directly (https://docs.docker.com/engine/daemon/proxy/)
fctl host network prints the settings as a sentence: "Through proxy.acme.internal:3128 for https and http, except localhost, 127.0.0.1 and .acme.internal. Trusts Acme Root CA besides Mozilla's certificate authorities." --json prints them as fields. fctl host network set --ca-file … (or --proxy "" to remove one) saves host.toml and restarts the service: "Saved. Restarting the host service: sessions that start from now on use it; running ones keep what they started with."
In the web app:
- A runner's row gets one facts line, only when the runner has settings: "Through proxy.acme.internal:3128 · trusts Acme Root CA". It shows on the workspace's Runners tab and in Admin → Runners, beside
RunnerImages(web/src/routes/admin.tsx). Its title gives the fingerprint and expiry. - A problem the host reports shows as an amber line, as driver problems do. "Its proxy refuses api.anthropic.com: sessions that keep their Claude token on runners can't reach Claude from it." "Acme Root CA, which it trusts, expires in 12 days: its owner replaces it with
fctl host network set --ca-file." - Bring a machine online gets a third question under step 3's commands: "Behind a proxy?" It opens two fields, Proxy (
http://proxy.acme.internal:3128) and "Certificate file on the machine" (/etc/fctl/acme-root-ca.pem). The install command's CodeBox gains the flags as they're typed, so it stays complete. Its hint: "fctl keeps neither: they go into the machine's host.toml." An enrollment token's boot script gainsFCTL_PROXY=…andFCTL_CA_FILE=…lines the same way. - A clone that fails on TLS says why on the session page, not only in git's words: "git couldn't check github.com's certificate: runner build-7's network inspects TLS, and the sandbox doesn't trust its certificate authority. The runner's owner adds it (
fctl host network set --ca-file)."
States:
-
No settings: nothing shows on the runner, since a direct connection isn't news. Doctor prints a dim line: "network: direct, trusting Mozilla's certificate authorities".
-
A wrong file: it's missing or unreadable ("can't read /etc/fctl/acme-root-ca.pem (No such file)"), not PEM, expired or expiring within 30 days, or a server's own certificate ("is the proxy's own certificate, not the authority that signs it").
-
A proxy that refuses: a 407 gets "add its user and password to https_proxy: sandboxes see them too"; a 403 is named per host; an unreachable proxy gets its address and the error.
-
Waiting: while the service restarts, the CLI says so and returns once it's back, as
fctl host restartdoes. -
Long lists: a bundle of 40 certificates reads "trusts 40 certificates of its own (Acme Root CA, Acme Issuing CA 2 and 38 more)". A long
no_proxyshows three entries and "and 9 more". -
Follow hyperstructure/design's docs:
docs/principles.md;docs/web-app/explaining.mdfor pages that set something up (a headline that names the outcome, a lead built from this place's facts, a preview of the result, one primary action, and who can act);docs/web-app/kit.mdfor controls. -
Design every state before building it: the first visit, loading, errors and refusals, waiting, partial setups and long lists.
-
Say what happens, plainly, and never leave someone at a disabled control without saying who can act.
-
Prototype the main screens with realistic data (
cargo xtask demo's world) and review them before building the rest. -
Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.
-
Give the CLI the same care: readable output,
--json, and errors that say what to do next. -
Add or update the pages of hyperstructure/design's docs for each new component, with the reasons behind its choices.
Compatibility
- Versions. Hosts and agents may run one version behind the control plane.
HostConfig(#[serde(default)]) doesn't refuse unknown keys, so an older host ignores[network]and runs without it. The host copies its own fctl-agent into each sandbox when it starts the agent, so only a supervisor that kept running across a host update ignoresAgentConfig.network, and only until it next starts. - Protocol.
AgentConfig.networkandHostHello.networkare new optional fields incrates/fctl-proto, thencargo xtask genfor the API'sRunner. No D1 migration. - Release. The host, fctl-agent and CLI changes need a release, which hosts update themselves to (ADR 0053). The control plane changes only in what it shows.
- Docs.
docs/cli.md(host.toml,fctl host install,doctorandnetwork) anddocs/self-hosting.md#bring-runners-online.docs/organizations.md#runners-for-a-fleet(the boot script) anddocs/sandbox-images.md#what-fctl-writes-into-a-sandbox.docs/security.md#hosts(what hosts trust, and that proxy credentials reach sandboxes).docs/architecture.mdanddocs/llms.txt. - Privacy policy. fctl-site's
legal/privacy.mdlists what app.fctl.sh keeps of each machine under "Hosts". It needs the proxy's address and the names of the certificates the machine trusts. - hyperstructure/sandbox. The default image is Debian, which has
update-ca-certificates. Itsexamples/check.shcould say when an image has no store to add to.
Decisions for a person
- When a project's variables name another proxy, which wins: the project (it may need another route) or the runner (its owner may require the proxy)? Or do the
no_proxylists merge? - Should fctl's binaries also trust the operating system's store (rustls-platform-verifier or rustls-native-certs), for authorities that MDM installs on laptops? Trust would then vary by machine, where docs/security.md promises Mozilla's.
- May proxy credentials reach sandboxes at all, or only proxies that let machines in by their address?
- Is a self-hosted control plane behind the same proxy in scope?
deploy/standalone/lib/config.mjstrustsNODE_EXTRA_CA_CERTSfor the Worker's requests and webhooks (webhookNetwork), but workerd connects directly. - Are proxy auto-configuration (PAC) files, and proxies that sign in with NTLM or Kerberos, out of scope?
Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS
Activity