// Security · last updated 2026-05-06 ความปลอดภัย · update ล่าสุด 2026-05-06

Where your data actually lives. ข้อมูลของคุณอยู่ที่ไหนจริง ๆ

Most "privacy" pages are written by lawyers. This one is written by the engineer who shipped the code. Cosmos is in private alpha — source access is for invited testers only while the product matures. Spot something wrong? Use the in-app Send Feedback button or /feedback — every submission lands in our triage queue. หน้า "privacy" ส่วนใหญ่นักกฎหมายเขียน. หน้านี้วิศวกรที่ ship code เขียนเอง. Cosmos อยู่ใน private alpha — source access เฉพาะ tester ที่ได้รับเชิญในช่วงนี้. เจออะไรผิด? ส่งข้อความผ่านปุ่ม Send Feedback ในแอพ หรือ /feedback — ทุก submission เข้า triage queue ของเรา

// 01 · data flow 01 · เส้นทางข้อมูล

What stays local. What leaves. อะไรอยู่บนเครื่อง · อะไรออกข้างนอก

Cosmos is a Tauri app + Python sidecar bundled together. Everything below the dotted line runs on your machine with zero network requests — verifiable by running lsof -i -P on the running process. macOS today; Windows + Linux later.

Cosmos คือ Tauri app + Python sidecar bundle รวมกัน. ทุกอย่างใต้เส้นประใน diagram ทำงานบนเครื่องคุณ network request เป็นศูนย์ — verify ได้โดยรัน lsof -i -P กับ process. ตอนนี้ macOS; Windows + Linux ตามมาทีหลัง

architecture_map.txt
┌─ YOUR MAC ─────────────────────────────────────────────┐
│                                                        │
│   Tauri shell (Rust)  ◄──IPC──►  Python sidecar        │
│        │                          │                    │
│        │                          ├─ SQLite + FTS5     │
│        │                          │  ~/Library/...     │
│        │                          │  /brain.db         │
│        │                          │                    │
│        │                          ├─ embedding model   │
│        │                          │  (Tier 1 MiniLM    │
│        │                          │   on-device)       │
│        │                          │                    │
│        │                          └─ MCP server (stdio) ──── used by Claude
│                                   Code / Cursor /      │
│                                   Cline locally        │
└────────────────────────────────────────────────────────┘
                       │  (only if you opt in)
                       ▼
