> ## Documentation Index
> Fetch the complete documentation index at: https://axe-engine.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform requirements

> The Linux features AXE uses, what each is for, and what happens when the kernel or sandbox does not provide it.

What the engine and `axed` need from the Linux environment they run in, and how they fall back when a feature is missing. For how each platform was tested, see the deploy guides: [containers](https://axe-engine.mintlify.site/deploy/containers.md), [gVisor](https://axe-engine.mintlify.site/deploy/gvisor.md), [Firecracker](https://axe-engine.mintlify.site/deploy/firecracker.md), [Agent Sandbox](https://axe-engine.mintlify.site/deploy/agent-sandbox.md) and [Agent Substrate](https://axe-engine.mintlify.site/deploy/agent-substrate.md).

AXE builds for Linux on x86\_64 and aarch64 only. The `axe` crate refuses to compile for any other operating system or architecture: it starts processes with raw `clone` system calls written for those two.

## What the engine needs from Linux

| Feature | Used for | Without it |
| - | - | - |
| `waitid(WNOWAIT)`, `wait4` | The single reaper thread | Required |
| `clone3` with `CLONE_INTO_CGROUP` (Linux 5.7) | Starting a process directly in its cgroup | The child joins its cgroup itself. Where `clone3` is refused (before Linux 5.5, gVisor, seccomp profiles that block it), plain `clone` is used. |
| `waitid` on a pidfd (Linux 5.4) | Telling a new child from an earlier process that had its pid, without holding up the reaper | Each process is started while holding the reaper's lock, so no exit is collected during a start |
| `PR_SET_CHILD_SUBREAPER` | Collecting orphans when not PID 1 | Whoever is PID 1 reaps orphans |
| `openat` with `O_PATH`, `O_NOFOLLOW` | Race-free path resolution | Required |
| `O_TMPFILE` and `linkat` through `/proc/self/fd` | Invisible, crash-safe uploads | Falls back to a named `.axe-tmp-*` file |
| `pidfd_open`, `pidfd_send_signal` | Signaling a leader without pid-reuse races | Falls back to `kill` |
| inotify | Directory watching | Watch calls fail; everything else works |
| PTYs (`/dev/ptmx`) | Terminal sessions | Terminal sessions fail |
| cgroup v2, delegated and writable | Whole-tree kill, hard limits, OOM detection, freeze | Process groups and rlimits; no CPU limits or freeze |
| `CLOCK_BOOTTIME` | Telling a resume from a late timer | Resumes that only move boot time go unnoticed |
| `AF_VSOCK` | The vsock listener | That listener fails to bind |

## Fallbacks in detail

### Without cgroups

With `--cgroups auto` (the default), `axed` uses cgroups only when it owns a writable cgroup v2 subtree. Otherwise it logs `cgroups unavailable; using process groups and rlimits` and continues. `--cgroups required` refuses to start instead.

| Capability | With cgroups | Without cgroups |
| - | - | - |
| Kill a whole tree | `cgroup.kill` reaches every descendant, including ones that left the process group (before Linux 5.14, freezing the cgroup and killing each task in it) | `SIGKILL` to the process group plus every descendant found through `/proc/<pid>/task/*/children` |
| Memory limit | `memory.max` for the tree, `memory.oom.group`, and `memory.swap.max` set to 0 when swap accounting exists | `RLIMIT_AS` per process |
| Task limit | `pids.max` for the tree | `RLIMIT_NPROC`, which counts every process of the user |
| CPU limit | `cpu.max` | Refused with `FAILED_PRECONDITION` |
| Open-file limit | `RLIMIT_NOFILE` | `RLIMIT_NOFILE` |
| OOM detection | `EXIT_REASON_OOM_KILLED` from `memory.events` | Never reported |
| Usage | The whole tree, including reparented grandchildren: cgroup CPU time, `memory.current`, `memory.peak` and `pids.current`, while running and at exit | The leader alone: `/proc/<pid>/stat` while running, `wait4` rusage of the leader and its waited-for children at exit |
| Freeze before a snapshot | `cgroup.freeze` | Refused with `FAILED_PRECONDITION` |

### Owning a cgroup

`axed` takes over the cgroup it starts in. It needs:

* cgroup v2 mounted in unified mode at `/sys/fs/cgroup`. A hybrid or v1-only system has no `0::` line in `/proc/self/cgroup`, and cgroups are unavailable.
* To be alone in that cgroup, or to be PID 1. It moves itself, and as PID 1 everything else in the cgroup, into an `axed` leaf so the parent can delegate controllers to one child cgroup per process.
* Write access to the subtree. In Kubernetes that means a writable, delegated cgroup v2 mount in the container.

It enables the `cpu`, `memory` and `pids` controllers that the cgroup offers, one at a time. `axed` logs a controller the kernel refuses, and only limits that need it fail. A kernel without the `cpu` controller, such as a guest kernel built without it, enforces memory limits and refuses CPU limits.

### Other fallbacks

| Feature | Used for | Without it |
| - | - | - |
| `close_range` with `CLOSE_RANGE_CLOEXEC` (Linux 5.11) | Marking descriptors inherited from whatever started `axed` close-on-exec, so supervised processes do not inherit them | Walks `/proc/self/fd` and sets `FD_CLOEXEC` on each. Kernels before 5.11 and gVisor take this path. |
| `/proc` | Tree kill without cgroups, `O_TMPFILE` linking, resolving working directories and watch paths | Required in practice |
| `/etc/passwd` | Resolving a user name in `Spec.user` | Numeric `uid` and `uid:gid` still work. A uid not in the file runs with gid equal to the uid. |

## Privileges

`axed` can run as an unprivileged user; the image runs it as uid 1000. A few operations need more:

| Operation | Needs |
| - | - |
| Stepping the wall clock with `System.Configure` | `CAP_SYS_TIME` |
| Adding entropy with `System.Configure` | `CAP_SYS_ADMIN` |
| Running a process as another user (`Spec.user`) | `CAP_SETUID` and `CAP_SETGID`, or running as root |
| Taking over a cgroup | Write access to the cgroup subtree |

Without them, the call fails and the rest of the daemon is unaffected. Entropy is the exception: without `CAP_SYS_ADMIN`, axed drops the bytes and `System.Configure` still succeeds. `axectl resumed --no-entropy` skips the entropy.

## Limits axed applies to itself

| Resource | Limit |
| - | - |
| Client connections | Half of `RLIMIT_NOFILE` (axed raises its soft limit to the hard limit at startup), between 16 and 65,536, split evenly among the `--listen` endpoints, the `--mcp-listen` endpoints and the REST port |
| Concurrent directory watches, all APIs together | 64. Each holds an inotify instance, and the kernel's per-user inotify limits are shared with everything else in the sandbox. |
| Path depth | 256 components |
| Symlinks followed while resolving one path | 40 |

A recursive watch on a tree larger than the kernel's inotify watch limit reports the subdirectories it could not cover as a non-terminal error and keeps watching the rest.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.