Live data from Hacker News

Running NanoClaw in a Docker Shell Sandbox

docker.com

61–70 of 83 posts

Re: Running NanoClaw in a Docker Shell Sandbox

#61

This attempt to hype Claw stuff shows how SV is really grasping at straws part of the bubble cycle. What happened to curing cancer?

I get why you feel this way. There's this weird thing happening online where AI hype accounts dog pile on any hint of the beginning of a trend and will beat on it until the next trend comes around. They will make up claims and create endless content in the format that they discovered is effective.

This makes it really difficult to understand what's real and what's hype. It feels like everything that's trending is BS because of the obvious boosting and exaggeration.

But there are real, noteworthy things that are happening and they get mixed in with a lot of BS.

Coding agents being massive amplifiers of skilled developers productivity is not hype. There are countless 10s or maybe 100s of thousands of developers who have built things that they simply wouldn't have been able to do a few years ago. It doesn't matter what that MITRE study says if you've built something with your own hands that wouldn't have existed without AI.

Bringing the same coding agents to regular people on WhatsApp and Telegram, and connecting it with enough apps and data sources so it can do valuable work is a massive unlock of value. There is massive hype around it, but underneath all the hype there is something big and real. I am getting immense value from this. I recommend that you put your skepticism on hold for a short time and give it a real try. Real is key. If you go in trying to prove your skepticism right, you will be able to do that. But if you approach with curiosity you'll undoubtedly discover ways you can start extracting value from it

Re: Running NanoClaw in a Docker Shell Sandbox

#62
Containerization with Openclaw was not an issue for me. What was an issue was the update process. The docs is so messy and the whole process was unstable.

The only thing that hold it together was that your personal files was on their own folder and ignored by git, so if git pull or some steps in between failed, you could just do a fresh install and add your personal files / workspace data again.

I hope Nanoclaw and the other similar projects have added proper steps for upgrading the container.

Re: Running NanoClaw in a Docker Shell Sandbox

#63

Super cool. Any indication if sandboxes can/will be part of the non-desktop docker tooling?

PS: Also, this is wild! > What this does: apiKeyHelper tells Claude Code to run echo proxy-managed to get its API key. The sandbox’s network proxy intercepts outgoing API calls and swaps this sentinel value for your real Anthropic key, so the actual key never exists inside the sandbox.

This is similar to Deno Sandbox[1] which was announced a couple of weeks back. Apparently also something similar is done with fly.io's tokenizer[2][3]

[1]: https://deno.com/blog/introducing-deno-sandbox

[2]: https://news.ycombinator.com/item?id=46874959

[3]: https://github.com/superfly/tokenizer

Re: Running NanoClaw in a Docker Shell Sandbox

#64
post #20

At my time of reading it is not at all clear to me how the "sandbox network proxy" knows what value to inject in place of the string "proxy-managed" > Prerequisites > An Anthropic API key in an env variable I am willing to accept that the steps in the tutorial may work... but if it does work it seems like there has to be some implicit knowledge about common Anthropic API key env var names or something like this I wan…

Yeah, we are on it. In the current version, things are hardcoded and implicit (we are also in experimental preview), but soon it will be configurable and explicit.

Re: Running NanoClaw in a Docker Shell Sandbox

#65
post #10

What are people using OpenClaw for that is useful?

A CEO answered on Twitter:

> Mine runs my auto parts company.. tracks 395K products on Amazon, manages 3 warehouses, scrapes competitor pricing, handles email, posts to social media

https://x.com/BrianRoyBarber/status/2023389093648884000

Re: Running NanoClaw in a Docker Shell Sandbox

#66

Earlier quoted context omitted.

Gavriel (creator of NanoClaw) here. This is the correct answer. It's more dogfooding than testing though. This is describing the structure of an Obsidian vault that is mounted in the container as an additional directory that claude has access to. Me and my co-founder chat with NanoClaw in WhatsApp and get daily briefings on sales pipeline status, get reminders on tasks, give it updates after calls, etc. You can see t…

Gonna change things so it uses CLAUDE.local.md for user-specific updates and the regular CLAUDE.md is static. This will help prevent this from happening to contributors. CLAUDE.local.md is deprecated but I'm sure anthropic will continue supporting it for a long time.

I did this trick at work where I use git worktrees and my team does not yet.

There's the common team instructions + a thing that says "run whoami and find the users name, you can find possible customizations to these instructions in .md" and that will be conditionally loaded after my first prompt is sent. I also stick a canary word in there to track that it's still listening to me.

Re: Running NanoClaw in a Docker Shell Sandbox

#67
post #25

Neat! I wasn’t aware that Docker has an embedded microVM option. I use Kata Containers on Kubernetes (Firecrackers) and restrict network access with a proxy that supports you to block/allow domain access. Also swap secrets at runtime so agents don’t see any secrets (similar to Deno sandboxes) If anybody is interested in running agents ok K8S, here is my shameless plug: https://github.com/lobu-ai/lobu

I'm still not that interested in setting up openclaw, but this implementation actually looks/sounds pretty good.

Thanks for sharing!

Re: Running NanoClaw in a Docker Shell Sandbox

#68

This attempt to hype Claw stuff shows how SV is really grasping at straws part of the bubble cycle. What happened to curing cancer?

> What happened to curing cancer? Because being a cancer is more, well, metastasizing. Remember, that capitalism is growth at all costs, until the host is dead, aka cancer. And, fake money until you can be money?

