Skip to main content
Tinfoil’s SecureClient verifies the enclave before sending any data — same attestation flow as Tinfoil’s inference API. Every request is authenticated against the container’s attestation report and TLS certificate. You need two values to connect:
  • <CONTAINER_URL> — your container’s hostname (e.g. myapp.myorg.containers.tinfoil.dev)
  • <CONFIG_REPO> — the GitHub repo linked to your container, in org/repo format
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

The client verifies the enclave is running the expected code from the pinned repo, then pins the TLS certificate for all subsequent requests. If anything doesn’t match, the connection fails.

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:
Then send requests to http://localhost:3301 as if it were your container:

Using the CLI

For one-off verified requests without running a proxy, use tinfoil http:
Add any other request headers with repeatable -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 repo by hand — the CLI resolves both from the container name and starts the same verified proxy:
The proxy binds to 127.0.0.1 by default. Use --bind <ADDRESS> to choose another interface, for example when connecting from another container:
Only bind beyond localhost on a trusted network because other hosts may then send requests through the proxy. See Managing containers from the CLI for the rest of the management surface.
Debug mode containers do not pass attestation. This is by design — debug enclaves trade confidentiality for inspectability.