zed/tooling/xtask
Cameron Mcloughlin 3dcdee6d2b
sandbox: New linux sandbox (#67062)
Note: this PR does not change any behaviour of zed itself. The old
sandbox implementation is still in use. The code in this PR is not
considered secure. I'll need more time to torture it before I'm
confident :)

The old sandbox used `bwrap` to set up mounts to restrict FS access, and
an in-sandbox network proxy to forward HTTP requests. It has significant
limitations however:
- it cannot restrict FS access to paths that don't exist at sandbox
creation time. This means that files that become available while a
command is running are unprotected
- it cannot restrict FS access based on a glob - each individual mount
must be specified explicitly
- it cannot restrict network access that is not HTTP (i.e. SSH traffic).
- it cannot change permissions while a sandboxed command is running -
the grants given at the start of the execution are fixed. Agents can
request to re-run the app with broader permissions, which is fine, but
not great UX
- it cannot detect whether a command failed because it hit the sandbox
boundary or not. Again, agents can guess, but we'd like something more
robust
- it cannot dynamically prompt the user to escalate privileges

The new sandbox has a different different design which solves these
problems:
- all restrictions go through seccomp user notifications
- this allows us to register a supervisor process with the kernel to
validate the syscalls of another program. This supervisor can run
arbitrary userspace code to inspect syscalls before
allowing/denying/modifying them
- we create and upload a policy object to this supervisor which checks
syscalls against this policy
- if the policy says that the operation requires "ask"-ing, the
supervisor will ask zed to show a prompt to the user and report a
decision

This design is a lot more unified, and since it is much more flexible,
is also potentially suitable for sandboxing more parts of zed (user
terminals, LSP servers, etc.).

Release Notes:

- N/A
2026-11-17 12:43:21 +00:00
..
src sandbox: New linux sandbox (#67062) 2026-11-17 12:43:21 +00:00
Cargo.toml Reduce the dependency footprint (#65176) 2026-10-05 12:44:26 +00:00
LICENSE-GPL Add cargo xtask clippy (#8722) 2024-03-02 14:46:02 -05:00