on the other hand, communism is collapse at everyone's cost

Re: Running NanoClaw in a Docker Shell Sandbox

#69
Gonna take this opportunity to get some feedback. I never figured out containers (one of these days..!), but I didn't want to yolo AI agents on my machine.

At some point I realized, what I'm actually worried about is it blowing up my files. So I just made a separate linux agent "agent", and put myself in the agent group.

So I can read/write the agent homedir, but agents cannot read/write mine.

So now I just switch to agent user before running Claude, Codex, OpenClaw etc.

I'm not a security expert -- seems there are still some suboptimal aspects to this (e.g. /tmp is globally readable?), but it seems good enough for the main vector to me? ("Claude Code deleted my homedir/hard drive" that pops up every few weeks on Reddit...)

(If someone gets a remote shell via an exploit in a certain bloated agent framework that's a slightly different story though ;)

But I was wondering what you all think about that. "Just give it a Linux user." It doesn't seem to be a common approach, though I've seen a few other people doing it. I wonder if I'm missing something, or if it's actually a good solution but boring and non-obvious to most people.

(Tangential but I do find it pretty funny when people spend 3 hours hardening OpenClaw inside Docker inside a VM inside a locked down VPS and then they just hook it up directly to their GMail account)

--

As a side note the agents are getting scary good with their persistence and determination. Claude and Codex bypassing security restrictions without a second thought, just to complete a task...

https://www.reddit.com/r/ClaudeAI/comments/1r186gl/my_agent_...

I had a similar experience with Codex... "the instructions forbid me from deleting the remote branch, so I will find a creative workaround to achieve the same result..." Following the letter of the law, but not the spirit! They're already acting a lot like the paperclip maximizer, which is... something to think about...

I guess one way to answer my own question would be to ask them to bypass the user permissions somehow! I'm slightly afraid to run that experiment...

Re: Running NanoClaw in a Docker Shell Sandbox

#70
post #69

Gonna take this opportunity to get some feedback. I never figured out containers (one of these days..!), but I didn't want to yolo AI agents on my machine. At some point I realized, what I'm actually worried about is it blowing up my files. So I just made a separate linux agent "agent", and put myself in the agent group. So I can read/write the agent homedir, but agents cannot read/write mine. So now I just switch to…

It's a bad approach, it can still see the / directory, and eventually you want to give it sudo privilege or act as the root user to get anything done. Yet I really wouldn't trust these things as far as I could throw them, there is no "undo" button in the terminal.

I was like you with docker at the start of the week, I had managed to avoid it until now, but I didn't want to let agents do crazy sneaky stuff to my main system. VirtualBox, even with the guest additions just sucks as an environment to spend more than a few hours developing in, especially with how they take up precious RAM and VRAM that local LLMs need. Let me tell you: Docker for this use case at least turned out to be way easier than I thought! It only took me a few hours to really understand the main workflow for a basic project, docker is actually very nice to use, I should not have left it this long. With just a few commands I feel like I got enough sandboxing for my liking. For example, from my bash history yesterday:

    docker run -it --rm archlinux
this gives you an interactive archlinux container, and destroys itself when you exit with ctrl+d. If you want to re-enter where you left off, you can attach or start the container again if you omit the --rm flag.

    docker build -t flask_test .
this builds a container tagged "flask_test" using Dockerfile in the current directory. Dockerfiles are quite simple

    FROM python:3-alpine

    WORKDIR /my_app

    RUN pip install flask
    # copy app.py from the working directory to the container directory "."
    COPY app.py . 

    # Make port 5000 available to the world outside this container
    # this networking stuff is a bit of a mess to configure, you have to set it in flask, the Dockerfile, when you run the container, and you still get different URLs that the server is on, not all work on the host or the container, etc., it's a bit of a mess IMO. This turned out to not be necessary. 
    #EXPOSE 5000

    # Define environment variable for Flask
    ENV FLASK_APP=app.py

    ENV FLASK_RUN_HOST=0.0.0.0

    # run the command "flask" when the container starts with the "run" argument
    CMD ["flask", "run"]
The docs are very extensive, and feature a lot of (for me, anyway) useless commands like

    "docker ps"
    "docker images"
these are not that useful compared to this:

    docker container ls --all
which just shows everything.

Then, to restart from where you exited the next day:

    docker start -ia amazing_jemison 
This resumes the "amazing_jemison" (randomly assigned name) container. You see the name under column in the previous ls --all command. I don't get why they use CONTAINER IDs so much in the docs instead of NAMES, because they don't feature tab autocomplete, requiring wasted effort copying long hexadecimal strings.

I've been using throwaway archlinux docker containers all week, it's like a snappy VM, I just have to figure out how to launch graphics applications, although apparently that's an antipattern. I tried alpine, ubuntu, debian, etc., too, but archlinux is what I'm used to and the perfect balance between size and being feature-complete for me. Alpine boasts about the minimal image size but in reality you end up missing a lot of useful modern premium features that you have to redownload anyway. I never made a Dockerfile for it, it just downloaded the default archlinux image. After you exit out, and it selfdestructs with rm, and then you want to do it all again from scratch, as per the first command

    docker run -it --rm archlinux
and it will use a locally cached version, saving Docker from having to redownload

Overall a very good experience.

Post reply on HN