2026-11-27 16:22 UTC

Cloakroom adds local secret and PII masking for coding agents

state: expiredheat: mediumuncertainty: mediumrelevance: mediumagent-privacy secret-redaction coding-agentsShanjeev Rajendran

What is this?

Cloakroom is a free, Apache-2.0 open-source tool by Shanjeev Rajendran. Its GitHub README and the author’s Show HN post describe local hooks for coding agents: they replace detected secrets and personal data with session placeholders before tools pass content to the model, then restore values locally in agent-written files or commands. The README lists Claude Code, Codex, Gemini CLI and Cursor, but coverage differs by integration and has explicit gaps. It reports held-out tests with zero of 1,005 personal details and zero of 77 vendor-format keys or passwords getting through; these are the project’s own results, not independent validation. The sources establish the tool and its stated design, but do not establish independent security review or adoption.

Why it matters

A local masking layer could make cloud-assisted coding agents more usable with sensitive repositories or data, without requiring every model call to run locally. That matters as agent tools gain access to files and commands. Cloakroom’s hooks are not a sandbox, and missed detection or uncovered pathways remain consequential; its reported benchmark results are developer claims, not proof of security.

Current assessment

Newly surfaced through the author’s Show HN post (dated Nov. 11, 2026 in the supplied record) and matching project README: Cloakroom is available as open-source software, with installation instructions for multiple coding-agent integrations. The stated mechanism is local detection and placeholder substitution before agent tool access, followed by local restoration; the README says vault data is encrypted and its key stored in the OS keystore. The project reports held-out test results of 0/1,005 personal details and 0/77 keys/passwords passing through, while acknowledging more false alarms than secret-only scanners. These figures are self-reported. Important limits in the README include uncovered Cursor Tab completion and vendor-side web search, differences in support across agents, and the explicit warning that Cloakroom is not a sandbox. No independent security audit, outside benchmark, or adoption evidence is supplied. Potential implication: this kind of local privacy middleware could reduce friction in using cloud agents on sensitive work, but its protection depends on detection quality and complete coverage of agent pathways.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p25momentum: steady2 platformsage 337h
points/hour across evidence · reading as of 2026-11-25 08:26:22.782533+11:00 · deterministic, not a model opinion

How the heat travelled

11-10 21:22 (minted)⭐ origin echo-reconstructedThe README describes local hooks that replace detected secrets and personal data with placeholders for several coding-agent CLIs, restore va
Shanjeev Rajendran on github (echo) · attributed from hn.story.50446007 · published time unknown
—
11-10 20:39first on hacker news · published · lag ?Show HN: Cloakroom – Keeps secrets away from agents
shanjv05
—
11-10 20:39amplified on hacker news 👑hn.story.50446007
shanjv05
peak 2 · 0 comments · 104% of case engagement
11-10 21:20our radar first saw it · lag ?discovery anchor: hn.story.50446007—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: Cloakroom – Keeps secrets away from agents
Retrieved article excerpt

Open article · Retrieved 2026-11-10T21:21:22.011543+00:00

