Logo
Back to articlesSafehouse sandboxes AI coding agents on macOS

10 Mar 20267 minute read

Paul Sawers

Freelance tech writer at Tessl, former TechCrunch senior writer covering startups and open source

Developers are increasingly handing real authority to AI coding agents, letting them write files, run shell commands, and modify projects autonomously. That convenience, while potentially time-saving, carries clear risks.

A new tool called Safehouse is trying to address that problem by restricting what those agents can access on a Mac.

Safehouse, essentially, is a lightweight open-source utility designed to run AI agents inside a controlled environment on macOS. The goal is simple: allow developers to experiment with autonomous coding tools without giving them unrestricted access to the entire machine.

Locking agents into a controlled environment

AI coding assistants are evolving rapidly, and many now operate with broad permissions on a developer’s machine. That means an agent can access files, run shell commands, and modify projects using the same privileges as the person who launched it – potentially exposing sensitive material such as SSH keys, personal files, or unrelated codebases.

Safehouse attempts to narrow that access, launching an agent inside a macOS sandbox policy that defines what resources the program can reach.

A typical interaction with an autonomous coding agent might begin with a simple instruction: work within a project directory and avoid touching anything else on the machine. In practice, however, agents often run shell commands using the same permissions as the developer who launched them. That means a stray command can reach files well outside the intended project — including sensitive locations such as the .aws directory, where cloud credentials are often stored.

Agent attempts to access AWS credentials
Agent attempts to access AWS credentials

Safehouse can be configured to block access to sensitive locations outside the permitted project directory.

For example, a command attempting to read the file ~/.aws/credentials — which typically stores AWS authentication keys — fails with an “operation not permitted” error, preventing the agent from retrieving those credentials.

Safehouse blocks the credentials request
Safehouse blocks the credentials request

More broadly, an agent can be restricted to a specific project folder while being prevented from reading files in other locations such as ~/.ssh or a user’s documents directory.

Put simply, Safehouse acts as a wrapper around a command-line program. Instead of running an agent directly, developers launch it through Safehouse, which then applies the sandbox restrictions.

The idea is to reduce the potential damage if an agent executes an unintended command or accesses files outside the intended scope of a project.

A macOS answer to Linux container setups

The concept will feel familiar to many developers who already isolate programs using container technology on Linux. For instance, Linux Containers (LXC) create isolated environments for applications using features built directly into the Linux kernel. LXC relies on mechanisms such as namespaces and control groups (cgroups) to separate processes and limit their access to system resources.

That approach works well on Linux, but macOS uses a different kernel architecture and doesn’t support those container primitives directly.

Safehouse effectively fills that gap by leaning on Apple’s native sandbox system to achieve a similar outcome. Instead of Linux container isolation, it applies operating system–level rules that restrict file access and system capabilities.

The result is a macOS-friendly containment mechanism for the growing class of autonomous developer tools.

The project has already attracted attention among developers, including a busy discussion on Hacker News where the creator joined the conversation. Developer and open-source advocate Simon Willison also weighed in, noting that evaluating the reliability of sandboxing tools remains a challenge.

“The challenge I'm finding with sandboxes like this is evaluating them in comparison to each other,” Willison wrote. “This looks like a competent wrapper around sandbox-exec,” referring to Apple’s command-line sandboxing utility for macOS, which has been deprecated. “I've seen a whole lot of similar wrappers emerging over the past few months. What I really need is help figuring out which ones are trustworthy.”

Willison added that tools like this would benefit from clearer documentation and transparent testing. Many sandboxing mechanisms, including sandbox-exec itself, remain sparsely documented, making it harder for developers to assess whether they function as intended or provide the protections they claim.

Others in the discussion suggested the issue goes beyond documentation, arguing that containment may be one of the most important unresolved problems as AI agents gain broader access to developer machines.

“I honestly think that sandboxing is currently THE major challenge that needs to be solved for the tech to fully realise its potential,” one responder wrote. “Yes the early adopters will YOLO it and run agents natively. It won't fly at all longer term or in regulated or more conservative corporate environments, let alone production systems where critical operations or data are in play.”

The rise of the local AI stack

The appearance of projects like Safehouse reflects a broader shift in developer tooling.

More developers are running AI models and agent frameworks locally, building something akin to a “local AI stack.” Tools such as Ollama run language models directly on a developer’s machine, while agent frameworks such as OpenClaw orchestrate tasks around them.

That setup keeps code private and reduces reliance on external APIs, but it also means increasingly capable agents are operating directly on a developer’s laptop.

Safehouse targets the security concerns that come with that arrangement. By restricting what an agent can access, the tool attempts to create a safer boundary around software that is becoming more capable — and more autonomous — inside the development environment.