npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentforge-ai/sandbox

v0.7.1

Published

Docker-based sandbox provider for AgentForge agent tool execution isolation

Readme

@agentforge-ai/sandbox

Docker-based sandbox provider for AgentForge agent tool execution isolation.

Overview

This package implements container-based isolation for agent tool execution using Docker. It provides:

  • DockerSandbox — a container-backed SandboxProvider that manages the full lifecycle of a Docker container
  • ContainerPool — a warm-container pool to amortise Docker cold-start latency (LRU eviction, idle timeout)
  • SandboxManager — factory that creates the right sandbox type (Docker vs E2B) based on config, with graceful shutdown on process exit

Installation

pnpm add @agentforge-ai/sandbox dockerode

Quick Start

import { SandboxManager } from '@agentforge-ai/sandbox';

const manager = new SandboxManager({ provider: 'docker' });
await manager.initialize();

const sb = await manager.create({ scope: 'agent', workspaceAccess: 'none' });

const { stdout, exitCode } = await sb.exec('node --version');
console.log(stdout); // v22.x.x

await sb.writeFile('/tmp/hello.js', 'console.log("hello from container")');
const result = await sb.exec('node /tmp/hello.js');
console.log(result.stdout); // hello from container

await manager.destroy(sb);
await manager.shutdown();

Configuration

DockerSandboxConfig

| Field | Type | Default | Description | |-------|------|---------|-------------| | scope | 'session' \| 'agent' \| 'shared' | required | Lifecycle scope | | workspaceAccess | 'none' \| 'ro' \| 'rw' | required | Host workspace mount mode | | image | string | 'node:22-slim' | Docker image | | workspacePath | string | — | Host workspace directory | | containerWorkspacePath | string | '/workspace' | Mount point inside container | | resourceLimits.cpuShares | number | Docker default | CPU weight | | resourceLimits.memoryMb | number | unlimited | Memory cap in MB | | resourceLimits.pidsLimit | number | 256 | Max PIDs in container | | resourceLimits.networkDisabled | boolean | false | Disable networking | | binds | string[] | [] | Extra bind mounts (host:container:mode) | | env | Record<string, string> | {} | Environment variables | | timeout | number | none | Auto-kill after N seconds |

PoolConfig

const pool = new ContainerPool({
  image: 'node:22-slim',
  scope: 'agent',
  maxSize: 3,             // warm containers to keep ready (default: 3)
  idleTimeoutSeconds: 300 // evict after 5 min idle (default: 300)
});

await pool.warmUp();
const sb = await pool.acquire();
// ... use sandbox ...
await pool.release(sb);
await pool.drain(); // cleanup

Environment Variables

| Variable | Description | |----------|-------------| | DOCKER_HOST | Docker daemon host (default: Unix socket) | | DOCKER_IMAGE | Default image for agent sandboxes | | AGENTFORGE_ALLOWED_IMAGES | Comma-separated image prefixes allowed in production |

Security

  • Blocked bind mounts: /var/run/docker.sock, /etc, /proc, /sys, /dev, /boot, /root
  • Capabilities: All Linux capabilities dropped by default (CapDrop: ALL)
  • No new privileges: SecurityOpt: no-new-privileges:true applied to every container
  • PID limit: Default 256 PIDs per container to prevent fork bombs
  • Image validation: In production (NODE_ENV=production), only images with approved prefixes are allowed
  • Command validation: Defense-in-depth checks block docker.sock access and nsenter attempts

Docker Connection

Connects to the Docker daemon via:

  • Unix socket (default): /var/run/docker.sock
  • TCP: configure via SandboxManager({ dockerHost: { host, port, protocol } })
  • Env: DOCKER_HOST environment variable

Requirements

  • Node.js ≥ 18
  • Docker Engine installed and running on the host
  • dockerode peer dependency

License

Apache-2.0