Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Infrastructure for Agents

Free · sign in to start and track progress

1 · Compute and execution

  • 1Where agents run
  • 2Sandboxes for agent code

    Exercise answers

    • Answer: Build and attack a local code runner
    • Answer: Egress allowlists and credential brokering in a microVM
  • 3Durable execution engines
  • 4Queues, schedules and background jobs

2 · State, access and delivery

  • 5State, sessions and checkpoints
  • 6Secrets, identity and tenant isolation
  • 7AI gateways
  • 8Environments and delivery for agents
CapstoneA production platform slice for one agentReference implementation

Module 1 · Compute and execution · Lesson 2

Sandboxes for agent code

When an agent writes and runs code, that code is untrusted. The isolation spectrum from containers to gVisor to Firecracker microVMs, the sandbox products AI builders use, and how to set lifecycle, egress and credentials.

75 min 2 videos 3 exercises 7-question quiz Answers
Setup for the exercises:Install Claude CodePython with uvDocker and Docker ComposeDeploy to Vercel

By the end of this lesson you can

  • Threat-model model-written code in terms of host escape, data exfiltration and resource exhaustion
  • Explain how containers, gVisor and Firecracker microVMs isolate code, and what each costs in startup time and attack surface
  • Compare Vercel Sandbox, E2B, Daytona and Modal Sandboxes on isolation, lifecycle, persistence and egress control
  • Run model-written Python in a sandbox with deny-by-default egress, resource limits and validated output
  • Choose a sandbox lifecycle (per call, per session, per case) and cost it

On this page

  • Intuition: the photocopier room
  • Threat model: what model-written code can do
  • The isolation spectrum
  • The products
  • Running model-written code safely
  • Lifecycle and cost
  • Worked example
  • Misconceptions and limits
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: the photocopier room
  2. 02Threat model: what model-written code can do
  3. 03The isolation spectrum
  4. 04The products
  5. 05Running model-written code safely
  6. 06Lifecycle and cost
  7. 07Misconceptions and limits
  8. 08Connections
  9. 09Summary

Sources & further reading

  • Firecracker: Lightweight Virtualization for Serverless ApplicationsPaper · Agache, Brooker, Florescu, Iordache, Liguori, Neugebauer, Piwonka, Popa · Amazon Web Services · 2020The NSDI '20 paper behind the microVMs that Vercel Sandbox and many agent sandboxes use. Read sections 2 and 3 for why containers and full VMs were both rejected, and how a minimal device model keeps the attack surface small.
  • Quantifying Frontier LLM Capabilities for Container Sandbox EscapePaper · Marchand, O Cathain, Wynne, Giavridis, Jennings et al. · 2026SandboxEscapeBench, an open capture-the-flag benchmark for whether models with shell access can escape Docker/OCI containers. The finding that matters here is that models find and exploit misconfigurations and vulnerabilities when they exist.
  • Beyond permission prompts: making Claude Code more secure and autonomousLab research · Anthropic · 2025Why effective sandboxing needs both filesystem and network isolation, how Claude Code uses bubblewrap and seatbelt plus an egress proxy, and the 84% reduction in permission prompts it measured.
  • Securely deploying AI agentsLab research · AnthropicA comparison table of isolation technologies (sandbox runtime, containers, gVisor, VMs) with overheads, a hardened docker run configuration, and the proxy pattern: credentials injected outside the agent's boundary.
  • Vercel SandboxDocs · VercelFirecracker microVM isolation, images, persistent sandboxes and snapshots, the Python SDK and network policies with credential brokering. Read the pricing page for Active CPU billing and plan limits.
  • Modal SandboxesDocs · ModalgVisor as the default runtime with an optional VM runtime, Python creation and exec, and lifetimes from 5 minutes by default up to 24 hours.
  • E2B documentationDocs · E2BSandboxes as on-demand Linux VMs for agents, the e2b and e2b-code-interpreter Python packages, templates, and pause and resume that preserves filesystem and memory.
Free · sign in to start

Sign in to keep reading.

Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

  • 9 more sections
  • 3 hands-on exercises
  • A 7-question quiz
  • Progress, quiz scores and bookmarks