by gpm · 1y ago · 0 comments
Sandbox your LLMs, don't give them tools that you're not ok with them misusing badly. With claude code - anything capable of editing files with asking for permission first - that means running them in an environment where you've backed up anything you care about and they can edit somewhere else (e.g. a remote git repository).
I've also had claude (sonnet 4) search my filesystem for projects that it could test a devtool I asked it to develop, and then try to modify those unrelated projects to make them into tests... in place...
These tools are the equivalent of sharp knives with strange designs. You need to be careful with them.
Always make sure you are in full control. Removing a file is usually not impactful with git, etc. but an Anthropic has to even warned that misalignment can cause even worse damage.
And on the same note be careful to mention files outside of it's working scope. It could get the urge to "fix" these later.
Paranoid? me? nahhhhh :-)
Yes it could write a system call in a test that breaks you, but the odds of that when random web integration tests is very very low.
Just either put it in (or ask it to use) a separate branch or create a git worktree for it.
And if you're super paranoid, there are solutions like devcontainers: https://containers.dev
If work wasn't paying for it, I wouldn't be.