# omabox safety: not a security boundary, and what it holds

This is https://omabox.app/safety as Markdown, for agents. Every page: https://omabox.app/llms.txt

**Not a security boundary. Here's exactly what it holds.**

omabox keeps an agent's windows, input and prompts off your desktop. It does not fence the agent in: a box shares your kernel, your GPU and, by default, your network, and what the agent runs on your host isn't boxed. This page is what a box can touch, what it can't, and how to fence the agent too.

## What a box can touch.

A box gets enough of your setup to look and behave like your desktop. Here is all of it.

### Your files

The repo you start it from, **read-only** at the same path (from a git worktree too, so git works there), and the folders you `--ro-bind`. Also mise's toolchains, your fonts and git's name and email. Nothing else of your HOME.

Refused whatever you pass: HOME itself, the secret stores (`~/.ssh`, `~/.gnupg`, keyrings, `~/.aws`, `~/.kube`, `~/.docker`, `~/.git-credentials`…), the coding agents' own config (`~/.claude`, `~/.codex`…), browser profiles, and anything of `~/.config/omarchy` but its plugins and themes.

### Its HOME

Fake: seeded with your theme and shell settings and nothing secret (no API keys, keyrings or tokens). `omabox down` deletes it, with whatever a plugin or app changed there.

A link in it that leads into your HOME, to a file you can write, into your runtime dir or through `/proc` is removed, in a restored save or seed too, and omabox never reads a box's files through a link.

### Its session

A private session bus, its own accessibility bus and a throwaway keyring that stores and reads secrets without prompts. No system bus, no real input devices, no audio unless `--audio` (then its own PipeWire, never yours).

`/usr`, `/etc` and `/sys` are read-only, with no `sudo`, pacman or polkit: nothing in a box installs packages, system config or rules. It can't see your host's processes.

### Its network

Every box has one of its own. By default (`--net connected`) it reaches the internet, your LAN and your host's servers. With `--net isolated` it has a loopback and the ports you `--allow`, nothing else. `--net host`, only when you name it, is your host's network itself, for a tool that scans your LAN; not for code you don't trust.

What reaches outside (API calls, uploads, changes to a server) is real, and `down` doesn't undo it.

```
$ omabox up --net isolated --allow 8081
```

## Your seat stays yours.

A box's Hyprland never gets what drives your screens and reads your hands. That is what keeps it off your real displays.

### Never in a box

- `/dev/dri/card*`: it gets a render node, never a display card
- `/dev/input`: your keyboard and mouse
- seatd, and the system bus
- Your `$XDG_RUNTIME_DIR`: its runtime dir is one of its own

### An interactive box

A box you drive as a window (`omabox up --interactive`) holds one already-open connection to your compositor, never its socket, so nothing inside can open a window on your desktop. Keys go the other way: what you type into its window, the box reads.

## The guard catches mistakes. It is not a fence.

The skill is advice: an agent that doesn't think of `./build/tests/tst_x` as GUI work still opens its windows on your desktop, because its shell holds your real display. The guard (opt-in; Claude Code and Codex, or any agent through `guard exec`) gives agents' shells a display that doesn't exist, so that fails instead.

```
$ omabox guard on              # every installed agent (or: on claude | on codex)
$ omabox guard off             # each file back as it was
$ omabox host -- CMD           # from a guarded shell: one command on your desktop, when you asked
$ omabox guard exec -- AGENT   # any other agent, started under the guard
```

### What it stops: Accidents

- A stray window, `hyprctl` or `grim`: it fails with an error the skill explains
- Omarchy's theme, wallpaper and font commands (`omarchy-theme-set` and the rest), refused by name
- A link the agent opens: refused, with a note to give you the link, instead of landing in your browser
- `quickshell kill`, `qs ipc` and `hyprctl -i`, which reach your shell or your Hyprland without a display
- Work on your real desktop goes through `omabox host`, named on stderr, on the record

### What it doesn't stop: An agent that means it

- An agent that sets the variables back, or runs `omabox host` unasked, on purpose
- Processes it starts outside its shell: a headed browser MCP opens on your desktop
- Writes to the files your shell watches (`shell.json`, `plugins/`): they change your real bar at once
- Omarchy's own `omarchy` command (`omarchy theme set`…), and anything over the session bus
- Under Codex, the stand-ins above: it gets the variables only, unless you start it with `omabox guard exec -- codex`

