News for hackers. Stuff that matters.

kernc

Re:MXC - a sandboxed code execution system on Friday October 09, 2026 @08:37AM (#50019623)
600 lines of dense POSIX Shell—in some respects that's even worse!

You would not be aware of the amount of trust you are putting into that.

Re:MXC - a sandboxed code execution system on Friday October 09, 2026 @08:32AM (#50019571)
> at least half is comments or unit tests

Thanks, I see there's a slight (~50%?) overestimation there, but then again, even unit tests and comments in a target programming language count as syntactically correct code that needs to be evaluated and reasoned upon. I'm not that familiar with Rust's runtime introspection features, but in languages like Python, even the comments can directly affect code (e.g. `Foo.__doc__ = Bar.__doc__ + SOME_ANNEX`).

> _generate_seccomp_filter ... the entire function doesn't block anything

Many thanks! I've applied a fix—it's a single line added. The missing test is pending a runnable that invokes one of the forbidden syscalls. As I have no qualms about force-pushing around a repo that nobody forks, happy to credit you(r LLM) proper!

> Main script invokes working directory's .env as shellcode

The sandboxed process can't overwrite existing .env files [1], but it could create a new $PWD/.env file, hoping to "escape" at next sandbox execution. That's a valid concern I'll have to think about some more.

[1]: https://github.com/sandbox-utils/sandbox-run/blob/c97d065184...

> Lots of race conditions

I sometimes experience "Slirp not ready in time" [2], but it's due to a so far unexplained upstream issue [3]. I you have time/tokens to spare, I'd appreciate those PRs and further similar feedback!

[2]: https://github.com/sandbox-utils/sandbox-run/blob/c97d065184... [3]: https://github.com/rootless-containers/slirp4netns/issues/35...

Don't know whether it's a good idea. It sure has got its issues. But even as the SLOC count and the number of bugs metrics are proved correlated in literature [4], min SLOC is not the primary target—a reasonably graspable and stable composition of few dependencies is. Whereas overreliance on third parties nowadays often ends with a rug pull one way or another. We simply can't count on this "MXC" (...) to be maintainable/non-archived even a year from now, just when I'd get it all properly integrated and set up.

[4]: https://softwareengineering.stackexchange.com/questions/1856...

> slightly concerned

Oh, I certainly wouldn't like to limit myself to promoting just this repo! ^D^ HN is a good venue, lots of smart people around! I see everyone shilling their own sh** all the time. Often in green usernames. :shrug:

Re:MXC - a sandboxed code execution system on Friday October 09, 2026 @05:57AM (#50018330)
350,000 of mostly Rust SLOC [1] ... And the upstream sandboxes aren't even vendored!

I'd be way more confident building upon something I can grasp and understand. [2]

[1]: https://ghloc.dev/microsoft/mxc [2]: https://github.com/sandbox-utils/sandbox-run

Re:Is sandboxing sufficient to contain rogue agents? on Thursday October 01, 2026 @04:37AM (#49919257)
> executes outside the sandbox

Now, why would anyone do that? (Like everyone and their brother) I wrote my own simple Linux/shell-based sandbox [1] (I can trust ...) and am successfully running PyCharm whole inside it ...

[1]: https://github.com/sandbox-utils/sandbox-run

Re:AI makes programming differently difficult on Tuesday July 21, 2026 @04:31PM (#48997837)
The convergence is ongoing. We are Borg. You will be assimilated.
Why would they care to empower competitors?
Re:LiteLLM Python package compromised by supply-chain attack on Thursday March 26, 2026 @06:30AM (#47528740)
`sandbox-venv` is a small shell script that sandboxes Python virtual environments in separate Linux namespaces using Bubblewrap (and soon using only command `unshare`, bringing the whole script down to effectively 0 deps).

https://github.com/sandbox-utils/sandbox-venv

Re:Gimp 3.2 Released on Saturday March 14, 2026 @05:55PM (#47381649)
Did you also manage to enable menu icons?
Re:Gimp 3.2 Released on Saturday March 14, 2026 @05:46PM (#47381570)
Let everyone be reminded how joyful GIMP 2.10 menus used to look ...

https://i.imgur.com/nVyMQBt.png

Re:Show HN: I Built a Sandbox for Agents on Tuesday February 03, 2026 @04:32PM (#46877603)
Probably not. Maybe Bubblewrap and sandbox-run. It's an anything-is-already-way-better-than-nothing type of thing.

[0]: https://github.com/containers/bubblewrap

[1]: https://github.com/sandbox-utils/sandbox-run

Re:Sandboxing AI Agents in Linux on Tuesday February 03, 2026 @03:06PM (#46876513)
As a heads up and affirmation that the approach is correct, here's a small shell bubblewrap wrapper that boils the command line down to `sandbox-run claude --dangerously-skip-permissions`.

https://github.com/sandbox-utils/sandbox-run

Re:The Hot Mess of AI on Monday February 02, 2026 @09:22PM (#46865579)
Other actionable insights are:

- Merge amendments up into the initial prompt.

- Evaluate prompts multiple times (ensemble).

Re:Running Claude Code dangerously (safely) on Tuesday January 20, 2026 @11:09AM (#46693457)
It being deprecated and all, didn't feel like wrapping it, but macOS supposedly has a similar `sandbox-exec` command ...
Re:Running Claude Code dangerously (safely) on Tuesday January 20, 2026 @10:31AM (#46692830)
> Linux-only

What other dev OSs are there?

> once privileges are dropped [...] it doesn't appear to be possible to reinstate them

I don't understand. If unprivileged code could easily re-elevate itself, privilege dropping would be meaningless ... If you need to communicate with the outside, you can do so via sockets (such as the bind-mounted X11 socket in one of the readme Examples).

Re:Running Claude Code dangerously (safely) on Tuesday January 20, 2026 @10:08AM (#46692550)
Since everyone tends to present their own solution, I bid you mine:

    sandbox-run npx @anthropic-ai/claude-code
This runs npx (...) transparently inside a Bubblewrap sandbox, exposing only the $PWD. Contrary to many other solutions, it is a few lines of pure POSIX shell.

https://github.com/sandbox-utils/sandbox-run

Re:GitLab discovers widespread NPM supply chain attack on Friday November 28, 2025 @01:18PM (#46081221)
I wrote myself a handy and generalized bwrap-wrapping script: https://github.com/sandbox-utils/sandbox-run
Re:Shai-Hulud Returns: Over 300 NPM Packages Infected on Monday November 24, 2025 @10:36AM (#46035221)
No.1: Run untrusted code in a sandbox! https://github.com/sandbox-utils/sandbox-venv
Re:Firefox 147 Will Support the XDG Base Directory Specification on Thursday November 20, 2025 @12:11PM (#45994942)
Now that everyone is kindly on board, IBM can finally bury this standard.
Re:Optimism associated with exceptional longevity on Wednesday November 05, 2025 @09:42AM (#45823349)
What are the reasons for Snapchat? :.
> alias npm=...

I use sandbox-run: https://github.com/sandbox-utils/sandbox-run

The above simple alias may work for node/npm, but it doesn't generalize to many other programs available on the local system, with resources that would need to be mounted into the container ...

Local-first (on Lunix), POSIX shell: https://github.com/sandbox-utils/sandbox-run
Re:I almost got hacked by a 'job interview' on Wednesday October 15, 2025 @01:47PM (#45596113)
A simple zero-config alternative using Linux-native containers seems to be sandbox-venv [1] for Python and sandbox-run [2] for npm ...

[1]: https://github.com/sandbox-utils/sandbox-venv [2]: https://github.com/sandbox-utils/sandbox-run

Re:I almost got hacked by a 'job interview' on Wednesday October 15, 2025 @01:41PM (#45596034)
> This might be a red flag for Persona service itself as it might contain serious flaws and security vulnerabilities that Cyber criminals are relying on

Persona seems to rely solely on NFC with a national passport/ID, so simply stolen documents would work for a certain duration ...

Re:I almost got hacked by a 'job interview' on Wednesday October 15, 2025 @01:34PM (#45595932)
You can use special a Unicode strikethrough glyphs such as available in https://efck-chat-keyboard.github.io
Re:Self Propagating NPM Malware Compromises over 40 Packages on Wednesday September 17, 2025 @11:48AM (#45277278)
Is exactly why I composed bubblewrap-based sandbox-venv for Python: https://github.com/kernc/sandbox-venv

Dangerous times we live in.

Re:Dotfiles feel too intimate and personal to share on Wednesday August 06, 2025 @11:53AM (#44813671)
Too personal to share, but maybe too personal and important to share even with the members of the cloudy cartel, i.e. the Providers. Is exactly why I wrote myba that does full contents and paths encryption before syncing with the lapsable remotes ...

https://kernc.github.io/myba/

Some things are better public. Some are not ...

Re:I Configure BorgBackup and Borgmatic on Monday August 04, 2025 @09:21AM (#44785402)
The intricacies of Borg are exactly why I switched over to a wrapper around pure git: https://kernc.github.io/myba/
Make your own backup system—is exactly what I did. I felt git porcelain had a stable-enough API to accommodate this popular use case.

https://kernc.github.io/myba/

Re:Every Line Is a Potential Bug on Thursday February 27, 2025 @03:20PM (#43198032)
Indeed, more repos should add a SLOC (e.g. ghloc) badge! Give you a feel for what you're working with.

https://github.com/pajecawav/ghloc-web#badges

Re:An overview of gradient descent optimization algorithms on Saturday January 25, 2025 @06:55PM (#42826235)
SAMBO does a good job of finding the global optimum in a black-box manner even compared to Nelder-Mead, according to its own benchmark ...

https://sambo-optimization.github.io

Older »