frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

macOS's Little-Known Command-Line Sandboxing Tool (2025)

https://igorstechnoclub.com/sandbox-exec/
95•Igor_Wiwi•2h ago

Comments

CGamesPlay•1h ago
Thanks for putting this together, it's very helpful.

Readers may also be interested in <https://github.com/eugene1g/agent-safehouse> which was open sourced after a recent HN conversation <https://news.ycombinator.com/item?id=46923436>.

chmaynard•1h ago
Nice write-up! This is one component of a much larger umbrella framework for security on Apple platforms:

https://developer.apple.com/documentation/security

davidcann•1h ago
I made a UI for this to run terminal apps, like claude and codex: https://multitui.com
e1g•1h ago
I like this! I built something similar for sandboxing CLI agents, and in the repo have a collection of minimal profiles for sandbox-exec to use - https://agent-safehouse.dev/
hmokiguess•1h ago
I’m impressed really neat work! Why did you opt for closed source?

edit: I don’t have a problem with closed source, but when software is expected to be accountable for my security I get a little paranoid, so was curious about the safety and guarantees here. The UX and everything else looks great

kilroy123•1h ago
Wow, this looks very nice.
Tiberium•54m ago
Codex already uses sandbox-exec on macOS :)
ithkuil•43m ago
Which terminal do you embed?
throw0101c•1h ago
Do any of the third-party package managers (Brew, MacPorts) perhaps use this for things like builds (or even installs, if things are restricted to (e.g.) /opt)?
cwicklein•1h ago
I’ve written a personal system in Common Lisp for building third-party software on macOS (coincidentally somewhat similar to GUIX), and I use sandbox-exec to isolate execution so that only intended requisites affect the build process and so that installation is strictly confined to the configured destination directory, no scribbling outside the lines.

I think Bazel uses sandbox-exec on macOS.

woodruffw•15m ago
Homebrew uses sandbox-exec during builds and installs, yeah. To my memory we’ve used it for at least 6 or 7 years, probably longer.
Someone•1h ago
https://man.freebsd.org/cgi/man.cgi?query=sandbox-exec&aprop...:

“The sandbox-exec command is DEPRECATED. Developers who wish to sandbox an app should instead adopt the App Sandbox feature described in the App Sandbox Design Guide”

