Quira Quira Docs
GitHub Star

Advanced Security Architecture

Beyond the core security layers, Quira introduces eight novel security structures inspired by macOS deep mechanisms that no existing browser implements. Each is grounded in the formal threat model and addresses specific adversary classes.

Research status

These structures are at the research and design stage. They build on the Permission System and Privacy Architecture foundations. For eight additional emergent security structures that extend and combine these, see Emergent Security.

Knowledge Protection Classes (KPC)

Inspired by iOS Data Protection Classes (A-D), KPC applies state-dependent graduated encryption to the Context Graph. Quira's current encryption (SQLCipher) is a single key for the entire database — equivalent to iOS Class C. KPC introduces four classes where data accessibility depends on authentication state.

Four protection classes

ClassScopeKey availableKey destroyed
KPC-A (Active Research)Active Space graph dataWhile Space is in foreground + authenticatedImmediately when Space goes to background
KPC-B (Session)Spaces accessed this sessionAfter first auth per sessionBrowser exit
KPC-C (Index Only)FTS5 index + graph topology subsetAfter master password / biometricOS shutdown
KPC-D (Structural)Node count, Space names, timestampsAlways (UID-derived key)Remote wipe only

The key hierarchy uses HKDF derivation: Master Key (Argon2id from passphrase + hardware UID) derives class-specific keys at each level.

Threat model coverage

AdversaryAttackKPC defense
OS-level (A4)Memory dumpOnly active Space data is decrypted — damage limited to that Space
OS-level (A4)Cold boot attackSession keys exist only in volatile memory — power loss destroys all keys
OS-level (A4)Disk theft (power off)All classes require Master Key — no decryption without passphrase
Extension (A3)Full graph readNon-active Spaces have no decryption key in memory

Context Security Event Bus (CSEB)

Inspired by macOS Endpoint Security Framework, CSEB is a programmable real-time event monitoring system for all graph operations. Unlike signature-based detection, CSEB provides AUTH (blocking) and NOTIFY (observe-only) modes.

World first

No browser implements a programmable security event bus for internal graph operations. CSEB is the most novel structure in Quira's architecture.

Event types and rules

CategoryEvent typesModeExample
Graph.Readnode.read, edge.read, query.executeNOTIFYExtension reads node content
Graph.Writenode.create, node.update, edge.createAUTHAI adds entity
Graph.Exportexport.json, clipboard.copyAUTHData leaves browser
AI.Pipelineai.extract, ai.embed, ai.queryAUTHEach AI pipeline stage
Extension.APIext.graph.read, ext.network.sendAUTHExtension API call

Rules are stackable (built-in + community + user) with actions: ALLOW, DENY, THROTTLE, QUARANTINE. Example: block bulk exports over 100 nodes from extensions.

Architecture

All components emit events to a lock-free ring buffer. The rule engine evaluates in real time. AUTH events block until a decision is made. An append-only audit log records all decisions for forensic analysis.

Knowledge Query Relay (KQR)

Inspired by iCloud Private Relay (MASQUE / ODoH), KQR provides structural separation of identity and query content when using Cloud AI.

EntityKnowsDoes NOT know
Relay 1 (Quira)User ID, subscription statusQuery content, AI response
Relay 2 (independent third party)Query content (plaintext)User ID, IP address
AI ComputeQuery contentUser identity (via Relay 2)

Authentication uses RSA blind signatures — Relay 1 issues tokens but cannot track which token is used for which query. Built on OHTTP (RFC 9458) and Privacy Pass (RFC 9578).

Privilege-Separated Context Services (PSCS)

Inspired by macOS XPC Services, PSCS decomposes security-critical components into isolated microservices with minimum privileges.

ServiceCapabilitiesCannot access
Graph EngineDB read/write, FTS5, KPC keysNetwork, GPU
AI PipelineModel read-only, GPU/CPU, temp memoryDatabase, network
Permission ManagerTCC database, policy evaluation, audit logGraph data, network
Export ServiceGraph read (via Graph Engine), file writeNetwork
Extension HostExtension storage, graph via IPC onlyDirect DB access
Update ServiceNetwork read, code signing verificationGraph data

Critical constraint: AI Pipeline cannot directly access the database. All graph access goes through Graph Engine IPC. If prompt injection compromises the AI pipeline, it cannot write to the database.

Sealed Knowledge Volume (SKV)

Inspired by macOS Sealed System Volume (SSV), SKV creates cryptographic commitments to graph state at a point in time.

  • Research priority proof — Prove a knowledge node existed at time T via Merkle path + timestamp authority (RFC 3161)
  • Proof of absence — Prove a topic did NOT exist in your graph at time T using Sparse Merkle Trees
  • Incremental sealing — Only re-hash changed nodes/edges, not the entire graph

Use cases: proving research precedence, legal disputes (demonstrating non-access to certain information), integrity verification after compromise.

Context Trust Arbiter (CTA)

Inspired by macOS AMFI (Apple Mobile File Integrity), CTA is a single point of decision for all security judgments. Instead of each subsystem making independent trust decisions, CTA evaluates every request through a unified pipeline:

  1. Identity verification (code signing)
  2. Capability evaluation
  3. TCC permission check
  4. Policy evaluation (declarative)
  5. KPC state check (protection class vs. auth level)
  6. CSEB context check (recent event patterns)

Short-circuit evaluation: first DENY returns immediately. ALLOW requires all checks to pass.

Adaptive Security Posture (ASP)

Going beyond binary Lockdown Mode, ASP adjusts security level continuously based on environmental signals.

Posture rangeLevelBehavior change
0.0–0.2LockdownAI disabled, exports blocked, extensions disabled
0.2–0.4High AlertCloud AI blocked, local AI only, exports require confirmation
0.4–0.6ElevatedExtension rate limits tightened, KPC-A auto-applied
0.6–0.8NormalDefault settings
0.8–1.0RelaxedApproved environment, performance-optimized caching

Signals: network type (public WiFi lowers posture), time since auth, CSEB anomaly detection, OS update status, external device connections.

Implementation priority

PhaseStructureRationale
Phase 1PSCS, CSEBFoundation — process separation and event monitoring enable all other structures
Phase 2KPC, CTA, SKVCore protection — graduated encryption, unified trust, cryptographic commitments
Phase 3ASPAdaptive response — requires CTA and CSEB in place
Phase 4KQRCloud AI privacy — needed only when Cloud AI features launch
← Previous: Permission System Next: Emergent Security →
Was this page helpful?
Ask AI
Q

Ask anything about the documentation

Ctrl+K to open anytime