Urgent.News

What's breaking now, across thousands of outlets.

AI

How I keep secrets and personal data out of Claude Code

The problem Claude Code reads whatever a task touches. Ask it to fix a failing job and it opens the .env , tails the log, greps the support export. Everything it reads goes to the model as context. But my working folders hold API keys, database passwords, and support tickets with customers' names, emails and home addresses. I didn't want any of that leaving my machine just because Claude needed…

Claude Code reads everything a task involves, including sensitive information stored in files like .env, system logs, and support tickets. This means that API keys, database passwords, and personal data such as names, emails, and addresses could be exposed to the model. To prevent this, the author developed a plugin called Cloakroom, which masks such secrets and personal data before Claude sees them and restores the original values when Claude writes them.

Cloakroom operates by intercepting files and commands before they reach Claude, looking for secrets with known structures (like API keys and passwords), numbers with checksums (such as credit cards and social security numbers), and personal data in free text (names, emails, addresses, and dates of birth). It replaces these with placeholders. The same placeholder is used consistently throughout the session, so any occurrence of PII_PERSON_1 in one file refers to the same person as the same placeholder elsewhere.

The plugin uses OCR to convert scanned images or photos into text before masking it, ensuring that personal data in visual data is also protected. When Claude writes a response or modifies a file, the real values are put back into an encrypted vault, which is accessible only through the OS's secure storage. This ensures that no sensitive data is exposed during or after the operation. Cloakroom also provides a dashboard to manage and adjust the masking rules based on false alarms or false negatives.

This approach is particularly useful for protecting information in natural language prompts, which can be more challenging to secure since they are not scanned like documents. The open-source nature of Cloakroom makes it accessible to anyone, requiring only a one-time download for the local detection model.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in AI

My AWS AI Agent Passed Its Tests. It Still Missed a Check.

I gave my AI agent a small deployment history and asked how often the checks were unhealthy. It wrote the Python, ran its own tests, and came back with the right answer. Then I read the tests.

  • AI agent passed tests but missed some check aspects
  • Agent calculated 41.7% of checks as unhealthy
  • Generated tests only proved agent's assertions

More from Thursday 15 October →