Coding Agents with Tinfoil

Use Tinfoil private inference with any OpenAI-compatible coding agent and connection-time attestation verification.

Connect via Tinfoil Proxy

Most coding agents talk to a configurable OpenAI-compatible base URL. That's all Tinfoil needs to slot in.

To ensure each connection is attested and the privacy is verified by your client, you need to run a Tinfoil proxy. Below we set up a local proxy that automatically verifies the attestation for all inference requests issued to Tinfoil.

  1. Install the local proxy

    Install the Tinfoil Proxy menu-bar app or the standalone CLI binary. Either way you get the same http://127.0.0.1:3301/v1 endpoint with identical attestation; pick the menu-bar app for desktop use and the CLI for scripts, CI, or headless servers.

    The Tinfoil Proxy menu-bar app showing a verified connection
  2. Point the agent at Tinfoil

    Configure your coding agent with:

    SettingValue
    Base URLhttp://127.0.0.1:3301/v1
    API keyYour Tinfoil API key from the Tinfoil Dashboard
    ModelA model ID from the chat model catalog, e.g. kimi-k2-6
  3. Verify the connection

    With the menu-bar app, open the Tinfoil popup and confirm the lock is green. With the CLI, watch the logs for the verification success line on startup.

The general case

If your tool or harness supports OpenAI compatible inference APIs and exposes the ability to set a base URL, you should be able to configure it to work with the values in the table above.

Verification note: OpenAI-compatible clients don't perform connection-time attestation themselves. With the Tinfoil Proxy menu-bar app or the CLI proxy binary in the loop, every request gets a verified connection to a Tinfoil secure enclave. Without either, your traffic still benefits from audit-time verification through Tinfoil's attestation transparency log. We strongly recommend using the proxy.

Configure your coding agent

Pick your agent to see the exact setup. Each one points at the same local proxy endpoint, so attestation is verified on every request.

OpenCode is a terminal-based coding agent that talks to any provider exposed via the AI SDK. It plugs into Tinfoil through the @ai-sdk/openai-compatible adapter — see OpenCode's Providers and Config docs for the full schema.

Add Tinfoil as a custom provider in opencode.json (project root or ~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "tinfoil": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Tinfoil",
      "options": {
        "baseURL": "http://127.0.0.1:3301/v1",
        "apiKey": "tk_xxxx"
      },
      "models": {
        "kimi-k2-6": {
          "name": "Kimi K2.6",
          "limit": { "context": 200000, "output": 65536 }
        },
        "gemma4-31b": {
          "name": "Gemma 4 31B",
          "limit": { "context": 128000, "output": 32768 }
        }
      }
    }
  }
}

Paste your Tinfoil API key directly into the apiKey field, then pick the Tinfoil provider in OpenCode's /models selector and start coding.

A note on privacy

OpenCode is open-source and runs locally on your machine. Its Enterprise docs state:

OpenCode does not store your code or context data. All processing happens locally or through direct API calls to your AI provider.

With the Tinfoil provider configured, those direct calls go to the local proxy and into the enclave. The exception OpenCode flags is the optional /share feature, which uploads the active conversation to opencode.ai's CDN — leave it off (or set "share": "disabled" in opencode.json) to keep everything on-device.