Integrating Privatemode AI with Xcode

Xcode’s Intelligence sends your code to ChatGPT by default. Add Privatemode as a custom model provider and keep the same AI coding experience — fully encrypted.

Introduction

Use cloud-based AI in Xcode without compromising data privacy

screenshot of the xcode desktop app

Cloud AI for Apple developers, fully private

Xcode’s Intelligence features, including Swift Assist, code generation, and agentic coding, are powered by cloud AI providers like ChatGPT by default. Privatemode removes the trade-off between capability and confidentiality by providing an OpenAI-compatible, attested service that never exposes your code to cloud or service providers.

Protect proprietary app code and trade secrets

iOS and macOS apps often contain proprietary business logic, Core ML model architectures, and sensitive client code under NDA. Enterprise teams in healthcare, finance, and government need provable data handling guarantees that go beyond standard cloud AI privacy policies.

Cloud-level AI — fully encrypted

You get state-of-the-art models with full control over your data, while Xcode’s elegant interface makes Privatemode easier to use than ever. Based on confidential computing, your code is encrypted before it leaves your Mac and processed inside a hardware-enforced enclave.

Benefits

Why use Privatemode AI with Xcode?

End-to-end encrypted AI coding

Integrating Privatemode into Xcode brings cloud-AI capabilities to your IDE while keeping your code confidential through end-to-end encryption and confidential computing. Privatemode is designed to never learn from your data.

State-of-the-art model selection

With Privatemode, you can choose from state-of-the-art LLMs to power Xcode’s Intelligence features — Swift Assist, code generation, and agentic coding — all running confidentially.

Native integration, no extensions needed

Xcode has built-in support for custom OpenAI-compatible model providers. Just add Privatemode via Preferences > Intelligence > Add Model Provider and all of Xcode’s AI features work instantly.

How to get started

How to set up Privatemode in Xcode

privatemode register widget

Get your API key


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

docker run -p 8080:8080 \
  ghcr.io/edgelesssys/privatemode/privatemode-proxy:latest \
  --apiKey <your-api-key>

Run the Privatemode proxy


The proxy verifies the integrity of the Privatemode service using confidential computing-based remote attestation. The proxy also encrypts all data before sending and decrypts data it receives.

Add Privatemode as a model provider in Xcode


Open Xcode and go to Preferences > Intelligence. Click Add Model Provider and select the custom/locally-hosted option. Set the URL to your Privatemode proxy endpoint (http://localhost:8080). Xcode will automatically append /v1 to the URL.

Walk through the interactive demo

FAQ

Frequently asked questions about using Privatemode with Xcode

All of Xcode’s Intelligence features work with Privatemode, including Swift Assist, code generation, and agentic coding. Since Xcode natively supports custom OpenAI-compatible model providers via Preferences > Intelligence, every AI feature routes through Privatemode automatically once configured.