Problem & Inspiration

Log leaks from AI model providers (like OpenAI or Anthropic) pose a real threat to privacy. Users unknowingly put API keys, emails, credit card numbers, passwords, or IBANs into their prompts. Simple data masking on the server is not enough if the proxy server itself is compromised. Our goal was to create a tool (for the AI pipeline secret sharing track) where the AI agent (and our own server) never sees sensitive data.

What QuackVault Does (The Solution)

QuackVault allows you to use hosted LLM models (OpenAI, Gemini, AWS Bedrock) while maintaining 100% privacy thanks to a zero-knowledge architecture for secrets:

  1. The browser automatically detects sensitive data (regexes for keys, emails, cards, etc., and anything in {{ }} tags).
  2. Each secret is immediately encrypted in the browser before being sent. It is replaced in the prompt text with a secure placeholder, e.g., [[S1]].
  3. Our server (gateway) only sees the placeholders and the ciphertext. It acts as a "blind relay" to the LLM provider. We also equipped it with a Leak Guard – a mechanism that scans requests again and rejects those where something plaintext might have slipped through.
  4. After processing by the LLM and streaming the response via SSE (Server-Sent Events), the user's browser automatically decrypts the vault and replaces the placeholders (rehydration).

The master key is generated and stored locally in localStorage – it never leaves the user's device.

How We Built It & Tech Stack

To maximize security and performance, we relied on solid technologies:

  • Gateway (Backend): Written in the low-level Rust language (using the axum framework), which guarantees memory safety and excellent performance for SSE streaming.
  • Frontend: Built in React with a friendly, pastel, and minimalist UI that clearly shows the status of data at each stage of the pipeline ("as the provider wrote it" vs "rehydrated").
  • Deployment: We packaged everything into containers (Docker/Podman Compose), making testing instantaneous (e.g., via the default mock provider mode).

Cryptography and The Math

We applied two pillars of security:

  1. GCM Encryption: We used the native WebCrypto API for AES-256-GCM encryption. This provides not only confidentiality but also authenticated encryption (AEAD) – ensuring data integrity and preventing manipulation by the server (any attempt to modify the ciphertext results in a GCM tag error, which we verified in our Breach Test).
  2. Key Backup (Shamir's Secret Sharing): To prevent the loss of the key from localStorage, we added an export feature with secret sharing. We used Shamir's algorithm: a 2-of-3 threshold over the finite field \( GF(2^8) \). The master key is split into 3 shares, any 2 of which are sufficient to reconstruct it. Thanks to the information-theoretic security of the algorithm, a single share reveals absolutely nothing about the original key.

Built With

  • aes-256-gcm
  • aws-bedrock
  • axum
  • docker
  • gemini-api
  • openai-api
  • react
  • rust
  • server-sent-events
  • shamir-secret-sharing
  • webcrypto
Share this project:

Updates

Submission history