Skip to content
Back to skills

Sandbox Zip

ASecurity

Read and write zip archives in a Code node or CodeAct action, with fflate running on the host under a 50 MB inflation cap

  • 552 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added September 1, 2026
ai-agentsjavascriptgojavanode

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 1, 2026

npx -y skills add nodetool-ai/nodetool --skill sandbox-zip --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sandbox Zip?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sandbox Zip
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nodetool-ai-sandbox-zip/badge)](https://www.skillsdirectory.com/skills/nodetool-ai-sandbox-zip)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sandbox-zip
description: Read and write zip archives in a Code node or CodeAct action, with fflate running on the host under a 50 MB inflation cap
---

# Zip archives in the sandbox

Specifier: `@nodetool-ai/sandbox-zip`. Import it at the top of the body.

## Why this one runs on the host

fflate is pure JavaScript and the sandbox compiler admits it, so this pack
*could* have shipped as a guest module — and an earlier version did. It does
not, because of the cap: a zip bomb is a policy question, and a policy enforced
inside the guest is enforced by code the guest can simply not call. The guest's
64 MB heap does not replicate it either — fflate inflates into host memory
first. So the library stays on the host, with `unzip` refusing anything that
inflates past **50 MB**, and there is no second route around that number.

## unzip — extract an archive

```js
import { unzip } from "@nodetool-ai/sandbox-zip";

const files = await unzip(inputs.archive);          // { "a/b.txt": Uint8Array }
const readme = new TextDecoder().decode(files["README.md"]);
return { names: Object.keys(files), readme };
```

Entry values arrive as real `Uint8Array`s. Decode text with `TextDecoder`.

## zip — build one

```js
import { zip } from "@nodetool-ai/sandbox-zip";

const archive = await zip({
  "report.md": inputs.markdown,                     // strings are UTF-8 encoded
  "data.json": JSON.stringify(inputs.rows)
});
await workspace.writeBytes("out.zip", archive);
return { bytes: archive.length };
```

Entry values are `Uint8Array` or `string`.

## Gotchas

- **Both exports are async.**
- **10 MB in, 50 MB out.** The archive itself is capped at 10 MB; the sum of the
  entries `unzip` produces — and the sum of what `zip` is handed — is capped at
  50 MB, checked as the entries are walked so a bomb stops part way.
- **No streaming.** The whole archive is materialized. For a payload near the
  cap, write entries to the workspace as you go instead.

Files in this skill

  • SKILL.md1.9 KB
  • package.json880 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.