Everything it sets for each agent, and the full list: [docs/guard.md](https://github.com/diogochaves/omabox/blob/main/docs/guard.md). For a fence, run the agent in [ai-jail](https://omabox.app/safety#ai-jail).

## Name the ports a box must not reach.

A connected box reaches your network and your host's servers, like any app. If a database or an admin panel listens on your machine, protect its port.

```
$ omabox config protect-ports 5432,8080
```

No connected box reaches those ports, on loopback or through any of your host's other addresses (a Docker bridge, a VPN), TCP or UDP. None are protected by default; it needs nftables.

An address your host gains after a box started is not covered, and a `--net host` box doesn't start while a port is protected. It's still not a security boundary: for a box with no network but the ports you choose, use `--net isolated --allow`.

```
$ omabox up --net isolated --allow 8081
```

## Ten rules, each with the code that holds it and the test that proves it.

omabox promises one thing: a box never reaches your real desktop. SECURITY.md lists each rule behind that promise, from "Hyprland never gets your seat" to "a connected box reaches no protected port", where omabox enforces it, and which test proves it. They keep a box from reaching your desktop by mistake or through an app that misbehaves. They are not a defence against code written to escape: **a box is not a security boundary.**

1. [**S1** · Hyprland never gets your seat.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
2. [**S2** · The box HOME is fake and holds no secrets.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
3. [**S3** · Secrets and live sockets are never mounted or copied in.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
4. [**S4** · Host code is read-only.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
5. [**S5** · Each box has its own namespaces and network.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
6. [**S6** · Teardown kills the box and nothing else.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
7. [**S7** · The tools that drive a box never follow it out.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
8. [**S8** · Input never reaches your desktop.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
9. [**S9** · An agent in ai-jail drives only its own boxes, and gets no more than its jail.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)
10. [**S10** · A connected box reaches no protected port.](https://github.com/diogochaves/omabox/blob/main/SECURITY.md#the-rules)

[Read SECURITY.md](https://github.com/diogochaves/omabox/blob/main/SECURITY.md) · [Report a way around one (privately)](https://github.com/diogochaves/omabox/security/advisories/new)

## Since 1.0: Rewritten in Rust, and tighter for it.

1.0 made omabox one Rust binary, and each release since has closed more ways for a box to reach what is yours. A few of them:

### Your terminal stays yours

A command in a box runs in a session of its own, with no controlling terminal: it can't read what you type, write to your terminal or signal it. Ctrl-C still reaches it.

### Its display, and only its display

`omabox env` and `peek` name the box's Wayland socket through a hard link the box can't swap, so a host tool never lands on another display.

### No link leads out

What a box writes in its HOME is read by a file omabox opened beneath it, never through a link; shots and recordings are written through none. A link, FIFO or `/dev/zero` planted in their place is refused (1.5.2).

### Nothing half-done

Stop omabox at any step, with Ctrl-C or a signal, and it undoes that step: an interrupted `up` takes its box down, a recording keeps the video so far.

### No crash notifications from a box

The tools omabox runs against a box (grim, hyprctl, gdb) get the box's crash limits, so a crash in one doesn't reach your desktop's notifications.

### Faster in

~3 ms

omabox enters a box itself, without nsenter: `omabox run -- true` in about 3 ms (measured at 1.0).

## ai-jail fences the agent in. omabox keeps its windows out.

To limit what the agent itself can read, write and reach, run it in [ai-jail](https://aijail.io). The two stack: an agent inside ai-jail still drives boxes of its own.

ai-jail decides what the agent can touch. omabox decides where it draws.

## Two questions, two tools.

[ai-jail](https://aijail.io), by Fabio Akita ([AkitaOnRails](https://github.com/akitaonrails)), is the sandbox we point people to. It runs an agent inside bubblewrap, Landlock and seccomp on Linux, and `sandbox-exec` on macOS. It does carefully the one thing omabox doesn't do: limit what the agent can read, write and reach.

ai-jail answers: what can it touch?

### A fence around the agent

- Your project read-write at its real path, `/usr` read-only
- A fresh home: no `~/.ssh`, `~/.aws`, `~/.gnupg` or browser profiles
- The environment cut to an allowlist, so your tokens stay in your shell
- The network cut to what you allow: since ai-jail 2.8, a bare `ai-jail claude` reaches its model's API, and in 3.x what the project's first run allowed (package registries, say)

[aijail.io ↗](https://aijail.io) · [github.com/akitaonrails/ai-jail ↗](https://github.com/akitaonrails/ai-jail)

omabox answers: where does it draw?

### A desktop of its own

- Its own screen, pointer and keyboard
- Its own session bus, tray, notifications and keyring
- Your cursor, focus and workspaces untouched
- Not a security boundary: that part is ai-jail's

[How a box keeps off your desktop →](https://omabox.app/how-it-works)

## Two recipes, both tested.

Neither needs a change to ai-jail.

### A jailed app, drawn in a box

A contributor's branch, an app you just downloaded: run it in ai-jail, with the box's screen as its only display. ai-jail keeps it out of your home, keys and network; its window opens in the box, where `omabox shot` and `peek` see it.

```
$ omabox up
$ eval "$(omabox env)"   # Wayland clients now draw in the box
$ ai-jail --gpu --rw-map "$WAYLAND_DISPLAY" \
    --env WAYLAND_DISPLAY -- ./build/app
```

Tested with ai-jail 3.3.0 and omabox 1.5.3 on Linux, and before that with ai-jail 2.2.1, 2.6.2, 2.8.1, 2.10.0 and 2.12.0.

### A jailed agent, driving boxes of its own

A jail can't start a box itself (its seccomp filter refuses new namespaces), so its `omabox` hands each command to a broker outside. Turn it on once, add the `ro_maps` it prints to ai-jail's global config (`~/.config/ai-jail/config.toml` since ai-jail 3.0), then start your agent in ai-jail as usual.

```
$ omabox broker on   # prints the ro_maps to add
$ ai-jail claude
```

Tested with ai-jail 3.3.0 and omabox 1.5.3 on Linux, and before that with ai-jail 2.2.1, 2.6.2, 2.8.1, 2.10.0 and 2.12.0. `omabox broker off` turns it off.

On Omarchy 4.5, `claude` and `codex` are mise wrappers, and ai-jail 3.3 maps mise's data folder read-only, so the agent stops at `Read-only file system`. Until ai-jail lets mise take its lock, give the jail a copy-on-write one:

```
$ ai-jail --mise --overlay-map ~/.local/share/mise claude
```

## What a jailed agent can and can't do.

Driving a box is running code in it, so the broker is what keeps a box from being a way out of the jail. It reads the jail's limits from the jail's own command line, which nothing inside can change, trusts only an ai-jail running in its own namespaces (a binary named ai-jail inside a jail never counts), and gives each box no more than the jail has.

### In the jail, as outside

- `up`, `run`, `shot`, `keys`, `click`, `wait` and the rest
- `record`: the video, its marks and captions land in the jail's project, written by the agent's own `omabox`
- `ports`, for its own boxes: a port held by anything else is said to be taken, without naming who holds it
- git in a box started from a worktree

### Not from a jail

- `omabox host`, which runs on your real desktop
- `peek` and interactive boxes, which open on your screen
- `up --net host`, and a copy of your own desktop (`--desktop desk`)
- The guard and `config` changes; which host ports you protect isn't shown to it
- Boxes you or another jail started

**Its network**

None when the jail has none: its boxes start `--net isolated`. With ai-jail's default proxy, the agent reaches its model's API and its boxes still get no network.

**Its project**

Only the jail's own project goes into a box, and what the jail hides in it (its `.ai-jail` included) stays hidden there too.

**Its boxes**

Only the boxes that jail started, and they go down when the jail exits.

The rule for jailed agents and the test behind it are S9 in [SECURITY.md](https://github.com/diogochaves/omabox/blob/main/SECURITY.md); the details are in [docs/ai-jail.md](https://github.com/diogochaves/omabox/blob/main/docs/ai-jail.md).

**For code you don't trust at all, use a VM.** A box and a jail both share your kernel.
