kern-sandbox 0.1.34 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -12
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# kern-sandbox (Node.js / TypeScript)
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
**Run AI-generated code in a real sandbox, one fresh box per call, in about 4 ms.**
|
|
4
|
+
|
|
5
|
+
`kern-sandbox` is the Node and TypeScript binding for **[kern](https://getkern.dev)**: a rootless,
|
|
6
|
+
kernel-enforced sandbox out of one static binary, with no daemon, no VM and no cloud. An agent's
|
|
7
|
+
tool-call, a model's generated snippet, a CI step: code that runs before anyone reads it gets its own
|
|
8
|
+
box, and the box is thrown away after.
|
|
9
|
+
|
|
10
|
+
Network off, memory and PID caps the kernel enforces, capabilities dropped, a deny-by-default seccomp
|
|
11
|
+
allowlist, and a wall-clock deadline the binding applies from **outside** the box, so code that hangs
|
|
12
|
+
cannot outlive it. Dependency-free: it shells out to the `kern` binary and does not re-implement
|
|
13
|
+
isolation in JavaScript.
|
|
14
|
+
|
|
15
|
+
**The failure comes back as data, not as an exception.** A timeout, an OOM-kill, a blocked syscall or
|
|
16
|
+
a missing interpreter is a typed `fault` on the result, beside stdout and the exit code, so an agent
|
|
17
|
+
loop reads a field instead of parsing a stack trace to learn that the sandbox ended the run.
|
|
18
|
+
|
|
19
|
+
On npm: [`npm install kern-sandbox`](https://www.npmjs.com/package/kern-sandbox). Python gets the same
|
|
20
|
+
package on PyPI: [`kern-sandbox`](https://pypi.org/project/kern-sandbox/), which also ships an **MCP
|
|
21
|
+
server** for Claude Desktop and Cursor.
|
|
15
22
|
|
|
16
23
|
```js
|
|
17
24
|
const kern = require("kern-sandbox");
|
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const crypto = require("crypto");
|
|
|
36
36
|
const zlib = require("zlib");
|
|
37
37
|
const { spawn, spawnSync } = require("child_process");
|
|
38
38
|
|
|
39
|
-
const VERSION = "0.1.
|
|
39
|
+
const VERSION = "0.1.35";
|
|
40
40
|
|
|
41
41
|
const DEFAULT_IMAGE = "python:3.12-slim";
|
|
42
42
|
const WORKSPACE = "/workspace"; // where the persistent workspace is mounted inside every box
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kern-sandbox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "kern is a fast, rootless sandbox and virtual resource runtime for any workload, including untrusted and AI-generated code; kern-sandbox is its Node/TypeScript binding. Run untrusted or agent-generated code (Python/JS/Bash) in a real, kernel-enforced box in single-digit milliseconds, with no cloud, no account and no VM.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sandbox",
|