Use Confidential AI with OpenCode

OpenCode is an open-source coding agent for the terminal. It reads your project, edits files, and runs commands, and it lets you choose which AI provider answers. With Privatemode as that provider, your code goes through a small proxy on your machine to open-weight models running inside confidential computing, where it stays encrypted in memory.

OpenCode logo
Introduction

AI-assisted coding shouldn't mean exposing your code

OpenCode running in a terminal with Privatemode as the AI provider

The challenge

Your codebase leaves with every prompt

OpenCode reads across your project to generate and edit code, and sends that context to a cloud LLM. With a conventional provider, your source, architecture decisions, and business logic are processed in plaintext on the provider's servers.

The solution

A provider that cannot read your code

The Privatemode proxy runs locally. It verifies the integrity of the Privatemode cloud service through remote attestation, and encrypts every request before it leaves your machine. Cloud-side, your data is protected end-to-end by confidential computing and stays encrypted in memory even during processing. By design, neither the infrastructure provider nor we can read it. OpenCode lists Privatemode as a provider, so once the proxy runs you select it and pick a model.

Benefits

Why use Privatemode AI with OpenCode?

Built into OpenCode's provider list

End-to-end confidentiality

Free tier available

How to get started

How to set up Privatemode in OpenCode

OpenCode never talks to the Privatemode cloud directly. It talks to a proxy on your own machine, and that proxy is what verifies the service through remote attestation and encrypts every request before it leaves. So the proxy needs to be reachable from wherever you use OpenCode.

Privatemode portal sign-in screen

Get your API key

If you don't have a Privatemode API key yet, you can generate one for free here.

The cookbook in the Privatemode docs

Set up OpenCode

The cookbook in the Privatemode docs walks you through running the local proxy and enabling OpenCode's built-in privatemode-ai provider.

FAQ

Frequently asked questions about OpenCode with Privatemode

Privatemode offers a range of models running inside confidential computing environments, with your data encrypted in memory during processing. See the model overview.