# OsBox

> One MCP setup for every AI tool: servers pinned to an accepted version and hash, keys from OsVault, accepted in the dashboard, run in a sandbox.

Source: https://osevel.com/docs/products/osbox/

OsBox is one place for your MCP servers. You add a server once; each AI tool on the computer
gets a single `osbox` entry and sees the same servers through it. Every server is pinned to the
version and hash you accepted, takes its keys from [OsVault](https://osevel.com/docs/products/osvault/), and runs in the
operating system's sandbox on macOS and Linux.

- [What it protects against](#what-it-protects-against)
- [Set up](#set-up)
- [Adding a server](#adding-a-server)
- [Accepting](#accepting)
- [How it works](#how-it-works)
- [Pinning](#pinning)
- [The sandbox](#the-sandbox)
- [Remote servers](#remote-servers)
- [Servers from a repository](#servers-from-a-repository)
- [With the Osevel service](#with-the-osevel-service)
- [With the other Os products](#with-the-other-os-products)
- [Limits](#limits)

## What it protects against

- **A server that changes after you trusted it.** `npx -y some-server` runs whatever is newest
  today. With OsBox a new version, a changed file or a changed tool description does not reach
  your agents until you accept it.
- **Keys in config files.** Tool configs hold API keys as plain text. In OsBox a server's keys
  are names that point to OsVault secrets, never values.
- **An agent adding a server for itself.** Accepting a server is done in the dashboard, signed
  with your account key. Typing in a terminal does not accept.
- **A hostile repository.** A cloned repository's servers run nothing until you accept them on
  this computer.
- **A server that reads what it should not.** In the sandbox a server reads, writes and
  connects only where its accepted declaration says.
- **The same setup in every tool, by hand.** One entry per tool replaces a server list per tool.

## Set up

```bash
npm i -g @osevel/cli
```

Link the computer to your account, so that acceptances are made in the dashboard and keys come
from your vault (see [OsVault](https://osevel.com/docs/products/osvault/#set-up)):

```bash
npx @osevel/cli vault connect --server https://<your dashboard>
```

See what your tools already have:

```bash
osevel box import
```

lists the servers already in your tools, the keys that sit there as plain text (names only), and
the `osevel box add` command for each. Save those keys in OsVault first (dashboard → Vault → add,
or paste as `.env`). Rotate keys that sat in plain text: copies may remain in the tools' own
backups and in editor history.

Then connect the tools:

```bash
osevel box connect
```

writes the one `osbox` entry into each tool it finds: Claude Code, Claude Desktop, Cursor, VS
Code, Windsurf, Gemini CLI, Codex and OpenCode. It shows each change, asks a yes per tool and
keeps a backup first. Name tools to connect only those (`osevel box connect cursor`). Where a
file cannot be edited safely, the entry is printed for you to add by hand.

`osevel box import --remove` replaces the entries of servers that are now in the box.
`osevel box disconnect` puts each tool's file back.

```bash
osevel box
```

shows the box: each server, its source, whether it is accepted here, and what waits.

## Adding a server

```bash
osevel box add @modelcontextprotocol/server-github@1.4.2 --key GITHUB_TOKEN
```

The source is one of:

| Source                     | Example                       | What is pinned                               |
| -------------------------- | ----------------------------- | -------------------------------------------- |
| An npm package             | `name@version`                | The whole lockfile and every installed file  |
| A command on this computer | `/absolute/path/to/server`    | The file's hash; it runs from a private copy |
| A remote server            | `https://mcp.example.com/mcp` | Its address and its sign-in provider         |

Without a version, the newest one is looked up once and fixed. npm packages are installed from
the public registry with install scripts off.

| Option                 | Meaning                                                                                                   |
| ---------------------- | --------------------------------------------------------------------------------------------------------- |
| `--name <name>`        | The server's name in the box.                                                                             |
| `--key NAME`           | Give the OsVault secret `NAME`. `--key NAME=SECRET@vault/env` picks another secret, vault or environment. |
| `--env NAME=value`     | A plain setting. A value that looks like a secret is refused.                                             |
| `--arg <arg>`          | An argument for the server.                                                                               |
| `--bin <name>`         | Which program of an npm package to run.                                                                   |
| `--allow-read <path>`  | A folder the server may read.                                                                             |
| `--allow-write <path>` | A folder the server may write.                                                                            |
| `--allow-host <host>`  | A host it may connect to (`*.example.com` for subdomains).                                                |
| `--no-sandbox`         | Run without the sandbox. The dashboard shows a red warning before you accept.                             |
| `--declare <what>`     | `sampling`, `elicitation`, `roots` or `dynamic` (see [pinning](#pinning)).                                |

`osevel box remove <name>` takes a server out. `osevel box install <name>` installs it again;
it then needs accepting again.

## Accepting

A server runs only after you accept it:

```bash
osevel box accept github
```

- **Computer linked to an account:** the request goes to the dashboard. The page shows the
  server, what it runs, its keys (names only), its settings, what it may touch, and the findings
  of the checks. You sign with your account key. The computer verifies that signature against
  the account it saw when it was linked.
- **Not linked:** a 6-digit code appears in a window of its own and you type it back in the
  terminal. This is weaker, and the CLI says so.

Accepting covers the server and then, after it started once, its lists of tools, prompts and
resources. The request and the answer are sealed end to end between the computer and your
browser. Osevel's cloud sees that a computer asked, when, and whether you accepted or declined;
not which server.

**Checks shown before you accept** (best effort, never the only defence): hidden characters in
descriptions, text that addresses the model ("ignore", "do not tell the user"), mentions of
other servers' tools, URLs and file paths in descriptions.

## How it works

1. Each tool starts one MCP server, the gateway: `osevel box mcp`.
2. The gateway starts only accepted servers whose install still matches its pin. Each starts in
   its own folder with a clean environment: its settings and its keys, nothing else of yours.
3. Keys come from OsVault. Plain keys are masked in everything the agent reads. Locked keys are
   given as stand-ins and put in by the proxy, so the server never holds them.
4. Tools are passed through with the server's name in front: `github__create_issue`. A server
   cannot use `__` in its own names, so it cannot pass as another server's tool.
5. Every list a server shows is compared with its pin before it is passed on.

The agent sees ordinary MCP tools. Calls are not approved one by one. Tool calls and their
answers stay on the computer.

## Pinning

When something differs from what you accepted:

- **A changed install** (a package or a file changed on disk): the server does not start.
- **A changed tool, prompt or resource:** the unchanged ones keep working. The changed and new
  ones are held, and calling one answers "held: waiting for the owner to accept a change", so
  the agent can tell you. `osevel box accept <name> --lists` accepts them after a look.
- **Changed server instructions:** the whole server is closed until you accept.
- **A server whose tools change by design:** accept it with `--declare dynamic`. New tools then
  pass; changed ones are still held.

## The sandbox

On macOS and Linux every server runs in the operating system's sandbox unless you accepted it
with `--no-sandbox`. Windows has no sandbox yet.

- **macOS (Seatbelt):** deny by default. The server reads the system's own files, its runtime,
  its install and what it declared. It writes to a temporary folder of its own and what it
  declared. Only its own program may run. Its only way to the network is a local proxy that
  lets declared hosts through, on ports 443 and 80.
- **Linux (bubblewrap):** only the system folders, the runtime, the install and the declared
  paths are mounted. There is no network. A sandboxed server that declares hosts is refused
  for now, because bubblewrap cannot limit it to those hosts. Without `/usr/bin/bwrap`, a server
  runs only when accepted as unsandboxed.
- **Windows:** no sandbox. Servers run only when accepted as unsandboxed.

`/`, the whole home folder and folders above it are refused as declared paths. The dashboard
warns about paths that hold keys or start programs (`~/.ssh`, `~/.aws`, shell start-up files).

## Remote servers

```bash
osevel box add https://mcp.example.com/mcp
```

```bash
osevel box login example
```

`login` signs in once in your browser (OAuth with PKCE). The sign-in provider first seen for a
server is the only one accepted later. A remote server's lists are pinned and held like any
other's.

## Servers from a repository

A repository can ask for servers in the `box` section of its `osevel.yaml`. The file holds no
values: key labels only.

- A fresh clone runs nothing. `osevel box repo` shows what the repository asks for.
- `osevel box repo map <label> <SECRET>` maps one of its key labels to your own OsVault secret.
- `osevel box repo install <name>` installs a server; `osevel box repo accept <name>` accepts it.
- An acceptance is bound to the repository's real path and the digest of that section. A copy
  elsewhere, an edit of the section or a new key mapping asks again. Reformatting does not.
- If a repository's server has the name of one of yours, yours is kept.
- Repository servers are npm packages or absolute commands.

## With the Osevel service

With the Osevel service installed and the computer linked through it (daemon mode on macOS and
Linux, see [security](https://osevel.com/docs/security/model/#two-modes-unisolated-and-daemon)), OsBox runs there:

- The service keeps the box, every server's records and the account it trusts, in a folder only
  its own system user reads.
- Installs go to a shared folder that you and your tools can read and run, but not change.
- Your CLI only asks. The service creates the dashboard request, verifies your signature and
  records it. Nothing is recorded that the service did not verify itself.
- OAuth tokens of remote servers stay in the service.

Without the service, the box is kept in your own folder. See the first limit below.

## With the other Os products

- [OsVault](https://osevel.com/docs/products/osvault/) holds every server's keys and runs the proxy for locked ones.
- [OsMemory](https://osevel.com/docs/products/osmemory/) is served by the gateway as a built-in server. Its tools appear as
  `memory__recall`, `memory__remember` and `memory__forget`, with no extra entry in any tool.
- [OsBrain](https://osevel.com/docs/products/osbrain/) is asked before each tool call the gateway forwards. One of your rules
  can hold or refuse it.
- [OsApi](https://osevel.com/docs/products/osapi/) knows the tool names of the providers' own MCP servers.

## Limits

- **Without the Osevel service, acceptances are advisory against a program running as you.** It
  can edit the box's files, the installed copies and the link file. The boundary (only your
  account signs, in the dashboard) holds with the service.
- **The tools' config files are yours.** A program running as you can make a tool start
  anything, bypassing OsBox. OsBox protects the accepted set, the installs and the keys.
- **A repository can ship the tools' own project files** (`.mcp.json`, `.cursor/mcp.json`).
  Those are covered by each tool's own trust prompt, not by OsBox.
- **Pinning stops a changed server, not one that was bad from the start.** That is what the
  sandbox is for, and an unsandboxed server reads whatever your own processes can.
- **Sandbox gaps:** a file's existence and size can be learned anywhere; a server that starts
  other programs needs `--no-sandbox`; on Linux declared hosts cannot be enforced; Windows has
  no sandbox and no service.
- **A command is pinned by its own file**, not by the interpreter or what it loads.
- **An old acceptance cannot be revoked yet.** Remove the server instead.
- **A tool call held by an OsBrain rule does not run.** Tool calls are not approved one by one.
- **Not built:** the same box synced to your other computers (each computer adds and accepts
  its own servers today), team boxes, a catalogue of servers, Python packages and Docker images
  as sources, and web tools that cannot reach a local server (ChatGPT, claude.ai).
- **Not tested end to end:** remote servers through the Osevel service.

Related: [OsVault](https://osevel.com/docs/products/osvault/), [OsMemory](https://osevel.com/docs/products/osmemory/), [OsBrain](https://osevel.com/docs/products/osbrain/),
[security model](https://osevel.com/docs/security/model/).
