z_jail
Multi-layer Linux sandbox for native code execution
TLDR
SYNOPSIS
z_jail --root=dir [options] -- program [args]
DESCRIPTION
z_jail is a lightweight C99 sandbox for executing untrusted native binaries on Linux. It combines seven defence layers with no runtime dependencies beyond the standard C toolchain: Truthimatics verdict engine, mount/PID/net/IPC/UTS namespaces, pivot_root, capability dropping with locked securebits, PR_SET_NO_NEW_PRIVS, seccomp-BPF syscall whitelisting, and JSON audit logging with BLAKE2b content fingerprints.The parent process clones isolated namespaces, applies resource limits, pivots into --root, installs the seccomp filter, and execves the target. After the child exits, an audit record is written describing verdict, duration, sandbox settings, and executable hash.Designed for CI pipelines, CTF jails, and lightweight code evaluation, z_jail sits between minimal tools like bwrap and heavier sandboxes such as nsjail or gVisor.
PARAMETERS
--root=dir
Sandbox root directory containing the target binary and dependencies (required).--seccomp-enforce
Enable seccomp-BPF whitelist (whitelist-v1, 15 syscalls).--self-hash=hex
Refuse to run unless the z_jail binary matches the given BLAKE2b-256 hash.--quiet
Suppress JSON audit output.--verbose
Enable debug logging.--version
Print build ID and exit.--help
Show usage and exit.
CAVEATS
z_jail requires CAP_SYS_ADMIN (typically root) to create namespaces and pivot_root. The default seccomp whitelist allows only 15 syscalls — many programs need a custom policy or will be killed. Dynamic binaries require libraries inside --root; static binaries need only the executable. Kernel exploits and hardware side channels are outside the stated threat model.
HISTORY
Z-Jail was developed by Division-36 and released as v1 in 2026, targeting Linux kernel 5.4+ with a single make build and no external libraries.
