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

@braedonsaunders/appkit-process-sandbox

v0.3.0

Published

Fail-closed Linux process isolation plus supervised execution, bounded replay, reattachment, cancellation, network policy, and resource ceilings.

Readme

@braedonsaunders/appkit-process-sandbox

Fail-closed Linux process isolation for workspace-bound coding agents and other trusted application workers.

The package owns the reusable bubblewrap policy: user, process, IPC, UTS and cgroup namespaces; capability dropping; an explicitly rebuilt environment; read-only system roots; masked host data; a private PID namespace; fresh /dev, /tmp, and /run; an explicit set of writable binds; optional network namespace isolation; and optional kernel resource ceilings. Secret environment values are passed in the sanitized child environment rather than serialized into process arguments. The consuming application still owns authentication, tenant-to-workspace resolution, and the command being launched.

Supervised executions

ProcessSandboxSupervisor decouples a command from the request that started it. A caller can safely retry a start with the same execution ID, poll from the last event sequence after a disconnect, cancel it, or retrieve its bounded terminal result until retention expires. Stream replay and final output are bounded separately, so slow or disconnected consumers cannot create an unbounded host-memory log.

const supervisor = new ProcessSandboxSupervisor({
  defaultTimeoutMs: 120_000,
  defaultRetentionMs: 15 * 60_000,
  maxOutputBytes: 64 * 1024,
})

const started = supervisor.start({
  executionId: request.idempotencyKey,
  maxOutputBytes: request.outputLimit,
  process: {
    command: '/usr/bin/sh',
    args: ['-lc', request.command],
    cwd: workspacePath,
    writablePaths: [workspacePath],
    network: 'none',
  },
})

let sequence = started.latestSequence
while (true) {
  const update = await supervisor.waitForUpdate(started.executionId, sequence)
  if (!update) throw new Error('Execution expired')
  sequence = update.latestSequence
  if (update.result) break
}

The built-in launcher remains spawnBubblewrappedProcess. An adapter for a different isolation backend may be supplied through launcher, but the adapter is responsible for providing equivalent confinement and a normal Node ChildProcess lifecycle. The supervisor does not weaken or replace the bubblewrap boundary.

Network policy

network defaults to 'host', which is the behavior of every release before network policy existed — package installs and agents that call an API keep working across an upgrade. Pass network: 'none' for commands that have no business reaching out; the child then has only a loopback interface, with no DNS and no access to services the application container can reach.

const child = spawnBubblewrappedProcess({
  command: '/opt/tools/ripgrep/rg',
  args: ['--json', pattern],
  cwd: workspacePath,
  writablePaths: [workspacePath],
  network: 'none',
  limits: { cpuSeconds: 30, addressSpaceBytes: 1_073_741_824, processes: 64 },
})

Resource limits

limits maps to prlimit(1) running inside the namespace, so the ceilings apply to the command and everything it forks. Soft and hard values are set together, which means the child cannot raise them. Requesting a limit on a host without util-linux throws rather than running the command unbounded — silently dropping a ceiling would fail open on exactly the hosts the caller was trying to protect. verifyProcessSandbox() reports resourceLimitsSupported and networkIsolationSupported so a readiness screen can show what this host can actually enforce.

Procfs is unavailable by default for compatibility with container hosts that prohibit nested proc mounts. A consumer can set mountProc: true to mount a fresh procfs scoped to the sandbox's private PID namespace. For native runtimes that only require current_exe(), prefer syntheticSelfExecutable: AppKit creates only /proc/self/exe as a symlink to that explicitly approved absolute path, exposing no process metadata. The two modes are mutually exclusive.

The working directory may be a writable bind for build/edit agents or a read-only bind for question-and-answer and inspection workers.

import { spawnBubblewrappedProcess } from '@braedonsaunders/appkit-process-sandbox'

const child = spawnBubblewrappedProcess({
  command: '/usr/local/bin/codex',
  args: ['exec', '--json', prompt],
  cwd: workspacePath,
  writablePaths: [workspacePath, agentHomePath],
  environment: {
    PATH: '/usr/local/bin:/usr/bin:/bin',
    CODEX_HOME: `${agentHomePath}/.codex`,
  },
  launcherIdentity: { uid: 1000, gid: 1000 },
  syntheticSelfExecutable: '/usr/local/bin/codex',
})

When the parent service runs as root inside a container, configure an unprivileged launcherIdentity and install bubblewrap setuid-root. AppKit invokes only the bubblewrap executable as that identity; the setuid helper creates the namespaces and drops all capabilities before the agent command is executed. This avoids granting CAP_SYS_ADMIN to the application container. Writable bind paths must be writable by the launcher identity.

Do not fall back to an unsandboxed child process when this package reports an unsupported platform or missing bubblewrap binary. Desktop/single-user local execution is a separate, explicit deployment mode.

Call verifyProcessSandbox({ launcherIdentity }) during a server's startup with the same launcher identity used for real agent processes. It runs a minimal command inside the real sandbox so blocked namespace or mount syscalls are detected before the service accepts agent work.