---
title: "Regents Cloak Architecture & Reference · Docs"
description: "Regents Cloak architecture, Security Profiles (Local Mac only, zkAPI only, Cloud allowed), Local AI, Private Cloud Inference, Darkbloom Earn, Local Agent Box (Pi), Connected Apps (CloakDoor), Tor & live cover traffic, pricing, and privacy limits."
canonical: "https://staging.regents.sh/docs/cloak/reference"
---
# Architecture & reference

Regents Cloak architecture, Security Profiles (Local Mac only, zkAPI only, Cloud allowed), Local AI, Private Cloud Inference, Darkbloom Earn, Local Agent Box (Pi), Connected Apps (CloakDoor), Tor & live cover traffic, pricing, and privacy limits.

## Overview

Regents Cloak is a free, open-source (MIT) native macOS menu bar app (Swift 6.2, Apple silicon, macOS 26 or later) built around a clear premise: **choose where an AI conversation runs, see what leaves your Mac, and understand what can link one request to another.**

Regents Cloak does not support standard consumer cloud AI logins (OpenAI, Anthropic, or Google accounts). You can run models offline on Apple silicon with zero accounts and zero payment, or step up explicitly to hardware-verified enclaves (with your own NEAR AI Cloud API key), Universal Privacy Shield, local prompt rephrasing, per-conversation Tor routing, crypto payments (Venice, Boundless, zkAPI), and optional Darkbloom provider serving (`console.darkbloom.dev`) — all controlled by an enforceable **Security Profile**.

*Regents Cloak is Regents Labs' open-source macOS app for private AI (`regents.sh/cloak`, `github.com/regents-ai/cloak`), unrelated to Scroll's Cloak V1, WGAE's Cloak, Cloaked, or in-game items.*

