[ORCH-106] Docker sandbox isolation #241

Closed
opened 2026-02-02 20:40:36 +00:00 by jason.woltje · 0 comments
Owner

Isolate agents in Docker containers for security.

Acceptance Criteria

  • src/spawner/docker-sandbox.service.ts implemented
  • dockerode integration for container management
  • Agent runs in isolated container
  • Resource limits enforced (CPU, memory)
  • Non-root user in container (node:node)
  • Container cleanup on agent termination
  • Comprehensive unit tests (21 tests, 100% statement coverage)
  • Configuration loaded from environment

Implementation Details

DockerSandboxService with methods: createContainer, startContainer, stopContainer, removeContainer, getContainerStatus, cleanup, isEnabled.

Configuration added to orchestrator.config.ts: DOCKER_SOCKET, SANDBOX_ENABLED, default image/memory/CPU/network settings.

Security: Non-root user, resource limits, network isolation options, workspace volume mounts only.

Test Coverage: 21 unit tests, 100% statement/function/line coverage, 70% branch coverage.

Integration: Added to spawner module, exported in index.ts, AgentSession type updated with containerId field.

See docs/scratchpads/orch-106-sandbox.md for details.

Implemented following TDD principles.

Isolate agents in Docker containers for security. ## Acceptance Criteria - [x] src/spawner/docker-sandbox.service.ts implemented - [x] dockerode integration for container management - [x] Agent runs in isolated container - [x] Resource limits enforced (CPU, memory) - [x] Non-root user in container (node:node) - [x] Container cleanup on agent termination - [x] Comprehensive unit tests (21 tests, 100% statement coverage) - [x] Configuration loaded from environment ## Implementation Details DockerSandboxService with methods: createContainer, startContainer, stopContainer, removeContainer, getContainerStatus, cleanup, isEnabled. Configuration added to orchestrator.config.ts: DOCKER_SOCKET, SANDBOX_ENABLED, default image/memory/CPU/network settings. Security: Non-root user, resource limits, network isolation options, workspace volume mounts only. Test Coverage: 21 unit tests, 100% statement/function/line coverage, 70% branch coverage. Integration: Added to spawner module, exported in index.ts, AgentSession type updated with containerId field. See docs/scratchpads/orch-106-sandbox.md for details. Implemented following TDD principles.
jason.woltje added this to the M6-AgentOrchestration (0.0.6) milestone 2026-02-02 20:40:36 +00:00
jason.woltje added the securityorchestrator labels 2026-02-02 20:40:36 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#241