View on GitHub
tinfoilsh/tinfoil-cli
Overview
The Tinfoil CLI verifies enclave attestations, makes verified HTTP requests against Tinfoil enclaves, and opens verified TCP tunnels into your containers. For a local OpenAI-compatible proxy, see the Local Proxy section.CLI commands that use V3 attestation to verify enclave connections are beta while deployment is ongoing. This includes attestation verification, HTTP requests, proxies, TCP tunnels, and attested SSH.
Installation
Pre-built Binaries
Download the latest release for your OS from the Releases page.Install Script
You can install tinfoil CLI using our install script. This script automatically detects your operating system and architecture, downloads the correct binary, and installs it to/usr/local/bin.
The installer uses
sudo to install to /usr/local/bin when you are not root. To install without elevated permissions, download a pre-built binary and place it in a writable directory on your PATH.Build from Source
- Ensure you have Go installed.
- Clone the repository:
- Build the binary:
Updating the CLI
Install the latest stable CLI release on Linux or macOS without logging in or providing an API key:Check without installing
Fetch fresh release metadata and report whether a newer version is available, without downloading release assets or changing files:-o json. For a read-only, machine-readable check:
current_version, latest_version, and status. Status is available when a check finds a newer release, up-to-date when the installed version is equal to or newer than the latest stable release, or installed after a successful update. A successful installation also includes path, the replaced executable’s resolved path.
Permissions and managed installations
- The installation directory must allow binary replacement. The updater never invokes
sudo. If permission is denied, rerun the installer or use an account with the required permissions. If you choose to usesudo, invoke the trusted CLI by its verified absolute path rather than relying onsudo’sPATH. - Homebrew-managed binaries cannot be replaced by self-update; update them through your package manager instead.
- Source builds with a
devor unknown version refuse self-update, including--check. Rebuild from source or install a published release.
Update notices
In an interactive terminal, the CLI checks for newer releases at most once a day and prints a notice suggestingtinfoil update. This passive check does not download or install an update. Set TINFOIL_NO_UPDATE_CHECK=1 to disable only the passive check; explicit tinfoil update and tinfoil update --check still work.
Command Reference
The CLI provides these high-level command families:- Verification and connectivity:
attestation,proxy,http,forward,ssh,scp, andattest-ssh. See TCP tunnels and SSH for the tunnel commands and Attested SSH for native SSH profiles. - Authentication:
login,logout, andwhoami. - Container management:
container,project,model, andrepo. - Organization resources:
volume,secret,ssh-key,registry, anddomain.
tinfoil <command> --help for the installed command reference. See Managing containers from the CLI for container workflows and the CLI repository for release notes.
HTTP Requests
Thehttp command makes verified HTTP requests to Tinfoil enclaves with attestation verification.
GET Request
POST Request
Streaming
Use the-s flag to stream the response line by line:
Command Options
-b, --body: HTTP POST body-H, --header: HTTP request header, inName: Valueformat. May be repeated-s, --stream: Stream response output (POST only)
Pin a release
Use--repo to select the workload you trust:
Replace
<DIGEST> with the deployment artifact’s SHA-256, written as 64 lowercase hexadecimal characters. A repository-only reference does not require the latest release. See Pinning the expected workload for how these constraints are verified.
To verify a specific release:
Connection policy
When the CLI resolves a container by name (container connect, forward,
ssh, scp, attest-ssh), the expected config comes from your local
connection policy — not from the resolution answer. The policy is
~/.tinfoil/known-configs.yml, yours to edit; the CLI preserves your
comments when it writes:
pins (New config journaled: …), so
tightening the policy later starts from everything you have actually used.
A config with no matching entry asks for confirmation in a terminal — yes
records it at the record granularity (org, project, or pin) — and
fails closed in a script. --repo is the same decision stated inline: the
resolved config must fall under the reference you give (an org,
org/project, or a pin), and on success it is recorded exactly like a yes.
container create seeds the policy with the project and revision you typed,
so the first connect does not prompt. --dangerous skips the check for one
invocation and records nothing.
Attestation Verification
Verify Attestation
Use theattestation verify command to manually verify that an enclave is running the expected code:
JSON Output
You can also record the verification to a machine-readable audit log:-l flag to specify the output file directly:
digest, code and enclave measurements, endorsed crypto_material, freshness_expires_at, and verification status.
Command Options
-j, --json: Output in JSON format-l, --log-file: Path to write the JSON log-e, --enclave: The hostname of the enclave. If omitted, auto-selects the default router.-r, --repo: Expected config asowner/repo[@tag][@sha256:digest](or a registry referenceorg/project[@revision][@sha256:digest]; container commands also accept a bareorg). Required for an explicit hostname; automatic router selection supplies its default repository. On container commands the assertion is recorded in your connection policy.
Docker
A docker image is available atghcr.io/tinfoilsh/tinfoil-cli.
