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

@agentick/sandbox-secure-exec

v0.14.20

Published

V8 isolate sandbox provider for Agentick — lightweight code execution via secure-exec

Readme

@agentick/sandbox-secure-exec

V8 isolate sandbox provider for Agentick using secure-exec. Provides lightweight JavaScript execution with ~3.4MB overhead and 16ms cold start — 75-150x less memory than Docker.

Installation

pnpm add @agentick/sandbox-secure-exec

Quick Start

import { Sandbox, ReadFile, WriteFile, EditFile } from "@agentick/sandbox";
import { secureExecProvider, ExecJS } from "@agentick/sandbox-secure-exec";

const MyAgent = () => (
  <Sandbox provider={secureExecProvider({ network: true })}>
    <ExecJS />
    <ReadFile />
    <WriteFile />
    <EditFile />
  </Sandbox>
);

Provider Configuration

const provider = secureExecProvider({
  memoryLimit: 128, // MB (default: 128)
  cpuTimeLimitMs: 30_000, // per exec() call (default: 30,000)
  workspacePath: "/workspace", // VFS root (default: "/workspace")
  moduleAccess: process.cwd(), // host node_modules cwd, false to disable
  network: false, // enable fetch/HTTP (default: false)
  timingMitigation: "off", // "freeze" or "off" (default: "off")
  persistence: adapter, // optional PersistenceAdapter
});

Architecture

exec() runs JavaScript, not shell

Unlike Docker's exec() which runs bash commands, secure-exec's exec() runs JavaScript directly in a V8 isolate. The tool paired with the provider determines semantics:

  • Docker provider → <Bash /> tool (shell commands)
  • secure-exec provider → <ExecJS /> tool (JavaScript code)
  • ReadFile/WriteFile/EditFile → unchanged (use sandbox.readFile()/writeFile())

File operations bypass the isolate

readFile(), writeFile(), and editFile() operate directly on the MountAwareVFS — no isolate round-trip. This is a major performance win over Docker which shells out for every file operation.

Runtime reuse

The NodeRuntime is reused across exec() calls within a sandbox. State persists (variables, module cache) — same as Docker's sleep infinity container pattern. Concurrent exec() calls are serialized via queue.

Tools

ExecJS

Executes JavaScript code in the isolate. console.log() maps to stdout, console.error() to stderr. Node.js built-ins (fs, path, http, etc.) are available via require().

SecureExecTools

Convenience component that bundles ExecJS + ReadFile + WriteFile + EditFile:

import { SecureExecTools } from "@agentick/sandbox-secure-exec";

<Sandbox provider={secureExecProvider()}>
  <SecureExecTools />
</Sandbox>;

MountAwareVFS

Wraps secure-exec's InMemoryFileSystem with host mount pass-through:

  • Paths within mounts → delegate to host node:fs (respects ro/rw)
  • All other paths → delegate to in-memory VFS
  • POSIX path validation prevents workspace/mount escapes

PersistenceAdapter

Optional interface for saving/restoring VFS state (e.g., to EFS, S3, or disk):

interface PersistenceAdapter {
  load(sandboxId: string, vfs: VirtualFileSystem): Promise<void>;
  save(sandboxId: string, vfs: VirtualFileSystem): Promise<void>;
}

Permissions

Sandbox permissions from SandboxCreateOptions map to secure-exec's permission system:

| Agentick Permission | secure-exec Mapping | | -------------------------- | ---------------------------------- | | fs: true/false | VFS handles path scoping | | net: true/false/rules | Network adapter + permission check | | childProcess: true/false | Child process permission check |

Resource Limits

| Agentick Limit | secure-exec Mapping | | ----------------------- | ------------------- | | limits.memory (bytes) | memoryLimit (MB) | | limits.timeout (ms) | cpuTimeLimitMs |

Node.js Compatibility

Requires Node.js < 25. The underlying isolated-vm native module has a known segfault on Node.js 25+. Use Node.js 22 (LTS) for production.