Repository: https://github.com/fxfbvale/mellum-privacy-gateway
Commit: 75214ae40acd30501d4e6a1dfc388e73eda5ed6b
Dockerfile: gateway/Dockerfile
Inspiration
AI coding agents are useful—but the code they read can contain API keys, passwords, personal data, and private infrastructure details. Developers should not have to choose between using cloud AI and protecting that information. We built Get Brains to put a privacy layer between the workspace and the cloud.
What it does
Our gateway replaces sensitive values with consistent placeholders before code reaches a cloud agent, then restores the original values locally afterward.
It combines fast, hand-written detection rules with Mellum2 contextual review to distinguish sensitive information from harmless lookalikes. If the model cannot provide a verdict, the gateway defaults to masking the candidate.
The project also includes an ACP integration for connecting this workflow to coding agents in JetBrains Air.
How we built it
We built a modular Python pipeline for candidate discovery, triage, context extraction, Mellum2 review, masking, and restoration.
Rather than sending entire repositories to the model, we use lightweight heuristics to identify candidates and provide focused context for review. Repeated values receive the same placeholder throughout the repository, and a local mapping enables restoration without network access.
We packaged the gateway in Docker and tested it using the organizers’ scoring interface and dedicated integration tests.
Challenges we ran into
The hardest problem was balancing privacy with usefulness: missing a secret risks disclosure, while masking too much damages the context a coding agent needs.
We also had to preserve file contents and syntax, handle unusual encodings, and work within strict model rate limits and execution deadlines. Agent integration added another challenge: protecting chat messages is not enough when an agent can read workspace files directly.
Accomplishments that we're proud of
- Built an end-to-end sanitization and offline restoration pipeline.
- Combined deterministic detection with Mellum2 contextual reasoning.
- Added consistent placeholders across files.
- Passed Docker integration tests covering byte-for-byte restoration and restricted access to the secret mapping.
- Built an ACP integration aimed at bringing privacy protection into the editor workflow.
What we learned
Privacy is a systems problem, not just a detection problem. Context selection, file access, timeouts, mapping security, and restoration all matter.
We also learned that model calls are most useful when focused on ambiguous decisions. Fast local rules and targeted model review complement each other better than either approach alone.
What's next for Get Brains
We want to reduce unnecessary masking, improve syntax preservation, and validate the gateway more broadly on unseen repositories.
We also want to harden the ACP integration and make it easier for developers to inspect what is masked before their code reaches a cloud agent.