# OS Sandbox Execution Isolation Specification
Rivox isolates native compilation build steps (`cargo build`, C extensions for Python wheels, `node-gyp`) to prevent side-effects or secret exfiltration.
---
## Operating System Primitives
### Linux Sandboxing (`src/sandbox/linux.rs`)
Uses Linux unprivileged user, mount, and network namespaces (`CLONE_NEWNS`, `CLONE_NEWNET` via `nix` crate):
- Read-only root bind-mounts.
- Fresh `tmpfs` over `/tmp` and target output paths.
- Loopback-only network isolation unless `allow_network` is explicitly set.
### macOS Sandboxing (`src/sandbox/macos.rs`)
Invokes `/usr/bin/sandbox-exec -f <policy.sb>` with generated Seatbelt policy profiles restricting filesystem write access strictly to designated build output directories.
See also: [security.md](security.md), [provenance.md](provenance.md).