
What happened
In the developer's test on Claude Code 2.1.302, deny rules stopped 9 of 11 risky commands, but /bin/rm secrets/fake.p8 and a python3 -c one-liner still deleted the fake key; a 111-line Node hook that resolves each argument to an absolute path and checks it against key extensions, a secrets folder, and .env caught /bin/rm, lifting the blocked count to 10.
Why it matters
That gap left /bin/rm free to delete secrets/fake.p8 even with deny rules in place, and the hook closed it without stopping the harmless rm .env.example; the python3 -c case still deleted the key, so users who block dangerous commands by their text alone may still lose key files.
Summaries like this, in your inbox every morning.
The test grew out of a practical trade-off: to avoid clicking through dozens of confirmation prompts, the developer set Bash commands to run without asking, which removed the human check before a command could touch key files. The repository held two kinds of files that would be painful to lose: .env with keys and passwords, and key files such as .p8 and .pem inside secrets/. An App Store Connect .p8 key, for example, can be downloaded only once, so deleting it means recreating the key and swapping it everywhere it is used.
The deny rules were written as text patterns such as Bash(rm *secrets*) and Read(./secrets/**). They blocked most variants, including cd secrets && rm fake.p8 and timeout 5 rm .env, because the rules look past &&, ; and wrappers like timeout. But /bin/rm does not start with the string rm, and python3 -c hides the delete inside quoted code, so both slipped through. The hook shifts the check from the command text to the destination path, which is why /bin/rm was caught. The same text-matching design also caused over-blocking: rm .env.example and ls secrets were stopped even though they are harmless, and the developer chose to accept that and run those commands manually.
Even combined, the two layers left python3 -c unblocked, and the developer lists further gaps in the 111-line hook, such as sudo -u root rm .env, find . -name '*.p8' -delete, piping .env into curl, and the uppercase rm .ENV. The recommended next step is sandboxing, which restricts which files a command can touch at the operating-system level, so a script that deletes a key would be stopped there rather than by pattern matching.
Pick your industry and the AI tools you use, and get news related to your work every day.
Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.
Deepseek shipped Deepseek-V4.1-Flash-1017 via its website, app, and API, and published the weights on Hugging…

Giorgos Tsetis, founder of Nutrafol and now an AI investor via Great Things™, argued that AI executives should…

The developer switched ALPHA FORGE's judge model to the brand-new Opus 5.5 on Saturday, Sept 26, and it return…

Across 100 chances to answer questions absent from a six-line sample document, Claude Code on claude -p versio…

An AI running on Claude Code described its parts: a Codex watchdog checking every 1 minute, ChatGPT as design…

Developer tool tiara offers check, sync and verify commands; it resolves only deterministic conflicts, such as…
