Skip to main content
Getting Started

Choosing a tool

Several tools help you run AI coding agents in isolated environments. This guide compares Moat with packnplay, Leash, and VS Code Dev Containers to help you choose the right one for your needs.

These tools solve related problems. The right choice depends on what you’re optimizing for.

Quick comparison

FeatureMoatpacknplayLeashDev Containers
Primary goalCredential security + observabilitySimple containerizationPolicy enforcementDevelopment environments
Worktree managementBuilt-inBuilt-inNoNo
Credential handlingNetwork-layer injectionMount into containerNetwork-layer injection (Linux)Environment variables
Agent sees tokensNoYesNo (Linux only)Yes
Network monitoringYesNoYesNo
Audit loggingTamper-proof with hash chainNoEvent streamingNo
Policy languageYAML (allow list)NoneCedarNone
Container runtimeDocker, Apple containersDockerDocker, Podman, OrbStackDocker
Setup complexityLowLowMediumLow-Medium
macOS nativeYes (Apple containers)NoExperimentalNo

When to use each tool

Use Moat when

You want credentials injected at the network layer—the proxy adds authentication headers to requests, so tokens never appear in the container environment. Even if an agent logs all environment variables or gets compromised, your credentials remain safe.

You also want observability. Every HTTP request the agent makes is logged with method, URL, status, and timing. Audit logs are hash-chained and can be cryptographically verified.

Moat also manages git worktrees, so you can run multiple agents on separate branches simultaneously—each in its own container with its own checkout of the repository.

# Credential never enters container
moat grant github
moat run --grant github -- curl https://api.github.com/user

Best for: Teams running agents with access to sensitive credentials (production APIs, private repos) who need audit trails.

Use packnplay when

You want the simplest path to running coding agents in containers. packnplay focuses on ease of use with automatic worktree management and pre-configured support for multiple agents (Claude Code, Codex, Gemini CLI, and others).

The trade-off is explicit: packnplay provides no introspection or access control beyond container isolation. Credentials are mounted into containers, so agents can see them.

# Simple, but agent sees credentials
packnplay run --all-creds claude

Best for: Individual developers who want container isolation without the overhead of policy management or credential proxying.

Use Leash when

You need fine-grained policy enforcement with Cedar policies. Leash uses eBPF on Linux to enforce policies at the kernel level—controlling which files agents can access, which processes they can run, and which network connections they can make.

// Example Cedar policy
permit (principal, action == Action::"FileOpenReadOnly", resource)
when { resource in [ Dir::"/workspace/" ] };

forbid (principal, action == Action::"NetworkConnect", resource)
when { resource in [ Host::"*.facebook.com" ] };

Leash also provides a Control UI for real-time inspection of agent activity.

Best for: Organizations that need granular, auditable access control with custom policies.

Use Dev Containers when

You’re already using VS Code or GitHub Codespaces and want a consistent development environment. Dev Containers weren’t designed specifically for AI agents, but they provide familiar tooling and work well for developers who want to run agents in the same environment they use for manual development.

// .devcontainer/devcontainer.json
{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "containerEnv": {
    "ANTHROPIC_API_KEY": "${localEnv:ANTHROPIC_API_KEY}"
  }
}

Credentials are delivered as environment variables or mounted files—the agent can access them directly.

Best for: Developers who want to use the same containerized environment for both manual development and AI agents.

Feature details

Credential security

How each tool handles sensitive credentials:

ToolApproachAgent access
MoatTLS proxy injects headers at network layerAgent sees placeholder value
packnplayMounts credentials read-only into containerAgent can read mounted files
LeashTLS proxy injects headers (Linux only)Agent sees placeholder (Linux); full access (macOS)
Dev ContainersEnvironment variables or mounted filesAgent has full access

If you need to prevent tokens from appearing in the container environment, Moat and Leash (on Linux) inject credentials at the network layer, keeping real tokens outside the container entirely.

Observability

What you can see about agent activity:

ToolNetwork requestsFile accessAudit trail
MoatFull HTTP loggingNoHash-chained, verifiable
packnplayNoneNoNone
LeashFull HTTP loggingYes (eBPF)Event streaming
Dev ContainersNoneNoNone

Leash provides the most comprehensive observability with kernel-level visibility into file and process activity. Moat focuses on network-layer observability with tamper-proof audit logs.

Policy enforcement

How each tool controls what agents can do:

ToolNetwork policyFile policyProcess policy
MoatAllow list in YAMLContainer boundaryContainer boundary
packnplayNoneContainer boundaryContainer boundary
LeashCedar policies + eBPFCedar policies + eBPFCedar policies + eBPF
Dev ContainersNoneContainer boundaryContainer boundary

Leash offers the most granular control. Moat provides network-level policies. packnplay and Dev Containers rely on container isolation alone.

Platform support

ToolmacOS (Intel)macOS (Apple Silicon)Linux
MoatDockerDocker or Apple containersDocker
packnplayDockerDockerDocker
LeashDockerDocker or native (experimental)Docker + eBPF
Dev ContainersDockerDockerDocker

Moat’s Apple container support on macOS 26+ provides native virtualization without Docker Desktop. Leash’s macOS native mode is experimental and does not support credential injection.

Migration paths

From Dev Containers to Moat

If you’re using Dev Containers and want better credential security:

  1. Your existing devcontainer.json can inform your agent.yaml (similar concepts: features → dependencies, containerEnv → env)
  2. Replace environment variable credentials with moat grant + --grant flags
  3. Network requests are automatically logged

From packnplay to Moat

If you want credential injection and observability:

  1. Replace packnplay run --all-creds claude with moat grant anthropic && moat claude
  2. Credentials are now injected at network layer instead of mounted
  3. Use moat trace --network to see what the agent did

From Moat to Leash

If you need file-level and process-level policies:

  1. Leash’s Cedar policies provide finer control than Moat’s YAML
  2. eBPF enforcement on Linux gives kernel-level visibility
  3. Trade-off: more complex setup and policy authoring

Summary

  • Moat: Credential security via network-layer injection, plus observability with tamper-proof audit logs.
  • packnplay: Simplest setup for container isolation. No credential protection or observability.
  • Leash: Most comprehensive policy enforcement and observability. Requires more setup.
  • Dev Containers: Familiar tooling for VS Code users. No agent-specific security features.

Choose based on your priorities:

  • Simplicity: Moat or packnplay
  • Credential security: Moat or Leash
  • Fine-grained policies: Leash
  • Audit trails: Moat or Leash
  • packnplay — Jesse Vincent’s containerization wrapper
  • Leash — StrongDM’s policy enforcement tool
  • Dev Containers — Development container specification