Security & Webview Sandboxing
Relevant source files
The following files were used as context for generating this wiki page:
Security in mausVoice is built on a "Rust is the API, TypeScript is the Brain" architecture, leveraging Tauri v2's native sandboxing capabilities. The system enforces a strict Content Security Policy (CSP), hardware-backed encryption for sensitive credentials, and restricted IPC (Inter-Process Communication) boundaries to ensure that external AI providers cannot access sensitive system commands.
The project prioritizes local-first data integrity, allowing for fully offline operation via local Whisper models to ensure that voice data never leaves the machine unless explicitly configured otherwise.
Sources: CLAUDE.md, llms.txt, README.md
Content Security Policy (CSP) Implementation
The application implements a restrictive CSP to mitigate Cross-Site Scripting (XSS) and unauthorized data exfiltration. The configuration explicitly prohibits unsafe-inline and unsafe-eval for scripts, ensuring that only trusted, bundled code executes within the Webview context.
CSP Configuration Details
| Directive | Policy Setting | Purpose |
|---|---|---|
default-src | 'self' | Restricts all resources to the application origin by default. |
script-src | 'self' | Disables inline scripts and eval to prevent code injection. |
style-src | 'self' 'unsafe-inline' | Allows Emotion/MUI runtime styles to function correctly. |
connect-src | Restrictive Allowlist | Limits network requests to localhost and specific AI provider domains. |
img-src | Scoped Origins | Restricts image loading to trusted hosts (e.g., Google, YouTube, Gravatar). |
Sources: apps/desktop/src-tauri/tauri.conf.json:34-36, CLAUDE.md:39-44, apps/desktop/src/tauri-conf.test.ts:25-45
Runtime Style Handling
A specific exception is made for style-src using the dangerousDisableAssetCspModification setting. This prevents Tauri from automatically injecting nonces or hashes into style tags, which would otherwise cause the browser to ignore the 'unsafe-inline' directive required for Material UI (MUI) and Emotion styles to render.
Sources: CLAUDE.md:39-44, apps/desktop/src/tauri-conf.test.ts:33-40
Communication & IPC Sandboxing
The architecture maintains a strict separation between the Webview (TypeScript) and the native system (Rust). External API domains are allowlisted for network access but are explicitly denied access to Tauri IPC commands.
The diagram shows that while the TypeScript layer can communicate with both the Rust API and external providers, the external providers have no path to trigger native Rust capabilities.
Sources: CLAUDE.md:46-48, llms.txt:30-40
Data Encryption & Local Security
Sensitive information, specifically API keys for Deepgram and Groq, is never stored in plain text. mausVoice utilizes the XChaCha20-Poly1305 encryption algorithm to secure these credentials on the local disk.
Security Features Table
| Feature | Implementation | Source |
|---|---|---|
| Credential Encryption | XChaCha20-Poly1305 | README.md:92-95 |
| Local-Only Mode | Local Whisper (CPU/GPU) | llms.txt:68-70 |
| Asset Isolation | assetProtocol.scope | CLAUDE.md:39-44 |
| Protocol Security | Restricted to $APPDATA/transcription-audio/** | apps/desktop/src-tauri/tauri.conf.json:38-41 |
Sources: README.md:92-95, llms.txt:68-70, apps/desktop/src-tauri/tauri.conf.json:38-41
Network Access Control
Network access is managed through two synchronized allowlists: connect-src in the CSP and the http:default permission set.
This flow illustrates the dual validation where the CSP controls outbound web traffic and the Capability system controls access to internal Rust commands.
Sources: CLAUDE.md:46-51, apps/desktop/src-tauri/tauri.conf.json:36-37
Conclusion
The security model of mausVoice ensures that the high-performance capabilities of Rust (audio capture, keyboard injection) are protected from the Webview's external interactions. By combining strict CSP directives, encrypted storage for API keys, and scoped asset protocols, the application provides a secure environment for AI-assisted dictation without compromising user privacy or system integrity.