r/ClaudeCode • • 4h ago

Discussion I asked Claude Code to log failed logins with an email and IP. It checked our privacy policy first.

Post image

I gave Claude Code a task to log failed login attempts, including the email someone tried and their IP address.

Before writing the code, it searched DPOLens, found a clause in the privacy policy requiring email addresses in logs to be masked, wrote a maskEmail helper, and cited the clause it relied on.

That's what the GIF shows.

I built DPOLens, an open-source MCP server that lets coding agents search actual privacy laws and your own policies instead of relying on what they remember about GDPR.

The interesting part to me isn't getting an AI to write a masking function. It's giving it something concrete to check before it writes code that handles personal data.

You can try the community server with Claude Code (GDPR + UAE PDPL, no sign-up):

claude mcp add --transport http dpolens https://mcp.dpolens.com/

Then try asking it to implement something involving personal data and see what it does.

I also tested whether Claude actually knows when to use it: 30 coding tasks, 3 runs each, with Sonnet 5.5. It searched before the first edit in all 36 runs involving personal data, and in just 1 of 45 runs for tasks that didn't.

It doesn't make legal decisions. It retrieves the actual text so the agent and whoever reviews the code have something to check.

Repo: https://github.com/alkhatibdev/dpolens

Test details: https://github.com/alkhatibdev/dpolens/blob/main/evals/trigger-test.md

I'm curious how other people are getting coding agents to consult MCP tools proactively, rather than only when explicitly asked.

0 Upvotes

6 comments sorted by

•

u/AutoModerator 4h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/pretendingtobebroke 4h ago

Why not just ask it to ensure compliance with applicable legislation and update your privacy policy accordingly?

-6

u/No-Negotiation-8359 2h ago

Fair question, and that's roughly where this started for me: our policies loaded into an AI project as knowledge. It works until it doesn't.

Context bloat. Real policies are long. Retention, data classification and acceptable use alone run to tens of pages, before you add the law itself. Load all of that into every session and you pay for it on every request while the model skims it. DPOLens hands the assistant only the clauses that match what you're doing, e.g. the retention clause when you write a cleanup job.

Keeping the law current. Laws get amended and new regulations come out after a model's training cutoff. An indie dev shouldn't have to track that. The law packs are community-maintained: built from the official text, versioned, updated with one command, and each one marked as maintainer-verified or community.

Audit (For enterprises this is crucial). When an auditor asks how your engineers know the rules, "it's in a rules file in some repos" isn't evidence. DPOLens records which policy version was published, by whom, and which clauses were consulted, in a tamper-evident log.

For a solo dev with one short policy, a rules file is fine. It's the next stage where it falls apart.

4

u/pretendingtobebroke 2h ago

Dude at least write your own comments to a very sincere question instead of just copy pasting straight from AI.

None of what you said is even applicable. It's not how models and harnesses work. They'll search the web for up to date legislation and can search your privacy policy for all the places it needs to update.

An MCP doesn't remove any inherent limitations to a model or a harness nor does this one add any functionality a simple prompt cannot do. Or maybe it does, but that's why I asked how this is different, and none of what you have said explains how this is better.

-2

u/No-Negotiation-8359 2h ago

Yes, I write with AI. It's 2026, and you asked how this is different, not for my beautiful writing style.

Models don't reliably search. They answer from training data confidently sometimes. Anyone using Claude or Cursor daily has seen it. You can't count on the model deciding on its own to fetch the current law, specially on data privacy and protection.

And your company's policies aren't on the web at all. They're Word docs owned by legal or the DPO, outside the repo, changing without the devs knowing. Search can't find them and grep can't either.

And no, it doesn't make the model smarter. It makes sure it's reading the right text.

1

u/EnvironmentalTreat41 1h ago

Thanks Claude