ARAPUCA(1)
๐ซถ arapuca โ from the Arapuca Manual, section 1 ๐ซถ
okay bestie, sit down, hydrate, and let me tell you about arapuca. it's giving sandbox, it's giving kernel-enforced isolation, it's giving "your untrusted code cannot hurt me" ๐
๐ธ NAME ๐ธ
arapuca โ sandbox a command with kernel-enforced isolation. that's it, that's the whole vibe.
โจ SYNOPSIS โจ
arapuca run [flags] -- command [args...]
arapuca -h | --help
arapuca -V | --version
note the -- bestie. it is not optional. the -- is the main character here, it's what separates your flags from the command. ๐
๐ DESCRIPTION ๐
arapuca run launches command in a process-level sandbox with user-friendly CLI flags. it uses the library's platform abstraction so it's cross-platform, no cap: Landlock + seccomp on Linux, Seatbelt on macOS, AppContainer on Windows. three platforms, one slay. ๐
there's also the internal wrapper path โ arapuca -- command. that one applies sandbox restrictions to the current process, then replaces itself with command via execve(2). it's configured via environment variables. it's used internally by the library as a subprocess wrapper, so direct CLI invocations require ARAPUCA_WRAPPER=1 to be set by the library. unrecognized subcommands or flags are rejected. ๐ซ
on Linux, arapuca enforces Landlock filesystem restrictions, seccomp BPF syscall filtering, POSIX resource limits, and sets PR_SET_PDEATHSIG so the subprocess gets killed if the parent dies. it's giving loyal, it's giving no orphans. ๐ฅ
on macOS, arapuca enforces POSIX resource limits only โ filesystem and network restrictions are applied by the caller via sandbox-exec(1). so like, it's doing its part, but the caller's doing the rest. teamwork. ๐ซถ
the sandbox is fail-closed: if any restriction fails to apply, arapuca exits non-zero and the target command never runs. literally never. no half-sandbox, no "oops we tried". periodt.
all ARAPUCA_* environment variables are stripped before exec so the sandboxed process cannot inspect its own configuration. sneaky-proof. ๐ non-ARAPUCA variables (e.g., AGENT_NETWORK_PROXY) are preserved, so your other stuff survives the cleanse.
๐ OPTIONS (arapuca run) ๐
-vpath[:ro]โ allow access to path. read-write by default; append:rofor read-only. repeatable. paths must be absolute. default system paths (/usr,/lib,/bin,/etc/ssl,/tmp, device nodes) are readable. only the private per-task temp dir is writable by default./proc,/sys, and blanket/devare NOT included by default. use-v /tmpto grant write access to all of/tmp. ๐--cwdpath โ set the working directory for the sandboxed process. the path must be absolute, must exist, must be a directory, and must be within a mounted path (default or-v). symlinks are resolved before the containment check. useful for programmatic callers that need to set the working directory without shell wrappers. very "i know what i'm doing" of you. โจ--envKEY=VALUE โ pass an environment variable to the sandboxed process. dangerous variables (LD_PRELOAD,ARAPUCA_*,DYLD_*, interpreter injection vectors) are rejected. sandbox-managed variables (HOME,TMPDIR,PATH,LANG) cannot be overridden. repeatable. sorry bestie,PATHis not yours to change. ๐ญ--timeoutN โ kill the process after N seconds. sendsSIGTERMfirst, thenSIGKILLafter a 5-second grace period. N must be greater than 0. it's polite, then it's not. ๐--memoryN โ memory limit in megabytes. enforced via cgroups v2 on Linux, RSS polling on macOS, Job Objects on Windows.--cpusN โ CPU limit as a percentage of a single core.200means 2 cores. math but make it fashion. ๐งฎ--pidsN โ maximum number of PIDs (cgroups v2 on Linux, Job Objects on Windows).--task-idNAME โ identifier for cgroup directory and audit events. must match[a-zA-Z0-9-]+, max 128 characters. defaults torun-pid.--seccompmode โ seccomp BPF filter profile.strict(default) blocksAF_INET,symlink,memfd_create,io_uring, and other syscalls โ designed for untrusted code.baselineblocks only sandbox-escape syscalls (ptrace,mount, namespace ops, kernel modules,bpf) and adds/proc+/sysread access โ designed for trusted-but-isolated applications like Claude Code that need full runtime capabilities while being confined by Landlock + netns. pick your fighter. ๐ฅ--allow-hosthost:port โ allow HTTPS traffic to host:port via a CONNECT proxy tunnel. repeatable. supports exact match (api.example.com:443) and wildcard suffix match (*.googleapis.com:443โ matches the domain itself and any subdomain). when specified, the sandboxed process runs in a network namespace with no direct network access. a CONNECT proxy on the host network tunnels traffic only to listed hosts. DNS resolution happens in the proxy with IP validation (loopback, RFC 1918, CGNAT, link-local, and cloud metadata addresses are rejected to prevent DNS rebinding SSRF). Linux only. ๐ง-t,--ttyโ allocate a pseudo-terminal (PTY) for the sandboxed process. enables interactive programs (shells, editors, TUI applications) that require a terminal. requires stdin and stdout to be a terminal. theTERMenvironment variable is forwarded from the host (sanitized). for the girls who need a real terminal, not a pipe. ๐
๐ ENVIRONMENT (internal wrapper) ๐
ARAPUCA_WRAPPERโ internal sentinel. must be set to1by the library when invoking the wrapper path. direct invocations without this variable are rejected. stripped before exec. it's the secret handshake. ๐ค
the following variables configure the internal wrapper path. they are not used by arapuca run (which uses CLI flags instead). okay so two different worlds, don't mix them up.
ARAPUCA_READ_PATHSโ colon-separated list of paths the subprocess may read. each path and everything below it is readable.
ARAPUCA_READ_PATHS=/usr:/lib:/lib64:/bin:/etc:/dev
ARAPUCA_WRITE_PATHSโ colon-separated list of paths the subprocess may read and write.
ARAPUCA_WRITE_PATHS=/tmp/workspace
ARAPUCA_RLIMIT_ASโ maximum virtual memory size in bytes. enforced viasetrlimit(2)(RLIMIT_AS). set to0or omit to leave unlimited.
on Apple Silicon,RLIMIT_ASshould not be set โ macOS aggressively maps virtual memory and setting this limit causes immediateSIGKILL. ๐ seriously, do not.
ARAPUCA_RLIMIT_NPROCโ maximum number of processes for the user. enforced viasetrlimit(2)(RLIMIT_NPROC). set to0or omit to leave unlimited.ARAPUCA_RLIMIT_CPUโ maximum CPU time in seconds. enforced viasetrlimit(2)(RLIMIT_CPU). the kernel sendsSIGXCPUwhen the soft limit is reached andSIGKILLat the hard limit. set to0or omit to leave unlimited. two warnings, then the hammer. ๐จARAPUCA_RLIMIT_FSIZEโ maximum file size in bytes. enforced viasetrlimit(2)(RLIMIT_FSIZE). writes that would exceed the limit receiveSIGXFSZ. set to0or omit to leave unlimited.
๐ฅ EXIT STATUS ๐ฅ
0โ the target command exited successfully. slay. โจ1โ usage error (unrecognized subcommand or flag, missingARAPUCA_WRAPPERsentinel, no--separator, command not found, or sandbox setup failed). a diagnostic is printed to stderr. ๐ญ>1โ the target command exited with a non-zero status. the exit code is passed through. we don't hide your failures, we just relay them.125โ sandbox infrastructure error (arapuca runonly). invalid flags, sandbox setup failure, or CONNECT proxy failure.137โ the target command was killed bySIGKILL(e.g., parent died andPR_SET_PDEATHSIGfired, cgroup OOM kill, or timeoutSIGKILL). ๐143โ the target command was killed bySIGTERM(e.g., timeout fired). the gentler goodbye. ๐ซถ
๐ SECURITY ๐
๐ง Linux
on Linux (kernel 5.13+), arapuca enforces:
- Landlock โ restricts filesystem access to the paths listed in
ARAPUCA_READ_PATHSandARAPUCA_WRITE_PATHS. all other paths are inaccessible. supports ABI versions 1 through 6. - Seccomp BPF โ installs a syscall filter with two tiers:
KILL_PROCESS:ptrace,mount,chroot,unshare,setns,clone3,memfd_create,io_uring,bpf,kexec, kernel module loading.EPERM:symlink,link,socket(AF_INET),socket(AF_INET6),perf_event_open.socket(AF_UNIX)is allowed โ it is needed for IPC with the host (JSON-RPC control socket, LLM proxy). bestie privileges. ๐ซถ
PR_SET_NO_NEW_PRIVSโ set before Landlock and seccomp. prevents privilege escalation via setuid binaries.PR_SET_PDEATHSIGโ sendsSIGKILLto the subprocess if the parent process dies. prevents orphaned sandboxed processes. no abandoned children in this household. ๐
๐ macOS
on macOS, arapuca enforces only POSIX resource limits. filesystem and network restrictions are applied externally by sandbox-exec(1) using a Seatbelt profile generated by the arapuca library. teamwork, again.
๐ Both Platforms
- POSIX resource limits โ
RLIMIT_AS,RLIMIT_NPROC,RLIMIT_CPU, andRLIMIT_FSIZEare set as both soft and hard limits, so the subprocess cannot raise them. locked in, no takebacks. ๐ - Environment stripping โ all
ARAPUCA_*variables are removed. the subprocess cannot discover its own sandbox configuration. what config? never heard of her. ๐
๐ฆ EXAMPLES ๐ฆ
โจ arapuca run
run a command with default sandboxing:
arapuca run -- /bin/echo hello
grant read-only access to a project directory:
arapuca run -v /home/user/project:ro -- ls /home/user/project
sandbox a Claude Code agent with selective HTTPS access:
arapuca run \
-v /home/user/repo \
--allow-host us-east5-aiplatform.googleapis.com:443 \
--allow-host oauth2.googleapis.com:443 \
--env VERTEXAI_PROJECT=my-project \
--timeout 600 --memory 3072 \
-- claude --bare -p --model claude-sonnet-4-6
interactive PTY session inside the sandbox:
arapuca run -t \
-v /home/user/project:ro \
--seccomp baseline \
-- /bin/bash
๐ง Internal wrapper (arapuca --)
run a Python script with read access to system paths and write access to a workspace directory (requires ARAPUCA_WRAPPER=1):
ARAPUCA_READ_PATHS=/usr:/lib:/lib64:/bin:/etc:/dev \
ARAPUCA_WRITE_PATHS=/tmp/workspace \
arapuca -- python3 agent.py
run a command with resource limits (2 GB memory, 256 processes, 1 hour CPU, 1 GB max file size):
ARAPUCA_RLIMIT_AS=2147483648 \
ARAPUCA_RLIMIT_NPROC=256 \
ARAPUCA_RLIMIT_CPU=3600 \
ARAPUCA_RLIMIT_FSIZE=1073741824 \
arapuca -- ./run-tests.sh
the internal wrapper requiresARAPUCA_WRAPPER=1โ direct CLI invocations are rejected. usearapuca runinstead. fr fr, just usearapuca run. ๐ซถ
๐ SEE ALSO ๐
landlock(7), seccomp(2), setrlimit(2), sandbox-exec(1), prctl(2), execve(2), unshare(1)
๐ AUTHORS ๐
Sergio Correia <scorreia@redhat.com> โ the icon who built this. ๐
and that's the whole page, bestie โ this was arapuca from the Arapuca Manual, section ARAPUCA(1). go forth, sandbox responsibly, and remember: fail-closed or it didn't happen. ๐โจ๐๐ฆ๐ธ๐
๐ซถ
๐ฆ where this page comes from
- fedora 43: arapuca 0.2.8-1.fc43 ยท Apache-2.0 AND MIT AND (Apache-2.0 OR BSD-3-Clause) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR LGPL-2.1-or-later)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms