SecureClient verifies the enclave before sending any data, using the same attestation flow as Tinfoil’s inference API. Every request is authenticated against the container’s attestation report and TLS certificate.
Beta: V3 verification in the Go and Swift SDKs and the CLI is still being deployed. The CLI’s verified HTTP, proxy, TCP tunnel, and SSH flows use V3. See Feature status.
<CONTAINER_URL>: your container’s hostname (e.g.myapp.myorg.containers.tinfoil.dev)<CONFIG_REPO>: the GitHub repo linked to your container, inorg/repoformat
The Rust
SecureClient constructor retains an API-key argument for inference API compatibility, but raw requests through http_client() do not use it. Pass an empty string for custom containers, then add application authentication to individual requests if your service requires it.GET requests
POST requests
Using the local proxy
You can also connect to your container with the standalone Tinfoil Proxy CLI (tinfoil-proxy), which runs a local reverse proxy that verifies attestation and forwards requests:
http://localhost:3301 as if it were your container:
Using the CLI
For one-off verified requests without running a proxy, usetinfoil http:
-H, --header flags, such as -H "Authorization: Bearer <TOKEN>".
If you’ve logged in with tinfoil login, use tinfoil container connect <name> to skip looking up the container URL and config reference by hand. The CLI resolves both from the container name, checks the resolved config against your local connection policy — by default the first connect asks you to confirm (or is pre-seeded by container create); allowed configs pass silently — and starts the same verified proxy:
127.0.0.1 by default. Use --bind <ADDRESS> to choose another interface, for example when connecting from another container:
Native SSH
For a workload serving an attested SSH host key on a direct SSH endpoint, install a verified profile and use your native client:TCP tunnels and SSH
container connect proxies HTTP. For raw TCP, such as a database port or SSH, use tinfoil forward and tinfoil ssh. Both open a tunnel over the enclave’s attested TLS connection, so the peer is pinned to the verified enclave rather than trusted on first use.
The enclave only accepts a tunnel to a port that one of its containers publishes in tinfoil-config.yml. The enclave authenticates the tunnel with an inference API key (tk_...), not the admin key you used for tinfoil login. Set the tunnel key with TINFOIL_TUNNEL_API_KEY or --api-key. To look up the container by name, TINFOIL_ADMIN_KEY takes precedence; TINFOIL_API_KEY overrides the saved admin login only when its value starts with admin_. An inference key in TINFOIL_API_KEY does not replace the saved admin credential. See credential precedence.
-L takes [bind:]<local-port>:<enclave-port> and may be repeated. The target is a container name or ID, which the CLI looks up with your admin login and checks against your connection policy — the same check as container connect, also applied by ssh and scp — or a bare enclave hostname (anything containing a dot). A hostname target requires --repo owner/repo to select the expected workload; both target forms require workload attestation verification.
A live session stays pinned to the config it was verified against at the start. When the container is updated, the session fails closed with a certificate-mismatch error rather than migrating to the new config — reconnect, and the connection policy applies to the new config there.
tinfoil ssh wraps your local ssh with a ProxyCommand that runs tinfoil forward --stdio:
-- are passed to ssh. -l sets the remote user (default root) and -p the enclave-side port; the port defaults to the container’s published SSH port, or 22 if none is known. Because the attested tunnel pins the peer, the CLI disables SSH host key checking for the session.
Both commands refuse to tunnel into a container running in debug mode, because the debug toolbox puts an interactive shell inside the enclave. Pass --allow-debug to override.
See Managing containers from the CLI for the rest of the management surface.