> **Beta & audit status (`v0.6.10 Beta`, tag `0.6.10-379`):** Regents Cloak is beta software and its privacy protections have not been independently audited yet. Keep wallet balances small, back up keys with `.cloakvault` or withdraw funds before wiping your Mac, and read [Wallet Security, Failure Modes & 30-Day zkAPI Limit](https://staging.regents.sh/docs/cloak/wallets) before transferring or depositing crypto.

## Cost & Payment Methods

Regents Cloak charges no subscription and takes no markup on Private Cloud calls (full Regents Labs pricing is at [regents.sh/pricing](https://staging.regents.sh/pricing)):

| Rail / Feature | Cost | Payment method |
| --- | --- | --- |
| **Regents Cloak app & Local AI** | **$0** (MIT open source) | No account, no subscription, no credit card; offline once weights download |
| **NEAR AI Gateway (Hardware TEE)** | Pay-as-you-go to NEAR AI Cloud | Bring your own NEAR AI Cloud API key (`0 GB` download; 8 GB+ Mac) |
| **Venice AI (Private / TEE tiers)** | Pay-as-you-go to Venice AI | Base `USDC` via HTTP `x402`, Venice API key, or card / Stripe Link / Apple Pay top-up |
| **Boundless + Tempo** | Pay-as-you-go to Boundless | Tempo `USDC.e` payment channels via HTTP 402 `MPP` (or Relay.link + CCTP V2 bridge) |
| **zkAPI Anon Inference** | Pay-as-you-go (actual token cost) | Reusable Ethereum Mainnet `ETH` deposit (`$5+` recommended; 30-day limit; fresh one-time ZK key per turn) |
| **Darkbloom Earn (macOS 27+)** | Earn on idle Apple silicon (`0%` platform cut) | `Local Only` (`$0`, no account) or optional `Network + Local` via `console.darkbloom.dev` |

## Architecture & Isolation

Regents Cloak coordinates five purpose-built helpers across process and virtualization boundaries:

- **Sandboxed local LLM workers** (`cloak-worker-vmlx` for Apple MLX with RAM-only paged KV caching, `cloak-worker-nano` for Zig + Metal DFlash 2, and `cloak-rewriter-llama` for Metal `llama.cpp` + `libmtmd` vision) over framed binary IPC (`RewriterKit`). None of the local workers link an HTTP server.
- **Native Rust TEE verifier** (`cloak-near`, built with `dcap-qvl`, `rustls` + `aws-lc-rs`, `curve25519-dalek`, and `chacha20poly1305`) that independently verifies Intel TDX quotes and NVIDIA GPU attestation verdicts on your Mac over TLS 1.3 (preferring hybrid `X25519MLKEM768`, with opt-in fail-closed `require_pq`) before encrypting prompts end-to-end.
- **Bundled Tor daemon** (`tor 0.4.9.16`) listening strictly on an owner-only Unix SOCKS5 socket (`IsolateSOCKSAuth`, remote DNS).
- **Ephemeral, NIC-less Linux arm64 microVM** via Apple's `Virtualization.framework` (`2 vCPU`, `1 GiB RAM`). It has **zero** virtual network interfaces—its only egress is `vsock:9050` straight into the host's Tor socket.
- **Isolated macOS Data Protection Keychain entries** (`kSecAttrAccessibleWhenUnlockedThisDeviceOnly`), scoped via a Developer ID provisioning profile (`367G3Z7G3J.sh.regents.cloak`) so your chat master key, NEAR key, Venice Base wallet, Boundless/Tempo wallet, Arc Mainnet wallet, Venice API key, and zkAPI ETH wallet key stay strictly separated and never sync to iCloud.

Every bundled binary and downloaded model weight is verified by **SHA-256** against Cloak's embedded manifest before execution.

## Security Profiles (Allowed Connections)

Choose your master **Security Profile** in **Settings → General → Allowed connections**. Changes take effect immediately inside `Supervisor` and `CloakDoor` with no app restart required—closing CLI (`cloak start`), AppleScript, widget, Connected Apps, and UI bypasses:

- **`Local Mac only`:** Permits **Local AI** chat, loopback `127.0.0.1` servers, Local Access, Local Voice, Saved Project Profiles, `CloakDoor` on `Local ($0)`, Darkbloom `Local Only`, and explicit model/offline-data downloads. Hard-blocks all cloud chat modes, cloud `CloakDoor` rails (`HTTP 403 security_profile_blocked`), cloud wallets/RPCs, Tor/VM startup, app-attribution headers, and account-linked Network Inference Serving.
- **`zkAPI only`:** Allows **Local AI** + **zkAPI Anon Inference** only, with **Tor**, **Cover Traffic**, and **Local Prompt Rewriting** locked **ON**; Connected Apps are restricted to `Local ($0)` and `zkAPI Anon`. Hard-blocks account-keyed NEAR, linkable single-wallet Venice & Boundless rails, direct non-Tor cloud sends, and account-linked Network Inference Serving.
- **`Cloud allowed`** *(default)*: Enables all 4 chat modes, Smart Private Cloud failover, all 5 `CloakDoor` rails, wallets, and Darkbloom `Network + Local` serving.

> **Terminology map:** **Local AI** is Cloak's offline chat mode (`⌘1`), **Local ($0)** is the zero-cost `CloakDoor` rail (`127.0.0.1:8742`), and **`Local Mac only`** is the Security Profile in **Settings → General → Allowed connections** that blocks all cloud modes, wallets, and network serving.

## The Three Modes

Regents Cloak organizes everything into **three modes**: **1. Local AI**, **2. Private Cloud Inference** (choosing between NEAR AI Cloud, Venice AI, Boundless, or zkAPI per thread), and **3. Darkbloom Earn** (Inference Serving with EigenLayer's Darkbloom).

| Mode | Where inference runs | What leaves your Mac | Payment / auth | What can link requests |
| --- | --- | --- | --- | --- |
| **1. Local AI** | On your Mac (`vmlx-swift` MLX, `nanoattention`, `llama.cpp` GGUF, or loopback `127.0.0.1` servers) | Nothing during chat once weights are downloaded | Free · no account | Nothing leaves your Mac during inference |
| **2. Private Cloud — NEAR AI Gateway** | [NEAR AI Cloud](https://cloud.near.ai) (`Qwen3.8-27B` and Confidential TEE catalog, Intel TDX + NVIDIA GPU) | Shielded prompt, E2EE v3 encrypted over TLS 1.3 to the hardware-verified enclave (optional Tor & `require_pq`) | Your NEAR AI Cloud API key | Your NEAR API key identifies your NEAR account |
| **2. Private Cloud — Venice & Boundless** | [Venice AI](https://venice.ai) or [Boundless](https://boundless.network) on Tempo | Shielded, locally rephrased user text over per-conversation Tor circuits (or optional Direct HTTPS for Venice) | Tempo `USDC.e` (`MPP`), local Base USDC wallet (`x402`), Relay.link / CCTP V2 bridge, or Venice API key | A reused wallet address, payment channel, or API key can link chats |
| **2. Private Cloud — zkAPI** | Open Anonymity (`zkAPI`) over Tor | Shielded, locally rephrased user text over per-conversation Tor circuits | Fresh one-time zero-knowledge key per turn drawn from a reusable ETH deposit — no provider account or linked API key | No reusable provider credential; prompt text, conversation history, and timing can still correlate requests |
| **3. Darkbloom Earn** | On your Mac via [EigenLayer](https://eigenlayer.xyz)'s [Darkbloom](https://darkbloom.dev) | `Local Only` stays on your Mac; `Network + Local` serves idle compute to Darkbloom | Earn payouts on idle Apple silicon (`0%` platform cut, macOS 27+) | Linked `console.darkbloom.dev` provider account (`Network + Local` only) |

### Mode 1: Local AI (`vmlx-swift` MLX + `llama.cpp` + Loopback Discovery)

Once model weights are downloaded, **Local AI** does not send your conversation to an inference provider—no account, no payment, and no remote model calls during chat. (Model downloads from Hugging Face and optional Sparkle update checks are separate app-level network activity.)

- **Fast MLX path:** Powered by [vmlx-swift](https://github.com/osaurus-ai/vmlx-swift) on Apple MLX with RAM-only paged KV prefix caching and selectable **Quick / Standard / Thorough** (`low` / `medium` / `high`) reasoning effort, running [Inkling 2 Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini) in [JANGH2](https://huggingface.co/OsaurusAI/Inkling-2-Mini-JANGH2) format (`10.21 GB` download, `~5.6 GB` working RAM on 16 GB+ Macs; measured `~74 tok/s` on M4 Max 48 GB), `Qwen 3.5 4B (Fast + Vision)` on 8 GB+ Macs, `Qwen 3.8 27B (Coding + Vision)` on 36 GB+ Macs, and `Qwen 3.8 Flash Next` on 64 GB+ Macs.
- **GGUF + Vision (`libmtmd`) + LoRA path:** Built from [ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp) (`b12858`) with Metal acceleration and `libmtmd` (`inkling2v` vision projector, video/ffmpeg disabled), supporting Ora Computing's compact vision GGUFs (`2.6bpw` `9.09 GB` / `2.4bpw` `8.41 GB` including the 642 MB BF16 `mmproj` for native Photos Q&A on 16 GB+ Macs), 24–32 GB+ GGUF tiers (`13.63 GB` / `17.63 GB`), and an optional `44 MB` uncensored LoRA.
- **Loopback Local Server Auto-Discovery (`127.0.0.1` only):** Automatically discovers and reuses local servers already running on your Mac — **Splash** (`:8000`), **TensorFold** (`:8080`), **mlx-serve** (`:11234`), **LM Studio** (`:1234`), **Ollama** (`:11434`), and **Darkbloom Local** — across both Local AI chat and Connected Apps with zero duplicate weight downloads.
- **Saved Project Profiles, Local Voice Notes & macOS Services:** Isolate each client or codebase across approved local folders, Privacy Shield private terms, preferred route, Connected Apps model override, and local-only notes (`Settings → Local Models → Projects`). Dictate, transcribe audio/video files, and summarize locally in **Settings → Local Models → Voice Notes** (`SpeechAnalyzer` / `SpeechTranscriber`), and use macOS Services (`Ask Cloak Privately`, `Scrub Secrets with Cloak`, `Rewrite Privately`), Apple Shortcuts, or opt-in Clipboard Secret Guard.
- Both built-in workers preserve multi-turn reasoning history inside your encrypted local chat store and coordinate unified memory with the prompt rewriter automatically (including M5 / M5 Max right-sizing).

### Mode 2: Private Cloud Inference (NEAR, Venice, Boundless & zkAPI)

Choose the cloud privacy rail you want per thread—or enable **Smart Private Cloud failover** (`Settings → Connected Apps`) to automatically fall back across ready cloud rails in order when a provider hits `429`, `5xx`, or depleted credit. Smart Failover strictly respects your active Security Profile (`Local Mac only`, `zkAPI only`, or `Cloud allowed`) and **never** jumps off `Local ($0)` to a cloud rail.

#### NEAR AI Gateway (Hardware TEE)

Runs `Qwen3.8-27B` (and NEAR's Confidential TEE catalog) inside Intel TDX + NVIDIA GPU enclaves on [NEAR AI Cloud](https://cloud.near.ai) ([Dstack TEE](https://github.com/Dstack-TEE/dstack)). Works on 8 GB+ Macs with **0 GB** of model downloads.

Before sending a prompt, `cloak-near`:

1. Fetches live hardware attestation from `cloud-api.near.ai`.
2. Verifies the **Intel TDX quote** locally via DCAP QVL and checks `app_compose` against pinned measurements compiled into Cloak (with clock-rollback protection and fail-closed nested allowlists).
3. Verifies the **NVIDIA GPU attestation verdict** from [Intel Trust Authority](https://portal.trustauthority.intel.com) (`PS384` JWT + nonce binding).
4. Pins TLS 1.3 to the enclave's attested key — preferring hybrid `X25519MLKEM768` with opt-in fail-closed `require_pq` enforcement before any prompt or API key byte leaves your Mac — and seals prompts with **E2EE v3** (`X25519` + `HKDF-SHA256` + `XChaCha20-Poly1305`) plus verified enclave response signatures. Any mismatch fails closed. Run `cloak crypto-status [--json]` or open **Settings → General → Status → Trust & Proofs** to inspect negotiated TLS and verification posture.

NEAR chats pass through **Universal Privacy Shield** pre-send (without local style rephrasing). Enabling **Tor** allocates two separate Tor circuits per app launch (one for NEAR, one for Intel Trust Authority).

Inside the mode's top tab bar (**Chat | Traces | Insights**), the **Traces** tab exports opt-in **Letta Trajectory v1** `.json` files locally into an owner-only, Time-Machine- and Spotlight-excluded `Traces` folder compatible with [NEAR AI Gateway](https://gateway.near.ai) / [Trace Commons](https://github.com/TraceCommons/trace-commons). Cloak itself never uploads traces; reviewing, redacting, submitting, and earning any NEAR AI credits happen in the standalone NEAR AI Gateway app.

#### Venice AI, Boundless + Tempo & Cross-Rail Funding

Sends shielded, locally rephrased prompts over per-conversation Tor circuits (or optional Direct HTTPS for Venice when Tor is turned off) with no centralized consumer AI account required. Tor-routed Venice and Boundless use the NIC-less Linux microVM (`vsock:8020`); optional Direct HTTPS Venice bypasses the microVM and connects straight from the host. Switch between [Venice AI](https://venice.ai) and [Boundless](https://boundless.network) + Tempo via the segmented slider in Settings / Funds or the logo toggle right below the chat composer—when an existing thread already has history with the other provider, Cloak prompts you to either **Start New Thread** or **Send All Thread Context**.

- **[Boundless](https://boundless.network) + Tempo (`USDC.e` via HTTP 402 `MPP`):** Uses a dedicated Tempo wallet (`sh.regents.cloak.wallet`) with session payment channels, cooperative instant **Close**, and a unilateral on-chain **Withdraw** escape hatch (15-minute grace period). Serves frontier models including Anthropic Claude models (`GET /v1/models`).
- **[Venice AI](https://venice.ai) (Base USDC `x402` or API Key):** Generates a dedicated Base USDC wallet (`sh.regents.cloak.venice-wallet`, kept separate from the Boundless/Tempo wallet to avoid cross-chain address reuse), authenticates with Sign-In with Ethereum (`EIP-4361`), and tops up credit via HTTP `x402` (`EIP-3009`). Cloak defaults to Venice's `Private` and `TEE` open-weight model tiers and refuses silent mid-conversation downgrades. **Important distinction:** Venice's zero-retention policy and `Private`/`TEE` tier labels are provider-reported by Venice—Cloak does not independently verify a Venice TEE quote, and a reused wallet or API key can still link requests made with it.
- **Self-Custodial Card/Apple Pay, 1-Tap Cross-Rail Bridge (`Relay.link` + Circle CCTP V2) & `.cloakvault` Recovery:** Fund Base `USDC` or Ethereum `ETH` directly or via Stripe Link / Apple Pay; bridge across all **12 directed pairs** of **Arc Mainnet `USDC`** (`chainID: 5042`), **Base `USDC`** (gasless EIP-3009 — `$0` Base ETH needed), **Tempo `USDC.e`** (paid in `USDC.e`), and **Ethereum `ETH`** (via zkAPI over Tor) with zero arbitrary calldata signing, persistent crash-safe journals, and hard fee/chain guardrails; and export/restore portable password-encrypted `.cloakvault` wallet backups (`600k PBKDF2-HMAC-SHA512` + `ChaChaPoly`, `0o600`).

#### zkAPI Anon Inference (One-Time Zero-Knowledge Keys)

Inspired by [Vitalik Buterin's private AI architecture](https://x.com/VitalikButerin/status/2111046730959433793), zkAPI Anon Inference runs [Open Anonymity's zkAPI](https://zkapi.openanonymity.ai) ([ethereum/zkapi](https://github.com/ethereum/zkapi)) on Ethereum Mainnet.

- **Guest-only LUKS2 payment disk:** Your Ethereum Mainnet deposit and `zkAPI` note secrets live inside a 1 GiB sparse LUKS2-encrypted disk image (`~/Library/Application Support/Regents Cloak/pay/disk.img`) mounted only inside the Linux microVM under a dedicated `cloak-pay` user, isolated even from the built-in coding agent.
- **Reusable ETH deposit, fresh one-time key per turn:** One ETH deposit stays active for up to 30 days and funds many sequential turns (only one deposit can be active at a time; to add more ETH, withdraw first and make a new deposit). For every turn, `zkapi-walletd` proves deposit ownership in zero knowledge (`zkapi-v2-note-bound-v1`), leases a fresh one-time provider API key over a per-conversation Tor circuit, and settles actual token cost automatically after the turn (~35–78 s between back-to-back turns) — so the provider never sees a reusable account, wallet, or API key.
- **Deposit & model tiers:** Open Anonymity uses coarse temporary per-turn escrow holds (`$1.00` Tier 1, `$2.00` Tier 3, `$3.00` Tier 5, `$4.50` Tier 25, `$6.00` Tier 100); only actual token cost is spent and unused funds remain in your deposit. A `$5` deposit unlocks models up through Tier 25 (including Anthropic Claude Sonnet and Claude Opus models), and `$10+` gives headroom for multiple flagship turns. Keep a small ETH buffer in your local wallet outside the deposit to cover Ethereum Mainnet withdrawal gas.
- **30-day vault expiry safety:** `ExpiryGuard` alerts you at Days 20, 25, 28, and 29 (24-hour urgent warning), exposes live macOS notification status & 1-click **Enable Alerts** / **Test Alert** in **Trust & Proofs**, and can optionally auto-withdraw 3 days before expiry.
- **Honest limit:** Payment unlinkability does not prevent correlation from identifying text inside prompts, multi-turn conversation history, or request timing.

### Mode 3: Darkbloom Earn (Inference Serving)

Serve local models on Apple silicon for your own Mac apps or earn payouts on idle compute with [EigenLayer](https://eigenlayer.xyz)'s [Darkbloom](https://darkbloom.dev) (`Off` / `Local Only` / `Network + Local`, macOS 27+). See [Inference Serving (Darkbloom)](https://staging.regents.sh/docs/cloak/reference#inference-serving-darkbloom) below for verification, `--me-first` pausing, and Mac Guardrails details.

## Privacy Boundaries: What Each Layer Actually Does

Cloak separates its local protections into three explicit layers so you know what each layer does—and what it does not claim to do:

| Layer | Where it runs | What it actually does | Honest limit |
| --- | --- | --- | --- |
| **Local Rewriter (`Qwen 3.5 9B`)** | On-device (`llama.cpp`), before Private Cloud (Venice, Boundless, zkAPI), Pi Agent, and cloud Connected Apps | Paraphrases user writing style, filler, politeness, and irrelevant personal framing; **fails closed** on error | Does **not** redact secrets or PII by itself — preserves names, identifiers, file paths, URLs, numbers, code, and exact quotes verbatim. Skipped on `Local ($0)` and `NEAR TEE` |
| **Universal Privacy Shield** | On-device pre-send across all 4 Chat cloud rails, `CloakDoor` (`127.0.0.1:8742`), and the Guest Agent Box | Hard-blocks leaked secrets (PEM private keys, API keys/tokens, JWTs, wallet private keys, BIP-39 seeds, PGP blocks, Bearer headers, and `.env` secrets) before any remote call or payment; applies reversible in-memory alias masking for deterministic patterns (paths, emails, ETH addresses, ENS names, non-loopback IPs) and Project/Private Terms; supports opt-in on-device Neural PII (`NewmeanPII`, 12.1 MB, SHA-256 verified) with **fail-closed blocking** on error | Neural PII is opt-in and skipped on `Local ($0)`; on cloud rails, an unloaded model or inspection error blocks sends by default (`503 neural_pii_unavailable` / Chat stop) unless you explicitly select **Degraded (regex-only)** under **Settings → Connected Apps → Privacy Shield → On-device Neural PII Detector → On inspection error** (in which case Cloak tags the HTTP response header `X-Cloak-Privacy-Mode: degraded-regex-only`). Aliases restore only in human-facing reply prose, never in `tool_calls` arguments |
| **Local Access** | Strictly **Local AI only** (`Local Mode only`, 100% offline) | Supplies opt-in Saved Project Profile folders, PDFs, image OCR, on-device Local Voice (`SpeechAnalyzer`), Hermes `USER.md`/`MEMORY.md` memory, and macOS Calendar/Reminders/Contacts to local chat models | Never available in Private Cloud Inference, the Pi Agent microVM, or `CloakDoor` Connected Apps (even on `Local ($0)`) — zero code path exists from Local Access outside Local AI chat |

## Local Prompt Rephrasing

Before any prompt leaves in Token Inference (Venice / Boundless), zkAPI Anon Inference, Local Agent Box, or cloud Connected Apps rails (`Venice`, `Boundless`, `zkAPI`), Cloak runs a sandboxed local rewriter ([Qwen 3.5 9B](https://huggingface.co/unsloth/Qwen3.5-9B-GGUF), `5.69 GB`) on Metal `llama.cpp` with GBNF grammar constraints.

- **What it changes:** Paraphrases writing style, filler, politeness, and irrelevant personal framing, and **fails closed** if rewriting errors (the original text is never sent automatically on failure).
- **What it preserves verbatim:** By design (`Rewrite.swift`), it keeps **names, identifiers, file paths, URLs, numbers, code, and exact quotations verbatim** so technical requests remain accurate—rely on **Universal Privacy Shield** (Secret Tripwire, Private Terms, and opt-in fail-closed `NewmeanPII`) or stay in **Local AI** rather than expecting the rewriter to redact sensitive facts.
- **Memory management:** Automatically unloads from unified memory after 15 minutes of idle time and wakes transparently on the next request.

## Tor Network, MicroVM & Live Cover Traffic

- **Per-conversation Tor circuits:** Token Inference (when Tor is enabled) and zkAPI Anon Inference allocate a dedicated `IsolateSOCKSAuth` Tor circuit per conversation with remote DNS resolution.
- **No virtual NIC:** The Linux arm64 microVM has zero `VZVirtioNetworkDevice`. Every outbound packet from `cloak-sender`, `cloak-pay`, or the `Pi` agent exits exclusively over `vsock:9050` into the host's Tor relay.
- **Instant Live Cover Traffic + Local Log:** Toggling Cover Traffic ON or OFF takes effect instantaneously with **zero Tor or VM restart**. Running natively on the host over Tor's Unix SOCKS5 socket, it fetches ~3 random public HTTPS pages per minute from a curated 58-URL pool, each on its own fresh Tor circuit, and appends every fetch to an owner-only (`0600`), Time-Machine-excluded log (`cover-log.jsonl`) that you can inspect, copy, or clear (last hour or all) in **Settings → Advanced**.

## Thread & Mode Isolation

Every chat thread in Cloak is **strictly self-contained**—across different modes and across separate threads within the same mode:

- **No cross-thread access:** Every mode constructs its request solely from the single active thread's history. A cloud model can never read a Local AI thread or any other thread.
- **Mode locked on turn 1:** Once a thread sends its first turn, its mode (`Local AI`, `NEAR AI Gateway`, `Token Inference`, or `zkAPI Anon Inference`) is fixed permanently—a Local AI thread can never be routed to a remote provider.
- **Offline-only Local Access:** Opt-in **Settings → Local Access** sources (Saved Project Profile folders, basic Mac info, Hermes-compatible `USER.md`/`MEMORY.md` memory, per-turn PDF/document/image/audio/code attachments, on-device Local Voice via `SpeechAnalyzer`, and macOS Calendar/Reminders/Contacts) are available **exclusively in Local AI chat**. Cloud modes, the Pi Agent VM, and Connected Apps (`CloakDoor`, including `Local ($0)`) have zero code path to Local Access data, and pending local attachments automatically clear when switching threads or leaving Local AI.
- **What to keep in mind:**
  - Sources enabled under **Settings → Local Access** apply across your **Local AI** threads only (never cloud threads or Connected Apps).
  - Toggling the **Venice ↔ Boundless** pill on an existing **Token Inference** thread with prior history prompts you before sending: you can **Start New Thread** (sharing only the new message) or **Send All Thread Context** (rotating the Tor circuit and sending that one thread's locally rewritten history to the newly selected provider—still isolated from all other threads and modes).
  - Separate threads in **NEAR** (same API key) or **Token Inference** (same Venice or Boundless wallet) never share conversation content, though the provider can see both requests were paid by the same key or wallet. **zkAPI Anon Inference** breaks payment-level linkability per prompt, and **Local AI** never leaves your Mac.

## Local Agent Box & Connected Apps (`CloakDoor`)

> **Need the step-by-step CloakDoor coding-agent setup guide?** Read the dedicated single-page quickstart: [Claude Code & CloakDoor Quickstart](https://staging.regents.sh/docs/cloak/claude-code) (covers 1-Click Connect for Claude Code, Codex, Grok Build, OpenCode, and Goose, manual key creation/rotation/revocation for any OpenAI/Anthropic client, per-app rail selection, `ANTHROPIC_API_KEY` vs `ANTHROPIC_AUTH_TOKEN`, Claude model alias mapping, limits, `curl` + tripwire smoke tests, and `cloak` CLI setup).

### Local Agent Box (`Pi`)

Toggle the hammer icon below the composer in **Token Inference** or **zkAPI Anon Inference** to turn a chat into an autonomous multi-step agent session:

- Runs [Pi Coding Agent](https://github.com/earendil-works/pi) (`v1.3.0` on Node.js `v24.22.2`) inside the ephemeral, NIC-less Linux microVM over `vsock:8030`.
- Shell and file tools (`bash`, `read`, `edit`, `write`) execute strictly inside the throwaway Linux VM—never touching your macOS filesystem or Local Access.
- Any web access from agent tools is forced through `torsocks` over Tor.
- Model calls loop back over `vsock:8742` into Cloak's host gateway (`CloakDoor`)—the same host gateway exposed on `127.0.0.1:8742` to Mac apps, also reachable from the guest VM over vsock—where Universal Privacy Shield inspects prompts, user messages rephrase locally, and turns settle over Tor.
- Agent workspace state lives in guest memory and resets cleanly when Cloak restarts.

### Connected Apps (`CloakDoor`)

Keep `Cloak.app` running in your menu bar and open **Settings → Connected Apps** to expose Cloak's localhost-only gateway (`http://127.0.0.1:8742`, `acceptLocalOnly = true`, cross-site browser `Origin` requests rejected) with per-app bearer keys (`cloak-<64 hex>`, SHA-256 hashed on disk), 1-click **Connect** / **Test Connection**, per-app **Rules…**, and setup presets for **Claude Code**, **OpenCode**, **Goose**, and OpenAI-compatible tools:

```bash
# Anthropic Messages API (Claude Code)
# Use ANTHROPIC_AUTH_TOKEN instead of ANTHROPIC_API_KEY if you have an existing claude.ai OAuth login
ANTHROPIC_BASE_URL=http://127.0.0.1:8742 \
ANTHROPIC_API_KEY=cloak-... \
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 \
claude
```

```python
# OpenAI Chat Completions API (Codex, Grok Build, OpenCode, Goose, Hermes, Cline, Aider, Python)
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8742/v1", api_key="<cloak-app-key>")
model = client.models.list().data[0].id
client.chat.completions.create(
    model=model,
    messages=[{"role": "user", "content": "Review PR #418 for edge cases."}],
)
```

### Routing, Claude Model Support & Sandbox Boundaries

Note: `127.0.0.1:8742` (localhost Mac apps) and `vsock:8742` (guest Pi microVM) are the **same host `CloakDoor` gateway** exposed to localhost clients and over vsock.

| Caller | Endpoint / Mode | Payment / Routing Rails | Serves Anthropic Claude models? | Sandbox |
| --- | --- | --- | --- | --- |
| **External Mac app** (`CloakDoor`) | `http://127.0.0.1:8742` (`/v1/messages`, `/v1/chat/completions`, `/v1/models`) | All **5 rails**: `Local ($0)`, `NEAR TEE`, `Venice`, `Boundless (Tempo)`, `zkAPI Anon` | **Yes** on `Boundless (Tempo)` and `zkAPI Anon`; on `Local ($0)`, `NEAR TEE`, and `Venice (Private/TEE)` Claude aliases map automatically to the rail's active open-weight model | External app keeps its own macOS filesystem & network permissions |
| **Built-in Pi Agent** in zkAPI | `vsock:8030` → `vsock:8742` | **zkAPI Anon Inference** | Yes (Open Anonymity catalog) | Sealed NIC-less Linux microVM |
| **Built-in Pi Agent** in Token Inference | `vsock:8030` → `vsock:8742` | **Boundless / Tempo (`USDC.e`)** | Yes (Boundless catalog) | Sealed NIC-less Linux microVM |
| **Interactive Chat** (Venice — Direct HTTPS, Tor off) | Host HTTPS (bypasses microVM) | **[Venice AI](https://venice.ai)** (Base USDC / API key) | No (open-weight Private/TEE tiers) | Host sandbox + Privacy Shield |
| **Interactive Chat** (Tor-routed Venice or Boundless) | `vsock:8020` | **[Venice AI](https://venice.ai)** or **[Boundless](https://boundless.network) / Tempo** | Boundless: yes · Venice: no | NIC-less Linux microVM (`cloak-sender`) |
| **Interactive Chat** (NEAR AI Gateway / Local AI) | `cloak-near` / local worker | NEAR API key / Free (`$0`) | No (NEAR TEE & local open-weight models) | Native Rust verifier / sandboxed local worker |

**API scope, limits & caveats (`v0.6.10 Beta`):**
- **Endpoints:** Anthropic Messages (`POST /v1/messages`, `?beta=true`, `POST /v1/messages/count_tokens` on-device with zero network, `x-api-key` or `Authorization: Bearer`, chunked transfer encoding, tool calling, Claude model aliases) and OpenAI Chat Completions (`GET /v1/models`, `POST /v1/chat/completions` with `tools`, `tool_choice`, `tool_calls`, `max_completion_tokens`, `reasoning_effort`, inline `data:` images). OpenAI `POST /v1/responses` returns `HTTP 404`—configure clients for `/v1/messages` or `/v1/chat/completions`.
- **Limits & streaming:** Max request body **`8 MiB`** (`HTTP 413 request_too_large`), max **`4,096` messages**, max **`8 MiB`** rewritten transcript, max `256`-byte model ID, `n` omitted or `1`, `store: true` rejected, inline `data:` images / `file_data` only. `stream: true` is accepted and returns **buffered SSE** (Cloak waits for the full response so reversible alias restoration and `SpendLedger` settlement complete atomically, then emits a valid Anthropic or OpenAI SSE sequence ending in `message_stop` / `[DONE]`).
- **Local vs VM startup:** `Local ($0)`, direct `NEAR TEE`, and direct `Venice` HTTPS (Tor off) work immediately without pressing **Start** (no Linux VM). Tor-routed Venice, Boundless (Tempo), and zkAPI require pressing **Start** or running `cloak start`.

**Universal Privacy Shield & Spend Guardrails:**
- Before any cloud call or payment, **Universal Privacy Shield** runs the pre-send **Secret Tripwire** (popping an interactive Tripwire HUD on Mac Connected Apps to **Block** [`HTTP 400 secret_blocked`], **Scrub & Send**, or **Reroute Local ($0)**), applies reversible in-memory alias masking (paths, emails, ETH addresses, ENS names, non-loopback IPs, and Project/Private Terms; aliases restore only in human-facing reply prose, never in `tool_calls` arguments), and—when enabled—runs on-device **Neural PII (`NewmeanPII`, 12.1 MB, SHA-256 verified)** fail-closed by default (`503 neural_pii_unavailable`). Opting into **Degraded (regex-only)** under **Settings → Connected Apps → Privacy Shield → On-device Neural PII Detector → On inspection error** allows regex + Private Terms fallback and tags the HTTP response header `X-Cloak-Privacy-Mode: degraded-regex-only`. Neural PII is automatically skipped on `Local ($0)`.
- On Tor cloud rails (`Venice`, `Boundless`, `zkAPI`), the **Local Rewriter** paraphrases only `role == "user"` text parts for writing style while system/developer instructions, tool definitions, tool results, assistant turns, and accepted media parts pass through unchanged. An in-memory Activity log lets you inspect Original vs. Sent user text and **What Cloak sent** receipts for the latest 20 requests without writing request contents to disk.
- **Fail-closed Spend Guardrails (`SpendLedger`):** Enforce configurable per-request, daily, and calendar-month USD caps (globally and per app) with persistent receipt tracking across restarts and history clears. If `spend-receipts.json` is unreadable or corrupted, Cloak never resets into a fresh allowance—it quarantines the raw bytes to a `0o600` `.corrupt-*.json` backup, sets remaining allowance to `$0`, blocks paid requests (`503 spend_ledger_corrupted`), and provides explicit **Reveal Backup** and **Reset Ledger & Resume** controls in **Settings → Connected Apps**.

## Inference Serving (Darkbloom)

Cloak integrates **Darkbloom Earn** (Inference Serving) via [Darkbloom](https://darkbloom.dev) ([console.darkbloom.dev](https://console.darkbloom.dev/) · [Eigen Labs / Layr-Labs/d-inference](https://github.com/Layr-Labs/d-inference)) on macOS 27+ to serve local models to your own apps or optionally earn payouts from idle Apple silicon memory:

- Verifies `~/.darkbloom/bin/darkbloom` against Darkbloom's pinned macOS Developer ID Team ID (`SLDQ2GJ6TL`) and leaf certificate hash before talking to its loopback-only control API.
- Provides a unified 3-way **Serving Mode** control (**Off** / **Local Only** / **Network + Local**), computes available memory headroom alongside Cloak, ranks fitting models by live payout rate, displays an **Earn-to-Spend** prompt offset, monitors live telemetry (daemon uptime, served requests, output tokens, and memory) over SSE, stays in sync with local `darkbloom` CLI changes, and honors Darkbloom's `--me-first` activity pausing plus **Cloak Mac Guardrails (QoS)** — event-driven OS watchers (`IOPSNotificationCreateRunLoopSource` AC/battery, macOS Low Power Mode, `ProcessInfo.thermalState`, display/system wake, and exact Quiet Hours boundaries with zero default polling) that stay active even when Settings is closed. Under `Local Mac only` and `zkAPI only` Security Profiles, `Network + Local` is disabled while `Local Only` remains available.

## Native macOS Shell, CLI & Requirements

| Mode | Mac RAM | Model download | Needs `Qwen 3.5 9B` rewriter (5.69 GB)? |
| --- | --- | --- | --- |
| **NEAR AI Gateway** | 8 GB+ | **0 GB** | No |
| **Local AI (`Qwen 3.5 4B` MLX + Vision)** | 8 GB+ | **2.94 GB** | No |
| **Local AI (`Inkling 2 Mini` Ora 2.4/2.6bpw GGUF + Vision)** | 16 GB+ | **8.41 GB / 9.09 GB** (incl. 642 MB `mmproj`) | No |
| **Local AI (`Inkling 2 Mini` Fast MLX)** | 16 GB+ | **10.21 GB** (`~5.6 GB` working RAM) | No |
| **Local AI (`Inkling 2 Mini` GGUF + optional 44 MB LoRA)** | 24 GB+ / 32 GB+ | **13.63 GB** / **17.63 GB** | No |
| **Token Inference (Tor), zkAPI Anon Inference, Cloud Connected Apps, Agent** | 16 GB+ | **5.69 GB** (`Qwen 3.5 9B`) | Yes |

- **Encrypted local storage & native math:** Saved chats, Connected App hashes, and Tempo deposit state are authenticated with ChaCha20-Poly1305 inside owner-only (`0700`) Application Support folders (eliminating atomic-write permission windows via `Places.writeOwnerOnlyAtomically`), rendered with pure-Swift Markdown and LaTeX math. Ephemeral mode (`Save chat history: Off`) keeps new threads strictly in RAM.
- **Menu bar, Quick Prompt, Widgets & Bundled `cloak` CLI:** Native Liquid Glass menu bar panel, Carbon-hotkey Quick Prompt (zero Accessibility permission required), Control Center toggles, Desktop widgets, EdDSA-signed updates via [Sparkle 2.8.1](https://sparkle-project.org), and the bundled CLI at `/Applications/Cloak.app/Contents/MacOS/cloak` (`sudo ln -sf /Applications/Cloak.app/Contents/MacOS/cloak /usr/local/bin/cloak`). Subcommands (all accept `--json`): `cloak status`, `cloak start`, `cloak pause`, `cloak resume`, `cloak stop`, `cloak verify`, `cloak doctor`, `cloak crypto-status`, and `cloak verify-release`.
- **Offline Data:** **Settings → Offline Data** provides progressive **Minimum → Maximum** downloads for **Kiwix Library** (`174 MB → 61 GB`), **DevDocs** (`15 MB → 240 MB`, 1-click linkable into Local AI), **CourtListener Bulk Data** (`540 KB → 58.3 GB`), **PubMed Central Open Access** (AWS S3 CLI), and [Tinfoil Kit](https://github.com/tudor-city-ventures/tinfoil-kit).
- **Trust & Proofs & Release Verification (pinned to `0.6.10-379`):** Every release starts as a ~26 MB core DMG (`Regents-Cloak-0.6.10-379.dmg`, SHA-256 `e9d52aee4e90a4eda635325b60415bb7fd260c2bf63d2e3c38e0a0e8087d8962`) with optional MLX and Sealed Linux VM runtime packs downloaded on demand and verified against SHA-256 pins embedded in Cloak's Apple-notarized manifest. Immutable per-tag checksums for the DMG, installed `Cloak.app/Contents/MacOS/RegentsCloak` binary, and Apple Developer ID `CDHash` (Team `367G3Z7G3J`) are published at [Release 0.6.10-379](https://github.com/regents-ai/cloak/releases/tag/0.6.10-379) ([SHA256SUMS.txt](https://github.com/regents-ai/cloak/releases/download/0.6.10-379/SHA256SUMS.txt)) and [regents.sh/cloak/install](https://staging.regents.sh/docs/cloak/install#verify-your-download). Open **Settings → General → Status → Trust & Proofs** to inspect live Intel TDX + NVIDIA GPU attestations, hybrid PQ TLS logs, live binary SHA-256/`CDHash`, Everystate TLA+ / Z3 formal proofs, and export SHA-256-fingerprinted redacted `0600` JSON cloud audit receipt bundles (omitting all raw PII originals, secrets, and plaintext prompts).

## Links & Source Code

- Product page: [regents.sh/cloak](https://staging.regents.sh/cloak) · Pricing: [regents.sh/pricing](https://staging.regents.sh/pricing) · Install guide: [regents.sh/cloak/install](https://staging.regents.sh/docs/cloak/install)
- Claude Code & CloakDoor Quickstart: [regents.sh/docs/cloak/claude-code](https://staging.regents.sh/docs/cloak/claude-code)
- Releases (signed & notarized DMGs): [github.com/regents-ai/cloak/releases](https://github.com/regents-ai/cloak/releases)
- Open-source repository: [github.com/regents-ai/cloak](https://github.com/regents-ai/cloak)
- Feedback & questions: [regents.sh/patchbay/cloak](https://staging.regents.sh/patchbay/cloak) · [github.com/regents-ai/cloak](https://github.com/regents-ai/cloak) · [@regents_sh](https://x.com/regents_sh) · [build@regents.sh](mailto:build@regents.sh)