Environment:1ay1 Agentty Linux Landlock Seccomp
| Knowledge Sources | |
|---|---|
| Domains | Security, Operating_Systems |
| Last Updated | 2026-10-28 14:00 GMT |
Overview
Linux kernel environment with Landlock LSM, seccomp BPF, and cgroup2 support for OS-level sandbox containment of agent-spawned processes.
Description
This environment provides the kernel-level containment mechanisms that the claybin sandbox engine compiles into walls. On Linux, claybin uses unprivileged user namespaces for mount isolation, Landlock (ABI 1+) for filesystem access control, seccomp BPF for syscall filtering, and cgroup2 for memory/pids resource caps. The sandbox is the only Linux engine — bwrap was removed because claybin's floor is `landlock OR seccomp`, and seccomp (Linux 3.5) predates the unprivileged userns bwrap requires (3.8). Every host that could run bwrap can run claybin.
Usage
Use this environment for any Sandbox_Containment workflow that runs shell commands, tools, or subprocesses on Linux. It is the mandatory prerequisite for the claybin_backend implementation and the sandbox enforcement layer.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux (kernel 3.5+) | seccomp floor; unprivileged userns needs 3.8+ |
| Hardware | Any Linux-capable CPU | No GPU required |
| Kernel features | Landlock ABI 1+ (preferred) OR seccomp BPF | claybin needs only one; falls back gracefully |
| cgroup2 | Mounted at /sys/fs/cgroup/ | Required for memory/pids caps; absent cgroup2 = no resource caps |
| Disk | Minimal | Sandbox config + guarantee report are in-memory |
Dependencies
System Packages
- `linux-kernel` >= 3.5 (seccomp floor)
- `linux-kernel` >= 5.13 (Landlock ABI 1, preferred)
- `linux-kernel` >= 6.2 (Landlock ABI 4, for per-port TCP network allowlisting via NetMode::Ports)
- cgroup2 mounted (`/sys/fs/cgroup/`)
Library Packages
- `claybin` submodule (vendored, compiled in-tree)
- No external system libraries beyond the kernel
Credentials
No environment variables required. The sandbox probe runs at process startup and caches results for the process lifetime.
Quick Install
# No install needed — claybin is a vendored submodule compiled into agentty.
# Ensure cgroup2 is mounted (most modern distros mount it by default):
mount | grep cgroup2
# Check Landlock ABI version your kernel supports:
cat /sys/security/landlock/version 2>/dev/null || echo "Landlock not available"
# Build agentty (claybin compiles in):
cmake -B build && cmake --build build -j$(nproc)
Code Evidence
Platform detection from `src/tool/util/sandbox_claybin.cpp:40-73`:
#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32)
// ...
#if defined(__linux__)
#include "claybin/broker/notify.hpp"
#include "claybin/plan/spawn.hpp"
#elif defined(__APPLE__)
#include "claybin/macos/backend.hpp"
#else
// ...Windows...
#include "claybin/windows/backend.hpp"
#endif
Host capability probe from `include/agentty/tool/util/sandbox_claybin.hpp:82-83`:
[[nodiscard]] bool available();
[[nodiscard]] std::uint32_t landlock_abi();
Landlock network allowlist requirement from `include/agentty/domain/sandbox_config.hpp:84-88`:
// Only the ports in `allow_ports`, enforced by landlock. Needs landlock
// abi >= 4; falls back to Full with the guarantee report saying `partial`
// rather than silently pretending.
Ports,
Seccomp floor reasoning from `include/agentty/domain/sandbox_config.hpp:252-255`:
// bwrap was the other value... claybin's floor is `landlock || seccomp`,
// and seccomp predates (3.5) the unprivileged user namespaces bwrap requires
// (3.8). Every host that could run bwrap has claybin.
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `sandbox: unavailable, running unsandboxed` | Host probe failed (no landlock AND no seccomp) | Upgrade kernel to 5.13+ for Landlock, or ensure seccomp is enabled |
| `sandbox: active` while commands fail on uid_map denial | Unprivileged userns unavailable (kernel < 3.8 or disabled) | Enable unprivileged userns: `echo 1 > /proc/sys/kernel/unprivileged_userns_clone` |
| Network allowlist shows `partial` in guarantee report | Landlock ABI < 4 (no TCP connect mediation) | Upgrade kernel to 6.2+ for Landlock ABI 4 |
| Memory/pids caps absent | cgroup2 not mounted | Mount cgroup2: `mount -t cgroup2 none /sys/fs/cgroup` |
Compatibility Notes
- Landlock ABI versions: ABI 1 (kernel 5.13) provides filesystem access control. ABI 4 (kernel 6.2) adds per-port TCP connect mediation for NetMode::Ports. Lower ABI falls back to Full with `partial` in the guarantee report.
- seccomp fallback: If Landlock is absent, claybin falls back to seccomp-only (syscall filter + mount ns). Filesystem wall is weaker without landlock's per-path deny rules.
- cgroup2: Required for memory_bytes and pids caps. Without cgroup2, resource limits report `none` in the guarantee report rather than silently failing.
- Unprivileged userns: Needed for mount namespace isolation. Some distros disable it via sysctl; claybin reports `unavailable` and commands run unconfined (reported at startup, never silently).