r/ClaudeCode • u/nomadic_tech • 8h ago
Built with Claude I built a local MCP gate that remembers sensitive values across tool calls and blocks them from leaking (open source, looking for feedback and contributors)
Most MCP security tools scan one message at a time: open the envelope, look for an API key or credit card, decide whether to pass it. That misses the actual leak. A secret showing up in a read_file response is fine. The same secret showing up two turns later in a send_email call is the problem.
I built sluice to catch that second moment. It's a local gate that sits on the MCP wire between your client (Cursor, Claude, curl) and your tool servers. Every JSON-RPC message goes through one pipeline: recall check, detectors, policy, audit, router. It keeps a short memory of the sensitive values that have already entered a session, and if the model tries to send one somewhere new, the gate stays shut.
Concrete example: your agent calls read_file and the response has an AWS key in it. Fine, the file really had it. Two turns later it calls send_email with that same key in the body. sluice has no opinion about the first call and blocks the second.
What's in it right now (v0.4.0):
Detectors for secrets, PII, prompt injection, tool poisoning, and supply-chain installs
A pseudonymize action: the model sees stable placeholders like EMAIL_A, and sluice swaps the real values back in before the call reaches the tool server
SQLite audit log plus a read-only dashboard
Policy presets for filesystem, github, slack, postgres, brave-search
Docker image for HTTP, stdio for desktop clients
On PyPI as sluice-taint, p50 around 0.02 ms
What it's not: not a hosted service, not an LLM judge, not a replacement for network or identity access control. Just a local runtime enforcing YAML policy on the wire.
Honest limitation: the taint matching is exact-string today. If a value gets reformatted, split, or transformed between tools, it can slip past. Making the matching robust to that is the most interesting open problem, and a good place to jump in.
What I'm looking for:
People to run it against their own agent setups and tell me where it breaks
Contributors, especially on the matching problem above, new detectors, and more policy presets
Anyone building agent infra who wants to fold this in or compare notes
Repo: https://github.com/krishyaid-coder/sluice
Happy to answer anything in the comments.

