---
title: Multigravity Security & Zero-Knowledge E2EE Architecture (mgy-e2ee-v1)
canonical: https://multigravity.app/security.html
lang: en
version: 1.2.8
updated: 2026-11-28
---

# Multigravity Security & Zero-Knowledge E2EE Architecture

**Security Summary:** Multigravity is a self-hosted MIT open-source local companion for your official Google Antigravity IDE/CLI. It **never extracts Google OAuth tokens**, **never proxies Google APIs**, and stores zero source code or chat history on developer servers. Remote relay traffic enforces zero-knowledge end-to-end encryption (`mgy-e2ee-v1`: **ECDH P-256 + HKDF-SHA256 + AES-256-GCM**), hard-rejecting plaintext with `HTTP 426 Upgrade Required`.

## 1. Zero Token Extraction & Official Harness Boundary

```text
iPhone / iPad / Android / Web PWA
   ──[LAN Wi-Fi | Tailscale | E2EE Relay (mgy-e2ee-v1) | Cloudflare HTTPS]──▶
Local Go Gateway (`mgy` on your macOS / Linux / Windows machine)
   ──▶ Local Official Google Antigravity IDE / CLI (`language_server`)
```

- All model invocations, MCP tools, skills, workspace file reads, and `/swarm` executions happen exclusively inside your official local Google Antigravity installation.
- No Google credentials, cookies, or repository snapshots are uploaded to external servers.
- Auditable MIT source paths:
  - E2EE library: <https://github.com/GHSaiMo/antigravity-mobile/tree/main/internal/e2ee>
  - Stateless APNs Worker: <https://github.com/GHSaiMo/antigravity-mobile/tree/main/scripts/cloudflare-apns-worker>

## 2. Transport Paths & Trust Boundaries

| Transport Path | What Traverses It | Encryption Layer | Who Can Read Payloads |
| :--- | :--- | :--- | :--- |
| LAN Wi-Fi / Tailscale | Direct HTTP + WebSocket between phone and local `mgy` | Local network / WireGuard (Tailscale) + device auth token | Only your phone and your local computer |
| Multi-Region E2EE Relay | Opaque encrypted HTTP envelopes & WebSocket frames | TLS + mandatory `mgy-e2ee-v1` (ECDH P-256 + HKDF-SHA256 + AES-256-GCM) | Only your phone and local computer (plaintext rejected with `HTTP 426`) |
| Bring-Your-Own Cloudflare Tunnel | Gateway traffic via `mgy cloudflare` | Cloudflare TLS + device authentication | Controlled under your own Cloudflare account |
| Stateless APNs Worker (`push.jiuge.space`) | Short push alerts (approvals, Live Activity steps) | HTTPS + Apple APNs TLS; ES256 JWT cached in memory only (45 min) | Stateless pass-through; zero DB, zero logs; self-hostable on free Cloudflare Workers |

## 3. Inside `mgy-e2ee-v1`

- **Gateway Identity Key (`internal/e2ee/crypto.go`):** Persistent NIST P-256 ECDH keypair at `~/.multigravity/e2ee_identity.json` with `0600` file permissions.
- **Per-Device Pairing & Key Derivation:** Directional session keys derived via `HKDF-SHA256` (`PairSalt = "mgy-e2ee-pair-v1"`, info `mgy-e2ee-v1:<deviceID>:<direction>`).
- **Authenticated Ciphertext:** Every HTTP envelope and WebSocket frame sealed with `AES-256-GCM` using a fresh 96-bit random nonce (`NonceSize = 12`, `KeySize = 32`).
- **Fail-Closed Plaintext Guard (`internal/e2ee/http.go`):** Requests tagged `WithRelayTransport(ctx)` without valid E2EE wrapping are rejected with `HTTP 426 Upgrade Required`.

## 4. Credentials, Android Signing & Instant Revocation

- Pairing tokens & E2EE keys are stored exclusively in Apple Keychain (iOS/iPadOS) or EncryptedSharedPreferences (Android).
- Direct-install Android APKs are signed with an offline private release keystore and SHA-256 verified inside the built-in updater.
- Run `mgy list` to inspect paired devices or `mgy clear all` to revoke every paired client immediately.
