Skip to content
Back to skills

Sandbox Ocr

ASecurity

Read the text in an image from a Code node or CodeAct action, with tesseract.js running on the host

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

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-ocr --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sandbox Ocr?

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

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

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-ocr
description: Read the text in an image from a Code node or CodeAct action, with tesseract.js running on the host
---

# OCR in the sandbox

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

tesseract.js runs a WASM engine, spawns workers, and downloads its language
data on first use — none of which the guest can do. This pack is a **host
module**: the import resolves to a generated facade over NodeTool's own
implementation.

## recognize — image bytes to text

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

const { text, confidence, words } = await recognize(
  await workspace.readBytes("receipt.png")
);
const total = words.find((w) => /^\d+[.,]\d{2}$/.test(w.text));
return { text, confidence, total: total?.text ?? null };
```

One call gives you all three readings:

- `text` — the whole page as one string.
- `confidence` — the page mean, 0–100.
- `words` — `{text, confidence, bbox: {x, y, width, height}}` per word, in
  reading order, with the box in image pixels.

Pass `{ language: "eng+deu" }` for anything other than English; the codes are
Tesseract's, `+`-joined. The data file for a language it has not seen before is
downloaded the first time you ask for it, so that call is slower.

Get the bytes from `workspace.readBytes`, from `await response.bytes()`, or
from an asset with `assetToSandbox`.

## Gotchas

- **`recognize` is async**, and the first call to it pays for engine startup.
- **10 MB per image.** Larger input is refused by name.
- **20 000 words per page.**
- **Straight, sharp scans read best.** Use `image.rotate` and `image.adjust` to
  deskew and raise contrast before you hand the bytes over.

Files in this skill

  • SKILL.md1.7 KB
  • package.json862 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.