[Cloakroom: your secrets stay on your machine. A coat-check ticket shows a masked API key on the part that stays on your disk and the placeholder PII\_SECRET\_1 on the stub the model sees.](https://cloakroom.sh)

### [cloakroom.sh](https://cloakroom.sh) · [Install](https://cloakroom.sh/install) · [How it works](https://cloakroom.sh/how-it-works) · [Security](https://cloakroom.sh/security) · [Commands](https://cloakroom.sh/commands) · [Releases](https://cloakroom.sh/releases)

[PyPI version](https://pypi.org/project/cloakroom/)
[Python versions](https://pypi.org/project/cloakroom/)
[Tests](https://github.com/shanjeevrajendran/cloakroom/actions/workflows/test.yml)
[License: Apache-2.0](https://github.com/shanjeevrajendran/cloakroom/blob/main/LICENSE)

**Cloakroom masks API keys, passwords and personal data on your machine before your AI coding agent sees them, and
puts the real values back in the files and commands the agent writes. Works with Claude Code, Codex, Gemini CLI and
Cursor. Free and open source.**

The full guide, settings and FAQ live at **[cloakroom.sh](https://cloakroom.sh)**. This README is the short version.

[Claude Code reads .env through Cloakroom: the fake Stripe key on disk is swapped for a placeholder before Claude sees it](https://raw.githubusercontent.com/shanjeevrajendran/cloakroom/main/assets/demo-clip.gif)
  
▶ [40-second demo](https://www.youtube.com/shorts/U9lN4emgeE0)

## Install

**Claude Code** (Mac, Windows, Linux). Inside Claude Code, one line at a time, then restart it:

```
/plugin marketplace add shanjeevrajendran/cloakroom
/plugin install cloakroom@cloakroom
```

The plugin installs the `cloakroom` program on first start. Until it is ready, the agent's file reads and commands
wait instead of passing unchecked.

**Codex, Gemini CLI, Cursor** (Mac, Linux):

```
uv tool install "cloakroom[model,torch,ocr]"   # Python 3.10+
cloakroom install codex                         # or: gemini, cursor
```

Codex skips new hooks until you trust them once: start `codex`, type `/hooks`, trust each Cloakroom entry.

**Check it:** `cloakroom doctor` (every line should say ok).

**Updates:** Claude Code updates the plugin, and the plugin updates the program. Codex, Gemini CLI, Cursor, git
commits, or a `cloakroom` you installed yourself: run `cloakroom update` in a terminal.

Step-by-step guide, updates and uninstall: [cloakroom.sh/install](https://cloakroom.sh/install).

## How it works

Cloakroom runs as hooks: checks the agent calls before and after each tool call. On the way in, pattern rules plus a
small local detection model find secrets and personal data, and each value is swapped for a placeholder such as
`PII_SECRET_1` that stays the same for the session. The pairs live in an encrypted vault on your machine, its key in
the OS keystore (Keychain, Credential Manager, Secret Service). On a Mac there is no Keychain password prompt on
first run or after a Python update, and the agent can't read the key. On the way out, placeholders in writes and commands
get their real values back just before they run.

```
file or command output ──► Cloakroom (local) ──► model sees PII_PERSON_1, PII_SECRET_1
                                                         │
your disk gets the real value ◄── Cloakroom (local) ◄────┘ agent writes or runs with placeholders
```

Nothing leaves the machine except the one-time model download. If Cloakroom can't check something, it holds it
instead of letting it through. More: [cloakroom.sh/how-it-works](https://cloakroom.sh/how-it-works) ·
[docs-HOW-IT-WORKS.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/docs-HOW-IT-WORKS.md).

New in 1.4:

- **Personal data in old chats, for every agent:** `cloakroom exposure --personal` also finds personal data you typed in old Codex, Cursor and Gemini CLI chats, not only Claude Code ([details](https://github.com/shanjeevrajendran/cloakroom#commands-youll-use)).
- **No Keychain password prompt on a Mac:** none on first run or after a Python update, and an agent can't read the vault key ([details](https://github.com/shanjeevrajendran/cloakroom#how-it-works)).

## What works where

✓ masked · ⛔ stopped or held · ✗ not covered

|  | Claude Code | Codex (CLI, app) | Gemini CLI | Cursor (editor, agent) |
| --- | --- | --- | --- | --- |
| Prompts you type | ⛔ stopped, safe copy offered | ⛔ stopped, safe copy offered | ⛔ stopped, safe copy offered | ⛔ editor · ✗ command-line agent |
| File reads, command output, MCP results | ✓ | ✓ · ✗ long-running commands | ✓ | ✓ |
| Images and PDFs (local OCR) | ✓ | ✓ | ✓ · ⛔ PDFs held | ✓ |
| Real values put back in writes and commands | ✓ | ✓ | ✓ | ✓ shell · ⛔ placeholder writes refused |
| Keys kept out of git commits | ✓ | ✓ | ✓ | ✓ |
| Prompt injection: sending keys out, approving its own holds, switching Cloakroom off | ⛔ | ⛔ · ✗ Codex web search | ⛔ | ⛔ · ✗ Cursor web search |
| Systems | Mac, Linux, Windows | Mac, Linux | Mac, Linux | Mac, Linux |

Every gap, with the reason: [docs-LIMITS.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/docs-LIMITS.md).

## Results

On held-out test sets Cloakroom let through 0 of 1,005 personal details (the other tools tested let through 119 to
992) and 0 of 77 keys and passwords in real vendor formats. The trade-off is false alarms: it masks more harmless
text than secret-only scanners. Method and raw numbers: [bench/RESULTS.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/bench/RESULTS.md).

## Recent releases

- **1.4.0**: `cloakroom exposure --personal` also finds personal data you typed in old Codex, Cursor and Gemini CLI
  chats ([details](https://github.com/shanjeevrajendran/cloakroom#commands-youll-use)). On a Mac there is no Keychain password prompt on first run or after a Python
  update, and an agent can't read the vault key ([details](https://github.com/shanjeevrajendran/cloakroom#how-it-works)).
- **1.3.0**: an agent can't approve its own held call or switch Cloakroom off, and a hook or MCP server it writes
  into agent config is held until you type `cr: allow`.
- **1.2.0**: Cursor's editor is checked with Cloakroom (Tab completion isn't covered). Codex signed in with ChatGPT is
  masked through `cloakroom proxy`. Fewer false alarms on Codex's plugin list.

All releases: [cloakroom.sh/releases](https://cloakroom.sh/releases) · [CHANGELOG.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/CHANGELOG.md).

## What it isn't

- **Not a sandbox.** It stops accidental leaks and contains prompt injection; it doesn't prevent it. An agent runs
  as you, so the agent's own sandbox is the outer wall.
- **Not everything has a hook.** Cursor's Tab completion and the vendors' own server-side web search aren't seen.
- **Typed prompts are stopped, not rewritten.** Agents let a hook block a prompt but not reliably change it.

## Commands you'll use

| Command | What it does |
| --- | --- |
| `cloakroom doctor` | Health check, versions, per-check timing |
| `cloakroom dashboard` | Alerts in the browser: when it masks something harmless (a false alarm), mark it once in the dashboard and a rule stops it next time. |
| `cloakroom check FILE` · `explain FILE` · `mask FILE` | Preview what would be masked, and why |
| `cloakroom exposure` | It lists the keys and passwords your coding agents saw, so you know what to rotate. Hints only, never the key. `--personal` also finds personal data you typed in old chats with Claude Code, Codex, Cursor or Gemini CLI. |
| `cloakroom scan` | Commands a repo's agent and editor config would run |
| `cloakroom give NAME` | When the agent needs a key (a Stripe key, a database password), don't paste it into a prompt. This asks for it in a hidden prompt and gives you a placeholder to paste. |
| `cloakroom proxy` | Local masking proxy for tools that let you set their API address |
| `cloakroom allow` | Lets one held command run once. Works only in your own terminal, never the agent's shell. |
| `cloakroom update` | Update the program and set the hooks up again |

All commands: [cloakroom.sh/commands](https://cloakroom.sh/commands). Settings:
[cloakroom.sh/settings](https://cloakroom.sh/settings). Rules only, no model: `CLOAKROOM_MODE=rules`.

## Develop

```
git clone https://github.com/shanjeevrajendran/cloakroom && cd cloakroom
uv sync
uv run pytest -q tests      # rules mode, no model download
```

See [CONTRIBUTING.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/CONTRIBUTING.md). Found a way around it? Report it privately: [SECURITY.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/SECURITY.md).
Changes: [CHANGELOG.md](https://github.com/shanjeevrajendran/cloakroom/blob/main/CHANGELOG.md).

## Credits

Detection model: [PII-Tracer](https://huggingface.co/perplexity-ai/PII-Tracer). The one-string hook command that runs
in both bash and PowerShell comes from [maisecrets](https://github.com/Mcpgate-de/maisecrets) (Apache-2.0).

Made by Shanjeev Rajendran · [GitHub](https://github.com/shanjeevrajendran) ·
[LinkedIn](https://www.linkedin.com/in/shanjeevrajendran) · Apache-2.0
shanjv0520
🟧 echo.github ⭐The README describes local hooks that replace detected secrets and personal data with placeholders for several coding-agent CLIs, restore vaShanjeev Rajendran——

Interpretation history

Decision trace