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

opencode-local-sandbox

v0.1.1

Published

OpenCode plugin that adds a bash_sandboxed tool for running commands inside a local OS-level sandbox

Downloads

235

Readme

opencode-local-sandbox

OpenCode plugin that runs bash commands inside a local OS-level sandbox. Adds a bash_sandboxed tool with filesystem and network isolation, while keeping the built-in bash tool as an escape hatch.

Supports multiple sandbox backends with automatic detection:

Not affiliated with OpenCode or any sandbox backend.

Installation

opencode plugin --global opencode-local-sandbox@latest

At least one sandbox backend must be on your PATH. The plugin auto-detects available backends (tries nono, then fence, then srt) and warns if none are found.

Configuration

Configure via plugin options:

{
  "plugin": [
    ["opencode-local-sandbox@latest", { "sandbox": "fence", "profile": "/path/to/settings.json" }],
  ],
}

Options:

  • sandbox: Which backend to use ("nono", "fence", or "srt"). Auto-detects if not specified.
  • profile: For nono, a profile name (default: opencode). For fence and srt, a path to a settings file. Use absolute paths, especially in global configs; relative paths resolve against the sandbox CLI's working directory at runtime, which varies per project.

Environment variables override options:

  • OLS_SANDBOX - Backend to use
  • OLS_PROFILE - Profile name or path

How It Works

bash_sandboxed spawns the configured sandbox CLI with your command. Invocation differs by backend:

  • nono: nono run -s -p <profile> -- <shell> -c <command> (banner suppressed with -s; profile is a name)
  • fence: fence -s <settings-path> -c <command> (-s is the path to a settings JSON file; omitted when no profile is set; use absolute paths)
  • srt: srt -s <settings-path> -c <command> (same as fence; omitted when no profile is set)

A tool.definition hook modifies the built-in bash tool description to steer the LLM toward bash_sandboxed. A tool.execute.before hook blocks the built-in bash tool unless the same command was already attempted with bash_sandboxed in the current session. The LLM always tries the sandboxed path first and falls back to bash only when sandbox restrictions block the command.

Permissions

bash_sandboxed uses its own permission name. Since opencode does not restrict this tool by default, commands run without prompting unless you override the setting.

Recommended setup

For a workflow where sandboxed commands run freely and you are prompted only when the agent escapes the sandbox, set bash_sandboxed to allow and bash to ask:

{
  "permission": {
    "bash_sandboxed": "allow",
    "bash": "ask",
  },
}

The sandbox profile enforces all restrictions. The agent runs commands through bash_sandboxed without prompting; you are asked for permission only when it falls back to the unsandboxed bash tool.

What is and isn't sandboxed

Only bash_sandboxed is sandboxed. All other OpenCode tools (read, write, edit, glob, grep, webfetch, task, etc.) use OpenCode's regular permission system.

Disclaimer

This plugin wraps third-party sandboxing tools. It does not guarantee security. Isolation effectiveness depends entirely on the sandbox backend and its configuration. Misconfigured sandboxes may allow escape. Review your sandbox backend's documentation and security model before relying on it.

Development

pnpm install
pnpm run check
pnpm run build