# sandbox-exec

25 Hacker News commenters recommended sandbox-exec and 7 criticized it, November 2025 to November 2026. It was recommended in 11 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Free macOS built-in tool that people use to restrict what wrapped commands and coding agents can read and reach; it is hard to configure and poorly documented.

## Why people recommend it

- Wraps AI coding agents safely (5 comments): "I would feed better with a more rigid safety net, which is why I've been explicitly invoking claude with sandbox-exec." ([source](https://news.ycombinator.com/item?id=47101973)) "If you are on macOS it is not a bad idea to use sandbox-exec to wrap your claude or other coding agents around." ([source](https://news.ycombinator.com/item?id=46268923)) "I run it on Mac with sandbox-exec. No access to AWS, database, pretty much just files in the current folder." ([source](https://news.ycombinator.com/item?id=48951493))
- Built into macOS, no install (4 comments): "I trust sandbox-exec more, or Docker on Linux. Those come from the OS, well tested and known." ([source](https://news.ycombinator.com/item?id=47604725)) "But it’s available everywhere, and still works - and protects us - like brand new!" ([source](https://news.ycombinator.com/item?id=47303965)) "OSX is the best, we use the in-built (seatbelt) sandbox via sandbox-exec." ([source](https://news.ycombinator.com/item?id=48902221))
- Lightweight with little overhead (4 comments): "a simple bubblewrap (Linux) or sandbox-exec (macOS) is probably enough and also much less overhead" ([source](https://news.ycombinator.com/item?id=46696642)) "bubblewrap and similar (Landlock, sandbox-exec on Mac) are solid lightweight options" ([source](https://news.ycombinator.com/item?id=46828703)) "There's no reason to bring a whole new system along just to restrict some access." ([source](https://news.ycombinator.com/item?id=45922855))
- Restricts file and network access (3 comments): "I run it on Mac with sandbox-exec. No access to AWS, database, pretty much just files in the current folder." ([source](https://news.ycombinator.com/item?id=48951493)) "the sandbox-exec tool still works perfectly to avoid that kind of horror story" ([source](https://news.ycombinator.com/item?id=46107236)) "Sandbox-exec covers everything I personally expect from a sandbox" ([source](https://news.ycombinator.com/item?id=47102788))

## What people warn about

- Poorly documented, hard to learn (4 comments): "I'd love to have Claude write me proper documentation for the sandbox-exec command for example, but that thing is pretty much a black hole" ([source](https://news.ycombinator.com/item?id=46575265)) "Most sandboxes - including sandbox-exec itself - are massively under-documented." ([source](https://news.ycombinator.com/item?id=47303325)) "Apple's sandbox-exec which is itself almost entirely undocumented" ([source](https://news.ycombinator.com/item?id=47604626))
- Profiles hard to configure correctly (4 comments): "using sandbox-exec has yielded better workflows (if & when I've gotten an appropriate profile stood up)" ([source](https://news.ycombinator.com/item?id=48980141)) "It is a pain to configure properly but at least I know where sandbox is controlled." ([source](https://news.ycombinator.com/item?id=46425136)) "It is also easy to get wrong if there is not a "(default deny)" in the profile." ([source](https://news.ycombinator.com/item?id=47106447))
- Apple has deprecated it (2 comments): "It's also poorly documented and IIRC deprecated." ([source](https://news.ycombinator.com/item?id=47101662)) "There is a reason why it is deprecated by Apple." ([source](https://news.ycombinator.com/item?id=47304713))
- Has been bypassed before (2 comments): "it has been bypassed before and having it being used all over the OS doesn't mean anything" ([source](https://news.ycombinator.com/item?id=47305527)) "All the sandbox-exec and all the Lulu rules are not going to protect against something like this." ([source](https://news.ycombinator.com/item?id=50184801))

## Alternatives hackers recommend

- [Bubblewrap (bwrap)](https://hackerapproved.com/p/bubblewrap.md): 109 recommend
- [Agent Safehouse](https://hackerapproved.com/p/agent-safehouse.md): 43 recommend
- [nono](https://hackerapproved.com/p/nono.md): 34 recommend
- [Firejail](https://hackerapproved.com/p/firejail.md): 30 recommend
- [Bubblewrap (bwrap)](https://hackerapproved.com/p/bwrap.md): 11 recommend

## Cite as

Hacker Approved, "sandbox-exec", https://hackerapproved.com/p/sandbox-exec/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
