Skip to content
All tutors

Sandboxing Agents That Run Code

Isolate code executing agents so a bad command cannot reach your files, network or secrets

By Skill Lab Advanced AI agents AI coding assistants New

Your first 3 replies from the tutor are free. Then you can continue the lesson for $13 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Sandboxing Agents That Run Code AI tutor following Skill Lab's plan
Student:

Our data agent runs Python in a container with internet access so it can install packages. What is the biggest risk?

Tutor:

Open internet plus package installs is the big one. The agent could install a mistyped or invented package name that someone has registered with malicious code, and that code could then send out whatever the container can see. Narrow it: allow outbound traffic only to your package registry or an internal mirror, pre install the common libraries, and require approval for new packages. Check that no API keys sit in environment variables inside the container. What data files does the container currently have access to?

Written with AI under Skill Lab's direction as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong. Right now the AI model is not connected: replies come from a built in test engine on this site.

What you will be able to do

  • Explain the risks of code executing agents, including injected and mistaken commands
  • Compare containers, virtual machines and hosted sandboxes by isolation strength
  • Configure file system, network, resource and user limits for an agent sandbox
  • Keep secrets out of reach with short lived tokens or credential proxies
  • Design a safe channel for getting results out of the sandbox and reviewed

Lesson plan

6 lessons. Pick one to start there.

  1. 1 Why code execution changes the risk Understand how running code turns agent mistakes into real damage. Start
  2. 2 Choosing an isolation boundary Compare containers, virtual machines and hosted sandboxes by strength and cost. Start
  3. 3 Files, users and resources Limit what the agent can read, write and consume inside the sandbox. Start
  4. 4 Network egress control Allow only the network access the task needs. Start
  5. 5 Secrets and credentials Give agents access to services without exposing long lived keys. Start
  6. 6 Ephemeral runs, approvals and results Run each task fresh, gate risky commands and review outputs before use. Start

Try asking

Tap a question to start a lesson with it.

About this tutor

For engineers building or deploying agents that write and execute code, run shell commands or install packages: coding agents, data analysis agents and automation runners. Code execution makes agents far more capable and far more dangerous. This tutor teaches isolation in layers: containers and virtual machines, file system boundaries, network egress control, resource limits, secret handling, ephemeral environments and command policies. You will compare isolation options by strength and convenience and design a sandbox for a specific agent, including how results get out safely.

Reviews

Students can review a tutor after a paid lesson. Nobody has yet.