┌─ CLOUD (Pro only) ─────────────────────────────────────┐
│                                                        │
│   Supabase Auth  ───────► email + hashed password      │
│   Supabase Storage ─────► backup blobs (TLS, RLS,      │
│                            plaintext at rest until Q3)  │
│   Stripe ───────────────► billing token (no card #)    │
│                                                        │
│   ── nothing else. no telemetry. no analytics. ──      │
└────────────────────────────────────────────────────────┘

BYOK (Anthropic / OpenAI / Google) calls go from your machine directly to the model vendor — Cosmos doesn't proxy them. The planned Pro hosted AI bridge (post-launch, opt-in) is the exception by design: it proxies your prompt through our infrastructure so you don't have to manage a key. If you're on BYOK, your traffic doesn't touch our servers; if you opt in to the hosted bridge, it does.

BYOK (Anthropic / OpenAI / Google) call ไปจากเครื่องคุณตรงไปยัง model vendor — Cosmos ไม่ proxy ผ่าน. ยกเว้นกรณี hosted AI bridge ใน Pro ในอนาคต (เลือกเปิด): proxy prompt ผ่าน infrastructure ของเรา เพื่อให้ไม่ต้องจัดการ key เอง. ถ้าใช้ BYOK · traffic ไม่ผ่านเซิร์ฟเวอร์เรา; ถ้าเปิด hosted bridge · traffic ผ่าน

// 02 · brain at rest 02 · brain ที่ rest

The local SQLite database. SQLite database บนเครื่อง

02.1 · Path
The database is stored locally at: Database ถูกจัดเก็บไว้ที่เครื่อง:
~/Library/Application Support/com.atitechs.cosmos/brain_v2/brain.db
02.2 · Mode
SQLite WAL mode (concurrent-read safe). Single-user; no auth layer because the OS already gates file access. SQLite WAL mode (concurrent-read ปลอดภัย). Single-user; ไม่มี auth layer เพราะ OS gate การเข้าถึง file ให้แล้ว
02.3 · Encryption
Not encrypted at rest. macOS FileVault encrypts the disk; that's the layer we rely on. We don't double-encrypt because (a) the db needs to be searchable instantly and (b) re-deriving an encryption key per query gives no real security against an attacker who already has your shell. ไม่ encrypt at rest. macOS FileVault encrypt ทั้ง disk; เราพึ่ง layer นั้น. ไม่ double-encrypt เพราะ (a) db ต้องค้นได้ทันที (b) derive key ใหม่ทุก query ไม่ได้ป้องกันจริงถ้า attacker เข้า shell คุณได้แล้ว
02.4 · Access
Only localhost:7824 (the sidecar). The port refuses non-loopback connections — verifiable with curl --interface en0. เฉพาะ localhost:7824 (sidecar). Port ปฏิเสธ connection ที่ไม่ใช่ loopback — verify ได้ด้วย curl --interface en0
// 03 · cloud backup (Pro only) 03 · cloud backup (Pro เท่านั้น)

What Supabase actually sees. Supabase เห็นอะไรจริง ๆ

When you click Backup Now (or auto-backup fires every 24h), Cosmos uploads a single .db snapshot to Supabase Storage. Today the snapshot is sent over TLS but stored as-is. This is the biggest honest gap in the current product and is what we are working on next:

เมื่อคุณกด Backup Now (หรือ auto-backup ยิงทุก 24 ชม.) Cosmos upload .db snapshot ไฟล์เดียวไป Supabase Storage. ตอนนี้ส่งผ่าน TLS แต่เก็บแบบไม่ encrypt. นี่คือ gap ที่ตรงไปตรงมาที่สุด ในตัว product ปัจจุบัน และคือสิ่งที่เรากำลังทำต่อ:

ROADMAP — Q3 2026 ROADMAP — Q3 2026

Client-side encryption with a passphrase derived locally (Argon2id → AES-GCM). Supabase will see ciphertext only and we will not be able to decrypt your backups even if subpoenaed. Tracked in CLOUD_SYNC_ARCHITECTURE.md §6 (alpha invitees only).

Client-side encryption ด้วย passphrase ที่ derive บนเครื่อง (Argon2id → AES-GCM). Supabase จะเห็นแค่ ciphertext เท่านั้น และเราจะ decrypt backup ของคุณไม่ได้เลย แม้ถูก subpoena. Track ใน CLOUD_SYNC_ARCHITECTURE.md section 6 (alpha invitees only)

Today's backup setup uses Supabase Storage with these RLS policies on the cosmos-backups bucket (taken from migration 0006):

ปัจจุบัน backup ใช้ Supabase Storage กับ RLS policy เหล่านี้ บน bucket cosmos-backups (มาจาก migration 0006):

migration_0006.sql
-- Read: only the owner of the file path
create policy "owner_read"  on storage.objects for select
  using ( bucket_id = 'cosmos-backups'
          and (storage.foldername(name))[1] = auth.uid()::text );

-- Write: only into your own folder
create policy "owner_write" on storage.objects for insert
  with check ( bucket_id = 'cosmos-backups'
               and (storage.foldername(name))[1] = auth.uid()::text );

-- (delete + update mirror the same predicate)

Storage paths are /{user_uuid}/{device_id}/{ts}.db. Even with a misconfigured client, RLS forces the bucket prefix to your auth user — cross-tenant reads are rejected at the database layer, not the application.

Storage path คือ /{user_uuid}/{device_id}/{ts}.db. แม้ client จะ config ผิด RLS จะบังคับให้ bucket prefix ตรงกับ auth user ของคุณ — cross-tenant read ถูกปฏิเสธที่ database layer ไม่ใช่ที่ application

// 04 · MCP & AI vendors 04 · MCP & AI vendor

When Claude / Cursor sees your code. เมื่อ Claude / Cursor เห็น code ของคุณ

Cosmos itself doesn't send your code anywhere. But your AI coding tool does — that's the whole point of using one. The MCP integration changes when and how much code is sent to the model:

ตัว Cosmos เองไม่ส่ง code คุณไปไหน. แต่ AI coding tool ของคุณส่ง — นั่นคือเหตุผลที่ใช้มัน. MCP integration เปลี่ยน เมื่อไหร่ และ มากแค่ไหน ที่ code ถูกส่งไป model:

Before · Without Cosmos
Claude reads files via its own Read tool. Whole files (sometimes 1000+ lines) end up in the model context. Anthropic processes everything you paste / Claude reads. Claude อ่าน file ผ่าน Read tool ของมันเอง. file ทั้งไฟล์ (บางที 1000+ บรรทัด) เข้าไปใน context ของ model. Anthropic process ทุกอย่างที่คุณ paste / Claude อ่าน
Optimal · With Cosmos MCP
Claude calls code_get_symbol and gets back just the function body — typically 30–100 lines instead of the whole file. Less code reaches Anthropic per query, not more. Claude เรียก code_get_symbol แล้วได้แค่ body ของ function — ปกติ 30–100 บรรทัดแทนที่จะเป็นทั้งไฟล์. code ที่ไปถึง Anthropic ต่อ query น้อยลง ไม่ใช่มากขึ้น
Contextual · Brain notes
Only sent to Claude when Claude calls brain_search — typically when you ask "what was that bug last week" or "what's our convention for X". Notes you never query never leave your machine. ส่งไป Claude เฉพาะตอน Claude เรียก brain_search — ปกติเวลาคุณถาม "bug อาทิตย์ที่แล้วคืออะไร" หรือ "convention ของเราสำหรับ X คืออะไร". note ที่คุณไม่เคย query ไม่เคยออกจากเครื่อง

Anthropic's data policy applies to anything Claude reads — Cosmos cannot change that, but Cosmos's per-symbol retrieval gives you a finer-grained way to control what reaches them.

Data policy ของ Anthropic มีผลกับทุกอย่างที่ Claude อ่าน — Cosmos เปลี่ยนสิ่งนั้นไม่ได้ แต่ retrieval ระดับ symbol ของ Cosmos ทำให้คุณคุมว่าอะไรไปถึงพวกเขาได้ละเอียดกว่า

// 05 · auth & billing 05 · auth & billing

Email, password, and Stripe tokens. Email, password, และ Stripe token

05.1 · Auth
Auth is handled by Supabase Auth (GoTrue) — email + bcrypt-hashed password, plus optional Google OAuth. We never see plaintext passwords. Auth จัดการโดย Supabase Auth (GoTrue) — email + password ที่ bcrypt-hashed บวก Google OAuth (ถ้าเลือก). เราไม่เห็น password แบบ plaintext เลย
05.2 · Billing
Billing is Stripe Checkout. Cosmos receives only the customer + subscription IDs via webhook; card numbers / CVV / expiry never touch our infrastructure. Billing ใช้ Stripe Checkout. Cosmos รับแค่ customer + subscription ID ผ่าน webhook; เลขบัตร / CVV / วันหมดอายุไม่เคยแตะ infrastructure ของเรา
05.3 · Sessions
Sessions stored in Supabase Postgres with RLS that scopes every row to auth.uid(). See migrations supabase/migrations/0002–0008. Session เก็บใน Supabase Postgres ด้วย RLS ที่ scope ทุก row ไปที่ auth.uid(). ดู migration supabase/migrations/0002–0008
// 06 · what we can see 06 · เราเห็นอะไรบ้าง

If you subpoena Atitechs, you get… ถ้าคุณ subpoena Atitechs จะได้…

We have เรามี
  • • Your email + password hash
  • • Subscription status + Stripe customer ID
  • • Device IDs that uploaded a backup
  • • Encrypted backup blobs (today: TLS-only, plaintext at rest until Q3 client-side encryption ships)
  • • License-check timestamps (proves the app phoned home, not what was searched)
  • • Email + password hash ของคุณ
  • • สถานะ subscription + Stripe customer ID
  • • Device ID ที่ upload backup
  • • Encrypted backup blob (ตอนนี้: TLS-only, plaintext at rest จนกว่า client-side encryption จะ ship Q3)
  • • Timestamp ของ license check (พิสูจน์ว่า app phone home, ไม่ใช่ว่า search อะไร)
We don't have เราไม่มี
  • • Your search queries
  • • Your code or brain notes (until you back up, and that becomes opaque after Q3)
  • • Your card number
  • • Telemetry on what features you use
  • • IPs of your machine after install (the license check uses Supabase Edge — they log it; we don't store it)
  • • Search query ของคุณ
  • • Code หรือ brain note (จนกว่าคุณจะ backup และหลัง Q3 ก็จะเป็น opaque)
  • • เลขบัตรของคุณ
  • • Telemetry ว่าใช้ feature ไหน
  • • IP ของเครื่องคุณหลังติดตั้ง (license check ใช้ Supabase Edge — เขา log; เราไม่เก็บ)

Questions this page didn't answer? มีคำถามที่หน้านี้ไม่ได้ตอบ?

cosmos@atitechs.com