What is rehydra?
Rehydra is a privacy SDK and set of tools for protecting personal information in AI workflows, coding agents, and browser-based chats. It detects sensitive values, replaces them with consistent placeholders, and can restore the originals when a response needs to reach a tool or user. Developers can use its library, CLI proxy, or OpenCode plugin, while a Chrome extension protects messages sent to ChatGPT and Gemini.
rehydra Features:
Regex and Local NER: Regex patterns identify structured data such as emails, phone numbers, and payment details, while an on-device ONNX model detects names, organizations, and locations.
Secrets Detection: Optional detection covers API keys, JWTs, private keys, database connection strings, and secrets stored in .env files.
Stable Pseudonyms: Detected values become placeholders that retain the same identity across messages in a session, helping preserve references between turns.
Encrypted Rehydration: Rehydra encrypts original values with AES-256-GCM and restores them from its mapping when text or tool arguments need the real data.
AI Tool Proxy: The CLI proxy anonymizes requests and tool results, then rehydrates tool-call arguments before actions such as file writes or shell commands run.
Browser Protection: The Chrome extension replaces sensitive values in messages to ChatGPT or Gemini and restores them in responses, with detection running on-device.
Developer Configuration: The library works in Node.js, Bun, and browsers, and supports custom NER models, encryption key providers, storage providers, and tag formats.
rehydra Benefits:
Keep Context Intact: Consistent placeholders let an LLM follow the same people and organizations across a conversation instead of losing useful context to permanent redaction.
Protect Sensitive Data: Local detection helps keep personal information on the device rather than sending it to an external detection service.
Use Outputs Directly: Restoring original values lets coding tools act on real file paths, addresses, and other details without requiring users to repair placeholder text.
Support Offline Work: On-device NER can run without external inference calls, making the detection process usable offline.
Fit Existing Workflows: Multiple ways to adopt Rehydra let teams choose an SDK, proxy, plugin, or browser extension for the workflow they need to protect.
Use Cases:
Coding Agent Sessions: Run the CLI proxy with Claude Code or a compatible Anthropic Messages or OpenAI Chat Completions client to mask conversation data before it reaches the model.
OpenCode Projects: Install the OpenCode plugin to replace secrets from .env files before they leave the machine and restore them before tools execute.
Browser AI Chats: Use the Chrome extension when sending prompts containing names, contact details, or secrets to ChatGPT or Gemini.
Application Integration: Embed the library in a Node.js, Bun, or browser app that needs to anonymize text and later rehydrate selected values.
Server-Side Tool Loops: Use createRehydraFetch with supported streaming chat requests to anonymize tool results and restore tool arguments during callback rounds.

