AI Infrastructure & Runtime

Isolated AI Workloads: Running AI Employees in Sandboxes

What isolated AI workloads actually protect against when an AI employee writes and runs its own code, and what isolation does not cover.

By Hitank Shah • 6 min read • Updated 2026-11-30

Direct Answer (Quick Summary)

Isolated AI workloads run the code an AI employee writes inside a container that cannot reach the network, other runs or the host. In OneCo each run gets its own sandbox with Python and Node, a read-only system, no network and resource limits. Isolation contains code; it does not govern what the employee does through its connected tools.

Key Takeaways

  • An AI employee that writes and runs code is running instructions that may have come from something it read, so the place it runs must assume hostile input.
  • Isolation should be per run, not per organisation: two runs in one workspace should never share a file system.
  • A sandbox with no network cannot exfiltrate data or reach internal services, even if a command tries to.
  • Isolation contains what code can do; it does nothing about what the employee does through its connectors, which is the job of approvals and policies.

Isolated AI workloads are what you need the moment an AI employee is allowed to write a script and run it. That script was written by a model, and the model may be following instructions it picked up from a web page, a document or an email it was asked to read. You cannot review every command before it runs, so the place it runs has to be built on the assumption that some command, some day, will try to do something you did not ask for.

This post describes how OneCo isolates the work an employee does, the mistake we made on the way, and the limits of isolation that are easy to forget.

What an AI employee's workspace is for

Most useful AI work involves files. Clean a spreadsheet, chart last quarter's numbers, convert a CSV, check a dataset for duplicates. In OneCo, each run gets a workspace where the employee can do that with real tools: Python 3.12 with numpy, pandas, matplotlib and openpyxl, Node 20, and the usual shell utilities. The files it saves there, such as outputs/chart.png, become the run's files, which you can download or export.

Everything is installed when the image is built. That decision came from an actual failure: our first workspace was a bare base image with no Python, and because it has no network, "write a Python script and run it" could never work and installing packages at run time was refused. The fix was not to open the network. It was to put the tools in the image.

How isolated AI workloads are built in OneCo

Each run's workspace is a Docker container started with a deliberately small set of permissions:

SettingWhat it means
No networkThe container cannot reach the internet, the server's internal services or the cloud metadata endpoint
Read-only systemOnly the workspace folder and a small temporary area can be written to
No capabilities, no privilege escalationRoot-level kernel powers are dropped, and a process cannot gain new privileges
Non-root userCommands run as an ordinary user, not root
Process limitAt most 256 processes, so a fork loop cannot take the host down
Memory and CPU capsA default of 512 MB of memory and half a CPU per run
Disk limits2 GB per workspace and 1 GB per file; output is cut off at 10 MB

The worker talks to the container with docker exec, which needs no network, so removing the network costs the employee nothing it legitimately needs. We tested what a container on an ordinary bridge network could reach and it could see the server's SSH, Redis and the cloud metadata service. That is why "no network" is not optional. Docker documents the flags behind most of this in its guide to running containers and its resource constraints page.

Idle containers are removed after a few minutes, and the workspaces of finished runs are cleaned up on a schedule. Files you want to keep are the run's saved files, not the container.

The mistake: isolating by organisation instead of by run

Our first version kept one container per organisation. It seemed reasonable: one customer, one sandbox. But the container's workspace folder was fixed when the container was created, to the first run's folder. A second run in the same organisation reused the container and inherited the first run's files. Same customer, different employees, different goals, and one run could read and write another's workspace.

It looked like correct per-tenant isolation, and it was a cross-run leak. The fix was to key the sandbox on the run, so every run gets a container whose workspace is its own. The general lesson: the unit of isolation should be the smallest unit of work that should not see another's data. For AI employees, that is the run, not the account.

Tenant isolation is a different layer

Workload isolation is about what code can do while it runs. Tenant isolation is about whose data is whose at rest. In OneCo every row in the database carries the organisation it belongs to, and row-level security in the database enforces that. Credentials for connectors are encrypted at rest, and secrets are redacted before tool input is logged or passed to the decision layer.

You need both. A perfectly sealed container does nothing if the API returns another workspace's runs, and perfect row-level security does nothing if a script can reach the database host. For the access side of this, see AI access control: what enterprises need to know.

What isolation does not protect against

This is the part sales pages leave out. A sandbox contains code. It does not contain the employee.

  • Connected tools act outside the sandbox. If an employee has a Gmail connector, it can send email whether or not its sandbox has a network. That is governed by approvals, run authority and policies, not by the container. Under Ask, every external write waits for a person. See what infrastructure AI employees need for how those layers fit together.
  • The model provider sees what the employee sends it. With bring-your-own-key, the data in a prompt goes to the provider you chose, under your agreement with them.
  • The browser is a separate tool. An employee that browses the web does so through the browser tool, not the workspace, and submitting a form there counts as a write and is gated like one.
  • A container is not a virtual machine. Containers share the host kernel. Dropping capabilities and running as non-root narrows that surface a lot; it does not remove it. If your threat model requires hardware-level separation, ask about it before you buy, from us or anyone.
  • Bad output is still bad output. A sandbox stops a script from deleting the host. It does not stop it from producing a wrong spreadsheet. That is what completion checks and review are for.

A worked example

Here is what a sandboxed data task looks like from the OneCo screens.

  1. Upload the input. Start a goal and attach last quarter's sales export.
  2. Name the output in the goal. "Clean the duplicates, chart revenue by region and save outputs/revenue.png and outputs/clean.xlsx."
  3. Watch the steps. On the run's live page you see the employee write a pandas script and run it. A command that deletes files in the workspace is treated as a deletion and asks first unless you allowed it for this run.
  4. Hit a wall safely. If the script tries to download a package or call an API, it fails: there is no network. The employee has to work with what is installed, which is almost always enough for this kind of job.
  5. Collect the files. The two outputs appear in the run's files. If either is missing or empty under Full autonomy, the run goes to review rather than closing as done.
  6. Nothing lingers. The container goes away once idle, and the finished run's workspace is cleaned up later.

Trade-offs

No network is a real restriction. An employee cannot pip install a library we did not include, and a task that genuinely needs a niche package will fail. We chose that over opening the network, and we add libraries to the image when there is a clear need. The resource caps mean very large datasets will not fit in one run. And per-run containers start slower than a warm shared one; that is a cost we accept for not leaking files between runs. For the runtime behind all this, see building an AI employee runtime and AI employee execution infrastructure.

Frequently Asked Questions

Can an AI employee's code reach the internet in OneCo?

No. The workspace where an employee runs commands has no network at all. It cannot download packages, call APIs or reach internal services. The tools it needs, including Python 3.12, common data libraries and Node 20, are installed in the image ahead of time.

Do two runs in the same workspace share files?

No. Each run gets its own container and its own workspace folder. An earlier design shared one container per organisation, which let runs see each other's files; we changed it so isolation is per run.

Does sandboxing stop an AI employee from sending a bad email?

No. The sandbox contains code. Email, CRM updates and other external actions go through connectors, which are governed by approvals, run authority and policies. Under the default authority, every external write waits for a person.

Related reading