Giving an AI Agent a Real Sandbox: Filesystem and Network Jail, in Java Solon AI has released solon-ai-sandbox, a Java module that wraps agent-issued shell commands in real filesystem and network isolation on macOS, Linux, and Windows. The module, a Java port of Claude Code's sandbox-runtime, uses native platform facilities — sandbox-exec with Seatbelt profiles on macOS, bubblewrap on Linux, and srt-win.exe with a WFP filter layer on Windows — to keep agents confined to a project directory without requiring a container runtime. It applies allow-only defaults for writes and deny-then-allow-back defaults for reads, so agents can build and edit code while being blocked from sensitive paths such as ~/.ssh and ~/.aws. Ask a coding agent to run a build, and you have just handed a language model the ability to cat ~/.ssh/id rsa . Prompt-level instructions like "do not read sensitive files" are not a security boundary — they are a suggestion to a stochastic process. If the agent executes commands on your machine, the only control that actually holds is the one the operating system enforces. That is the problem Solon AI https://solon.noear.org/article/learn-solon-ai 's new solon-ai-sandbox module solves. It is a Java port of Claude Code's sandbox-runtime , and it wraps agent-issued commands in real filesystem and network isolation — on macOS, Linux, and Windows. All code below was verified against the solon-ai-sandbox source in the Solon AI 4.1.x tree. Containers are the usual answer, and for a server-side agent they are the right one. But the agents people actually run interactively — the ones editing their working copy of a repo — are not in a container. They are on a laptop, in a terminal, one bash call away from everything the user can touch. Booting a VM or a container per command is too slow for that loop, and it breaks the agent's access to the working tree you wanted it to edit. What you want is a narrow boundary: keep the agent in the project directory, let it reach the registries and package mirrors the build needs, and make everything else fail closed — without a container runtime in the picture. solon-ai-sandbox does exactly that, using each platform's native facility: | Platform | Mechanism | |---|---| | macOS | sandbox-exec with a generated Seatbelt profile | | Linux | bubblewrap bwrap , plus socat for the network bridge | | Windows | srt-win.exe with a WFP filter layer | The module depends on nothing but solon-ai-core , so pulling it in does not drag a container runtime along with it. SandboxManager is a final class with static methods — there is one sandbox per process, and there is one place to configure it.