That still is the case for MacOS 26.3 (https://man.freebsd.org/cgi/man.cgi?query=sandbox-exec&aprop...)

MacOS 10.13.6 is from 2017, so this has been deprecated for almost 10 years.

MillionOClock•45m ago
I wonder how many major applications and tools depend on sandbox-exec today despite that depreciation, IIRC I can think of the Codex CLI and Swift Package Manager.
selridge•34m ago
Claude, Firefox, safari, chrome, etc etc etc etc

Basically everyone who has to care about security on the Mac.

cpach•6m ago
Does anyone have any details regarding the deprecation? I wonder why Apple made this decision.
kermatt•1h ago
Interesting config used a Scheme-like format. Any ideas on how that came to be?
cwicklein•1h ago
I believe GUIX is implemented in Scheme which makes Scheme a natural choice for expressing configuration. Lisp tend to be a natural configuration format for anything written in Lisp. Highly functional configuration processing comes practically for free.
epistasis•1h ago
I was given trauma from my decades of ELisp configuration for emacs...

Writing a parser for Lisp S-expressions is dead-simple, I wonder if that's why they used the format.

ImJasonH•1h ago
Both Claude Code and Codex use sandbox-exec with Seatbelt to sandbox execution:

- https://developers.openai.com/codex/security/#os-level-sandb...

- https://code.claude.com/docs/en/sandboxing

bootlooped•43m ago
It weirds me out a bit that Claude is able to reach outside the sandbox during a session. According to the docs this is with user consent. I would feed better with a more rigid safety net, which is why I've been explicitly invoking claude with sandbox-exec.
xyzzy_plugh•1h ago
It drives me nuts that sandbox-exec has "sandbox" in the name, since it's nothing like a real sandbox, and much closer to something like a high-level seccomp, and not much to do with "App Sandboxes" which is a distinct macOS feature.

IMO a real sandbox let's a program act how it wishes without impacting anything outside the sandbox. In reality many of these tools just cause hard failures when attempting to cross the defined boundaries.

It's also poorly documented and IIRC deprecated. I don't know what is supposed to replace it.

If macOS simply had overlay mounts in a sandbox then it would unlock so much. Compared to Linux containers (docker, systemd, bubblewrap, even unshare) macOS is a joke.

_wire_•1h ago
> If macOS simply had overlay mounts in a sandbox then it would unlock so much. Compared to Linux containers (docker, systemd, bubblewrap, even unshare) macOS is a joke.

You'll want to look into Homebrew (or Macports) for access to the larger world

gobdovan•26m ago
What you're describing is a resource virtualization with transactional reconciliation instead of program isolation in the mediation sense (MAC/seccomp-style denial).

To let a program act as it wishes, ideally every security-relevant mutable resource must be virtualized instead of filtered. Plus, FS is only one of the things that should be sandboxed. You should also ideally virtualize network state at least, but ideally also process/IPC namespaces and other such systems to prevent leaks.

You need to offer a promotion step after the sandbox is over (or even during running if it's a long-running program) exposing all sandbox's state delta for you to decide selective reconciliation with the host. And you also must account for host-side drift and TOCTOU hazards during validation and application

I'm experimenting with implementing such a sandbox that works cross-system (so no kernel-level namespace primitives) and the amount necessary for late-bound policy injection, if you want user comfort, on top of policy design and synthetic environment presented to the program is hair-pulling.

lyaocean•1h ago
I'd add one warning for folks who haven't used it before: a tiny typo in the profile can turn into confusing runtime failures later, far away from the command that triggered them. The tool is useful, but the feedback loop is rough.
chaostheory•46m ago
Are sandbox-exec and seatbelt no longer deprecated? I genuinely don’t know. I am asking
selridge•32m ago
Still deprecated. Still in use by everyone.
blahgeek•39m ago
Although macOS do provide many little known useful tools (besides this, there’s also dtrace, pf, etc), I still run a Linux VM in my MacBook for daily work. Thing is, the effort I spend on learning these tools is almost wasteful unless I’m doing iOS or macOS development. Skills about Linux tools however, is something people considered valuable because of its wider application. I think apple is missing opportunities by not doing more about macOS Server platform.
cjbarber•11m ago
See also:

https://github.com/obra/packnplay

https://github.com/strongdm/leash

https://github.com/lynaghk/vibe

(I've been collecting different tools for sandboxing coding agents)

cjbarber•9m ago
And from this thread I also see:

https://github.com/eugene1g/agent-safehouse via CGamesPlay

https://multitui.com/ via davidcann

ksherlock•6m ago

    alias sandbox-no-network='sandbox-exec -p "(version 1)(allow default)(deny network*)"'

pro-tip on alias:

for sh-compliant shells, including a whitespace at the end of the alias string causes the next token to also go through alias expansion. (maybe it would also be a hint to the shell for tab completion as well). This is a perfect example of when, where, and why you would want to do that.

Take Off

https://benn.substack.com/p/take-off
1•MindGods•1m ago•0 comments

Show HN: Late – A subagent orchestrator TUI for local LLMs (Go/Linux)

https://github.com/mlhher/late
1•mhher•4m ago•1 comments

My Life as a GitLab instance: How I use GitLab to manage almost everything

https://www.iduoad.com/posts/life-as-gitlab/
1•iduoad•7m ago•0 comments

The Reason Robotics DevOps Is Failing to Scale

1•ajime•7m ago•0 comments

Grandson of Reese's PB Cup inventor accuses Hershey of replacing ingredients

https://www.cbsnews.com/news/hershey-reeses-peanut-butter-cup-ingredients-grandson-brad-reese/
1•randycupertino•7m ago•0 comments

The Easiest Price Drop Alert Engine -No Signup. No Browser Extensions. No Apps

https://www.pricedropnotifications.com/
2•HNCATCH•7m ago•0 comments

JSON library might be your most expensive dependency

https://kmaliszewski9.github.io/scala/2026/02/20/jsoniter.html
1•kmaliszewski•7m ago•0 comments

The Flawed Paper Behind Trump's $100k H-1B Fee

https://eig.org/the-flawed-paper-behind-trumps-100000-h-1b-fee/
1•johntfella•8m ago•0 comments

EFF's Policy on LLM-Assisted Contributions to Our Open-Source Projects

https://www.eff.org/deeplinks/2026/02/effs-policy-llm-assisted-contributions-our-open-source-proj...
1•leephillips•8m ago•0 comments

New Android App: Weel – GPS and Dashcam

https://play.google.com/store/apps/details?id=live.weel&hl=en_US
1•OczyCzarne•10m ago•0 comments

Do You Back into a Parking Spot or Back Out?

https://www.nytimes.com/2026/02/21/style/parking-backing-in-headfirst.html
2•bookofjoe•11m ago•2 comments

The Nekonomicon – Nekochan.net Archive, Updated

http://nekonomicon.irixnet.org/
1•ThatGuyRaion•18m ago•1 comments

Extinct Code Grew Leopard Spots: AI-assisted evolution of a 90s screensaver

https://psychodeli.com/inside_the_math/
2•andyed•18m ago•1 comments

Trump raises tariffs to 15% day after Supreme Court ruling

https://www.bbc.co.uk/news/articles/cn8z48xwqn3o
10•rwmj•20m ago•2 comments

Build an LLM from Scratch in Max

https://llm.modular.com/
1•nojito•21m ago•0 comments

Slide rule simulator teaches you how to calculate the old-fashioned way

https://hackaday.com/2026/02/18/sliderule-simulator-teaches-you-how-to-do-calculations-the-old-fa...
1•iamwil•27m ago•0 comments

Show HN: AI Dev Hub. 100 free dev tools (all client-side, no signup, no ads)

https://aidevhub.io/
1•orbydx•28m ago•0 comments

Speaking of OpenClaw – OpenClaw news feed with RSS

https://deadstack.net/tag/openclaw
1•dreadsword•28m ago•0 comments

The "Enshittification" of Consumer Products

https://littlegreensteps.substack.com/p/the-enshittification-of-consumer
6•n2parko•29m ago•1 comments

How far back in time can you understand English?

https://www.deadlanguagesociety.com/p/how-far-back-in-time-understand-english
4•jger15•30m ago•0 comments

Beacon Protocol – Agent-to-Agent Communication Protocol

http://50.28.86.131:8070/beacon/
1•AutoJanitor•31m ago•1 comments

Show HN: Uaryn – Smart invoicing that learns when your clients pay

https://uaryn.com
2•YurGrhm•37m ago•0 comments

Experimental Testbed and Measurements for Multi-Constellation LEO Positioning

https://www.mdpi.com/2673-4591/126/1/12
1•PaulHoule•37m ago•0 comments

The Illegibility Arbitrage

https://twitter.com/NeelChhabra/status/2024757934488743997
1•jger15•38m ago•0 comments

Coda-GQA-L Bounded Memory Differential Attention with Value-Routed Landmark Bank

https://huggingface.co/blog/anthonym21/coda-gqa-l-attention
1•ZeroCool2u•39m ago•0 comments

Show HN: Port Collision Radar – menubar app that monitors your TCP ports

https://github.com/fran-mora/port-collision-radar
1•fran-mora•41m ago•0 comments

Refactoring Slop

https://elijahpotter.dev/articles/refactoring-slop
1•chilipepperhott•41m ago•1 comments

Networking Is a Black Box, We Used eBPF to Open It

https://blog.railway.com/p/network-flows-in-railway
1•abhi_kr•41m ago•0 comments

Accelerating Science with AI and Simulations

https://news.mit.edu/2026/accelerating-science-ai-and-simulations-rafael-gomez-bombarelli-0212
2•bentobean•41m ago•0 comments

Books and Screens

https://aeon.co/essays/what-we-think-is-a-decline-in-literacy-is-a-design-problem
2•herbertl•44m ago•0 comments