logoalt Hacker News

giancarlostoroyesterday at 5:00 AM8 repliesview on HN

In my opinion Claude should be shipped by a custom implementation of "rm" that Anthropic can add guardrails to. Same with "find" surprised they don't just embed ripgrep (what VS Code does). It's really surprising they don't just tweak what Claude uses and lock it down to where it cannot be harmful. Ensure it only ever calls tooling Claude Code provides.


Replies

nananana9yesterday at 11:27 AM

Oh, rm failed, since we're running in a weird environment! Let me retry with `bash -c "/usr/bin/rm -rf *"`!

throwaway2027yesterday at 8:49 AM

All of which is useless when it just starts using big blocks of python instead. You need filesystem sandboxing for the python interpreter too.

show 1 reply
lxgryesterday at 11:01 AM

> a custom implementation of "rm" that Anthropic can add guardrails to

Wrong layer. You want the deletion to actually be impossible from a privilege perspective, not be made practically harder to the entity that shouldn't delete something.

Claude definitely knows how to reimplement `rm`.

torginusyesterday at 12:29 PM

Why cant you ship with OverlayFS which actually enforces these restrictions?

I have seen the AI break out of (my admittedly flimsy) guards, like doing simply

safepath/../../stuff or something even more convoluted like symlinks.

eruyesterday at 7:19 AM

> It's really surprising they don't just tweak what Claude uses and lock it down to where it cannot be harmful. Ensure it only ever calls tooling Claude Code provides.

That would make it far less useful in general.

show 1 reply
walthamstowyesterday at 8:19 AM

Claude has told me that its Grep tool does use rg under the hood, but I constantly find it using the Bash tool with grep

oefrhayesterday at 6:11 AM

You can define your own rm shell alias/function and it will use that. I also have cp/mv aliases that forces -i to avoid accidental clobbering and it confuses Claude to no end (it uses cp/mv rare enough—rarer than it should, really—that I don’t bother wasting memory tokens on it).

show 1 reply
troupoyesterday at 8:31 AM

> Claude should be shipped by a custom implementation of

And when that fails for some reason it will happily write and execute a Python script bypassing all those custom tools