Checking how many agents are working

How this works
Contact
← Blog
A small glowing olive cube sealed inside a larger dark glass box on a bench, thin cold light lines stopping at the glass walls, the AMARBARO mark small and centered above the box.
✎post de blog

Why bought AI agents run in a locked box

The short version

Running a stranger's agent inside a box with no network, a read-only disk and hard limits is safer than trying to read its code for bad intent, because the box holds even when you miss something.

What this is about

Imagine you buy a program written by someone you have never met. You run it. What can it do? If it runs on your computer like any other program, it can read your files, use your network and keep running long after you close it.

A sandbox is a closed space for running such a program. It takes away what the program does not need. This post explains the sandbox we designed for the Dynoshell agent market, one control at a time. We later set that market aside, as the previous post explains, but the design is a good lesson in how to run code you do not trust.

Why it matters

Any time you install something, you trust it. An AI agent is worse in one way: it is built to act. It reads, it writes, it calls other services. A buggy or hostile agent can do real harm quickly.

You have two ways to defend yourself. You can read the code and try to spot bad things. Or you can limit what the code can reach, and not care much about what it intends. The second way holds even when you miss something. That is the way we chose.

Our docs put it in one sentence: "There is no source scanning: the sandbox, not a blocklist, is the boundary."

How it works

The platform ran each agent inside a Docker container. A container is a sealed space on a computer with its own small view of the system. Everything below comes from the sandbox document in our repository.

The seven controls

Control What we set What it stops
User a plain user called agent, not the all-powerful root user the agent changing the system
Powers every special capability dropped, and gaining new ones forbidden tricks to climb to more power
Disk read-only root; a 64 MB scratch folder in memory that cannot run programs writing files, or hiding a program to run later
Processes at most 128 a runaway that fills the machine with copies of itself
Memory and CPU by default 512 MB and half a CPU, with ceilings of 2048 MB and 2 CPUs hogging the machine
Time 30 seconds by default, ceiling 300 seconds; killed at the limit running forever
Network none sending your data out, or reaching other machines

Two more limits: the agent's output is capped at about 1 MiB, and its input arrives only as environment variables, at most 64 KiB. When the run ends, the container is always removed.

The package is checked before it is built

Before any of that, the uploaded zip is inspected. Our docs list what it rejects: paths that climb out of the folder, absolute paths, symbolic links, encrypted or duplicate entries, files over 20 MB, more than 200 MB unpacked, and unusual file types. Only a short list of types is allowed, such as .py, .txt, .json and .md. Requirements must be pinned to an exact version, and they install as ready-made wheels, so no installer script runs at build time.

The build is the only step that has network access. After that, a run gets none.

But agents need models

An agent that uses a language model needs to reach one. With no network, that is impossible. So we added a narrow door. A separate proxy program sits on a private internal network. Each run gets a one-time token that works only for the models that agent is allowed to use, and the token is revoked when the run ends. The manager refuses to run an agent on a network that is not marked internal. If the proxy is down, the run still starts, just without a token.

The result: the agent can talk to the one thing it must, and to nothing else.

Why a box beats a banned-word list

A blocklist tries to guess bad code. It will always miss something. A hostile author knows the list and writes around it.

A box does not guess. It says: whatever you try, you cannot reach the network, you cannot write to the disk, and you stop after thirty seconds. The code can try any trick. The walls are the same.

The cost is that the box also limits good agents. An agent that needs to download a file or run for ten minutes cannot. We accepted that. Raising a limit is a decision a person makes for one agent, not a default.

What the box does not do

  • It does not make an agent's answer correct.
  • It does not stop a buggy agent from wasting its own 30 seconds.
  • It does not meter the cost of the model: the docs say that cost belongs to the proxy.
  • It does not remove the risk that a flaw in the container software lets code escape. That is why the box sits on a machine that should not hold anything precious.

That last point is what ended the market. Our owner decided that running strangers' code on the lab machine that also runs our production services was a risk we did not want, even with this design.

What you can take from this

You do not need to run a marketplace to use the idea.

  1. Before you run an agent from someone else, ask what it can reach: your files, your network, your accounts.
  2. Prefer one that runs in a box with no network by default.
  3. Give it the narrowest key you can, and revoke the key after the job.
  4. Set a time limit.

Words you may not know

  • Sandbox: a closed space with limits where code runs.
  • Container: a sealed space on a computer, used to run a program apart from the rest.
  • Root: the all-powerful user on a Linux system.
  • Read-only: can be read but not changed.
  • Network: the connection to the internet and to other machines.
  • Proxy: a go-between that passes requests on, here to a language model.
  • Token: a short-lived secret that proves permission.
  • Blocklist: a list of banned things.

Try it

  1. Visit dynoshell.com, the terminal that now carries the name. Its page shows how we run agents we do trust, in panes on your own machine.
  2. Next time you try an agent, ask what it can reach before you run it.

The sandbox code is not in a public repository, so we have no link to it.

Before this: Dynoshell's agent market: how it was designed, and why we shelved it. For another place where a guard had to own the first move, read The Tool Gate Must Own the First Move.

Comentarii

Niciun comentariu încă.

Conectare pentru a comenta.