coden-msb
v0.1.0
Published
CodeN plugin: run Python in a disposable MicroSandbox microVM (create → execute → destroy).
Maintainers
Readme
coden-msb
A CodeN npm plugin that runs Python inside a disposable MicroSandbox microVM.
Unlike running Python directly in the agent's /tmp, each call boots a fresh,
hardware-isolated container, executes the script, returns its output, and then
destroys the container.
Tools
| Tool | Purpose | Risk |
| ---- | ------- | ---- |
| msb_python | Run a Python script in a disposable microVM and return output | modify |
msb_python accepts code (required) and optional image (default
python:3.12-slim), cpus (1), memory (512 MiB), timeout (60s), and
network (false). Network is off by default; set network: true to allow
sandbox egress.
Requirements
- MicroSandbox runtime
(installed automatically by the
microsandboxnpm dependency on first use; needs a KVM/hypervisor-capable host, e.g. Apple Silicon on macOS). - CodeN ≥ 0.1.0 with npm plugin support.
Install into CodeN
coden plugin install npm:coden-msb
coden plugin listInstall locally for a single project, or --global for the current user.
Installing or upgrading requires a CodeN restart. The microsandbox dependency
(and its platform binary) is installed into the plugin runtime automatically —
you don't install microsandbox separately.
Development
bun install
bun run check # biome + tsc + vitest (offline)
CODEN_LIVE_TEST=1 vitest run test/live.test.ts # real microVM smoke
bun run build # bundle src/ -> dist/index.jsPublishing / Release
.github/workflows/publish.yml publishes to npm when you push a v* tag (or run
it manually via Actions → Publish to npm → Run workflow). It requires a GitHub
secret named NPM_TOKEN set to an npm auth token with publish access for the
coden-msb package.
Create a version tag matching package.json and push it:
# bump version in package.json first, then:
git tag v0.1.0
git push origin v0.1.0The workflow verifies the tag matches package.json, runs bun run check, then
npm publish (which runs prepack → build and prepublishOnly → check). Configuring
this release action the first time:
- Generate an npm token (
npm token create) with publish scope. - Add it as a GitHub repo secret named
NPM_TOKEN(Settings → Secrets and variables → Actions).
Not a sandbox substitute
The plugin runs in the CodeN process and owns host permissions. MicroSandbox
isolates the Python execution, but CodeN plugins are not a security sandbox.
The network: false default reduces egress; resource limits prevent runaway.
