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

@7resp4ss/pi-sandbox

v0.1.1

Published

Capability-aware sandbox extension for pi

Readme

pi-sandbox

Capability-aware filesystem, process, and network sandboxing for pi coding agent. Shell processes run inside Anthropic's Sandbox Runtime, while pi's tool_call event gates tools executed in the pi process. Tools without a declared capability are denied by default.

Quick start

npm install
npm run build
pi --extension ./src/index.ts --sandbox r       # workspace read-only
pi --extension ./src/index.ts --sandbox w       # workspace writable (default)
pi --extension ./src/index.ts --sandbox yolo    # explicitly disable sandboxing

Use /sandbox inside pi to inspect the effective policy, and /sandbox <r|w|yolo> to switch the running session's level (with tab completion for the level names). Level r permits workspace reads, w also permits workspace writes, and yolo disables restrictions.

Switching rebuilds the policy and restarts the OS sandbox runtime in place; the tool gate, the status bar, and the exported PI_SANDBOX_LEVEL follow immediately. A session that inherited PI_SANDBOX_LEVEL from its parent can only switch within that ceiling (strictest(requested, inherited)), so runtime switching preserves the rule that delegation can never widen a sandbox. If the runtime refuses the new level, the previous level is restored and /sandbox reports the failure.

Flexible permission configuration

Permissions are declared per tool, including orchestration tools such as subagent. You can change the policy in ~/.pi/agent/extensions/sandbox.json or a project-local .pi/sandbox.json without changing extension code.

Supported capabilities are filesystem.read, filesystem.write, process.execute, and network.connect:

{
  "tools": {
    "subagent": { "capabilities": [] },
    "web_search": { "capabilities": ["network.connect"] },
    "file_editor": {
      "capabilities": ["filesystem.read", "filesystem.write"]
    }
  }
}

An empty capability list marks a tool as orchestration only. This is useful for subagent, task scheduling, and coordination tools. Resource operations performed inside a child session are still checked by that session's own policy engine, so delegation cannot bypass sandbox checks.

Combine tool declarations with path and network rules:

{
  "level": "r",
  "unknownTools": "deny",
  "network": { "allowedDomains": ["api.example.com"] },
  "filesystem": { "allowRead": ["./fixtures"] },
  "tools": {
    "subagent": { "capabilities": [] },
    "my_search": { "capabilities": ["network.connect"] }
  }
}

The global configuration and project configuration are merged, with project values taking precedence. PI_SANDBOX_LEVEL provides an inherited ceiling: child sessions can tighten permissions, but can never widen the effective level of their parent.

Extension authors can declare capabilities in code:

declareSandboxTool("my_tool", { capabilities: ["filesystem.read"] });

Development

npm run check   # typecheck and tests
npm run build   # emit dist/

The integration entry point is src/integration/extension.ts; policy, configuration loading, and capability registration live under src/policy, src/config, and src/capabilities.

License

MIT