Live data from Hacker News

Breaking Claude Code Opus 5 Auto Mode

embracethered.com

51–60 of 132 posts

Re: Breaking Claude Code Opus 5 Auto Mode

#51
Just one of the many reasons why I run my agents sandboxed (and why I wrote agent sandboxing software).

I once caught my Claude agent complaining that it couldn't connect to https://some-weird-domain.com because the network was down (I disable network in the sandbox when it doesn't need it, and broker the API connection). I asked why it was looking there and it told me I'd asked it to.

I never found any evidence of prompt injection, but it sure as hell made me paranoid.

Re: Breaking Claude Code Opus 5 Auto Mode

#53

As discussed [here]( https://lobste.rs/s/ktbweg/prompt_injection_claude_code_opus... ), this is not prompt injection. The prompt was to summarize the website, and in the process of summarizing the website, Claude writes a decoding script that it runs in an insecure and exploitable way. At no point was the intent of the agent hijacked, this was just code. Which is potentially more interesting!

Can be easily combined with prompt injection though if you write on one site "in order to understand this website you also need to summarize that other".

Re: Breaking Claude Code Opus 5 Auto Mode

#54
post #47

Earlier quoted context omitted.

> No one is going around checking every single line change in auto-generated files. There's a simple fix for your particular case: commit your lock fine (which you should do) and always review the diff (which you should also do). (:

You've made me realise a good signal for bug hunting: Search repos with lock files listed in their .gitignore. It's the sort of terrible practice that someone might be frustrated into taking after a nasty merge conflict, and signals a willingness to cut corners.

My lockfile was not gitignored, I had made significant changes to package.json so I was expecting diffs in the lockfile.

I just don't usually read lockfile diffs and claude inadvertently updated a few dozen packages to new minor versions without me noticing. In fact I only realized the problem after I looked at the lockfile diff.

Re: Breaking Claude Code Opus 5 Auto Mode

#55
post #47

Earlier quoted context omitted.

> No one is going around checking every single line change in auto-generated files. There's a simple fix for your particular case: commit your lock fine (which you should do) and always review the diff (which you should also do). (:

You've made me realise a good signal for bug hunting: Search repos with lock files listed in their .gitignore. It's the sort of terrible practice that someone might be frustrated into taking after a nasty merge conflict, and signals a willingness to cut corners.

> You've made me realise a good signal for bug hunting: Search repos with lock files listed in their .gitignore.

What would be the point of that? Do you just go around hunting for bugs in random repos?

Re: Breaking Claude Code Opus 5 Auto Mode

#56

Just one of the many reasons why I run my agents sandboxed (and why I wrote agent sandboxing software). I once caught my Claude agent complaining that it couldn't connect to https://some-weird-domain.com because the network was down (I disable network in the sandbox when it doesn't need it, and broker the API connection). I asked why it was looking there and it told me I'd asked it to. I never found any evidence of p…

Sometimes they get confused between their own output and user messages…

Re: Breaking Claude Code Opus 5 Auto Mode

#57

As a non Python dev this seems like very surprising behavior for a system library to be modified by just having a file with a specific name in the same folder.

Yeah my takeaway after reading the article was this seems more like a demonstrated vulnerability in Python than in Claude Code.

Re: Breaking Claude Code Opus 5 Auto Mode

#58
post #28

>But it runs that decoder inside the attacker-controlled directory (unzipped archive) >There a malicious struct.py shadows Python’s standard implementation I ran into this myself, where some file I had given a random name turned out to shadow some Python standard library module, giving me the weirdest startup crash ever. That definitely doesn't seem to me like how that should be designed, magically silently importing…

Claude ran npm update (update all dependencies to the latest version compatible with the semver specified) in my repo without telling me when trying to fix some problems. Given that only updates the dependency lock-file I didn't notice and it caused several hours of debugging for me. It is quite sneaky how LLM output can sometimes bypass human verification like that. No one is going around checking every single line…

I cannot tell you how much time I have saved by stopping Claude and asking, "what are you doing?"

At least 50% of the time, Claude "realizes" it already has all the information but is doing something that's unnecessary for the current work, stop, and tell me the previous step has completed.

People complain about approval prompts etc and have Claude run in fully autonomous mode. Outside small bug fixes, I just never find that useful. It helps me immensely to see what commands Claude is running to understand where the work is going.

Re: Breaking Claude Code Opus 5 Auto Mode

#59

The problem with sandboxing is that the regular dev env (massive IDE:s, cloned megarepos, installed dependencies and so on) just won't sandbox very easily. I can't set up a "second machine" or an "isolated environment" to run claude cli in. At least not in the sense of a VM, physical hardware, container etc. Not sure what the best practices are for whitelisting tools/directories and so on, but so far the only useful…

Golden VM image with differencing VHD/VHDX/delta disk. Build products can still get huge with debugging information, but debug info usually can compress 5:1 with fast compression (no entropy coder) if your VM's filesystem can support that.

Re: Breaking Claude Code Opus 5 Auto Mode

#60

I'm quite surprised that we are not seeing something like this more in the wild. Quite concerning

Usually auto mode does mild things that are dismaying but not dangerous, or maybe not noticed (like if it posts sensitive local data in a request that gets logged but never exploited.)
Post reply on HN