Skip to content

Releases: capsulerun/capsule

v0.8.10

Choose a tag to compare

@mavdol mavdol released this 27 Apr 12:20
73e1f7c

Improvements

TypeScript SDK Polyfills

  • Add more built-in methods to fs
  • Add a real Wasi‑based stats system for files and folders
  • Add support for symlinks inside sandboxes

v0.8.9

Choose a tag to compare

@mavdol mavdol released this 22 Apr 12:11
97fbd70

Improvements

Rust Core

  • Fix cache issues for multi-language projects
  • Improve task reporter to have better logs

Typescript SDK

  • Fix worker process issue for run() command
  • Fix absolute path issue for fs polyfills

Python SDK

  • Fix worker process issue for run() command

v0.8.8

Choose a tag to compare

@mavdol mavdol released this 17 Apr 12:56
ef1dccf

Smaller Python bundle, worker mode, and path fixes

Improvements

Core

  • Worker mode: Added a capsule worker to reduce child process overhead when using the run() function.
  • Trace rebuild fix: Fixed trace rebuild for projects using both Python and TypeScript sandboxes.

SDKs

  • Smaller Python bundle: Only import the necessary built-ins, reducing the overall size.
  • TypeScript path fixes: Resolved absolute path issues with fs polyfills.

v0.8.7

Choose a tag to compare

@mavdol mavdol released this 14 Apr 08:24
393a9f4

Path resolution, polyfills, and large argument support

Note

This release bundles several improvements made since v0.8.0 (versions 0.8.1 to 0.8.6 were internal steps).

Core Improvements

  • --args-file option: Bypass inline argument limits by passing arguments via a file.
capsule run main.ts --args-file /tmp/tmp-file.txt # avoid inline limit

With this improvement, the run() function now handles large inputs more reliably.

  • Virtual CWD support : process.chdir() now works inside the sandbox. Relative paths resolve correctly against the virtual working directory. Useful to have a real CWD system for the --mount option.
process.chdir('hello-folder')   // _virtualCwd = 'hello-folder'
fs.readdirSync('.')             // '.' → 'hello-folder' → matches preopen 
fs.readFileSync('file.txt')     // 'file.txt' → 'hello-folder/file.txt'

TypeScript Improvements

Improved compatibility for Node.js built‑ins and made imports more reliable. This makes Capsule work smoothly with alternative package managers like pnpm.

v0.8.0

Choose a tag to compare

@mavdol mavdol released this 09 Apr 09:18
c62852d

Richer execution metrics

This release adds more visibility into each task's behavior.

What's New

Core improvements

You now get memory usage and outbound network requests for every task.

Example response:

{
  "success": true,
  "result": "Hello from Capsule!",
  "error": null,
  "execution": {
    "task_name": "data_processor",
    "duration_ms": 1523,
    "retries": 0,
    "fuel_consumed": 45000,
    "ram_used": 1200000,
    "host_requests": [{ ... }]
  }
}

Important

Delete the .capsule cache folder to avoid any issues with trace history.

TS polyfills

  • Extended compatibility by adding unenv to replace Node.js built‑ins that are not WASI related.

v0.7.2

Choose a tag to compare

@mavdol mavdol released this 30 Mar 21:12
9fa976b

Dynamic Directory Aliases (--mount) & Adapter Sessions

Core Improvements

Added --mount flag (CLI) and mounts parameter (SDK) to mount a host directory into the sandbox under an alias.

# Mount a session workspace and expose it as "workspace" inside the task
capsule run main.py --mount restricted-folder/sessions/abc123_workspace::workspace

# Multiple directories
capsule run main.py \
  --mount restricted-folder/sessions/abc123_workspace::workspace \
  --mount restricted-folder/sessions/bce456_workspace::workspace:ro
from capsule import run

result = await run(
    file="main.py",
    mounts=["restricted-folder/sessions/abc123_workspace::workspace"],
)

Python & TypeScript Adapter Sessions

A new sandboxed session system is now available.

from capsule_adapter import Session

async with Session() as s:
    await s.run("x = 1")
    result = await s.run("x += 1; x")
    print(result)  # 2

You can also import files within a session:

async with Session() as s:
    # Import a single file
    await s.import_file("./notes.txt", "notes.txt")

    result = await s.run("""
with open("workspace/notes.txt") as f:
    content = f.read()
content
""")

    # Delete the file
    await s.delete_file("./notes.txt")

SDK

Added more built-ins to the TypeScript SDK.

v0.7.1

Choose a tag to compare

@mavdol mavdol released this 24 Mar 17:35
a1f6bba

Restricted Network Access by Default

Improvements

  • Explicit allowed hosts are now required
    allowed_hosts: ["anthropic.com"] or ["*"] to allow all hosts

v0.7.0

Choose a tag to compare

@mavdol mavdol released this 23 Mar 09:27
c37fd27

Prebuilt Sandbox Adapters & Python Component toolchain Improvements

This release adds prebuilt sandbox adapters for Python and TypeScript, plus improvements to Python's component toolchain.

What's New

TypeScript

Prebuilt Sandbox for Python & JavaScript

The @capsule-run/adapter package offers the same capabilities for TypeScript/JavaScript projects.

import { runPython, runJavaScript } from '@capsule-run/adapter';

const pythonSandbox = await runPython(`
print("Hello from Python!")
x = 5 + 3
x * 2
`);
console.log(pythonSandbox);

const jsSandbox = await runJavaScript(`
console.log("Hello from JavaScript!");
const x = 5 + 3;
x * 2;
`);
console.log(jsSandbox);

Install with: npm install @capsule-run/adapter

Learn more: Typescript Adapter documentation

Python

Prebuilt Sandbox for Python & JavaScript

You can now run untrusted Python or JavaScript code directly from your Python application using precompiled sandboxes. The package is available on PyPI:

from capsule_adapter import run_python, run_javascript

python_sandbox = await run_python("""
print("Hello from Python!")
x = 5 + 3
x * 2
""")
print(python_sandbox)

js_sandbox = await run_javascript("""
console.log("Hello from JavaScript!");
let x = 5 + 3;
x * 2;
""")
print(js_sandbox)

Install with: pip install capsule-run-adapter

Learn more: Python Adapter documentation

Python Toolchain Upgrades

  • Full asyncio Support
    The previous POSIX dependency made asyncio difficult to use in WASM. We’ve reimplemented essential selector functionality so async/await now works as expected.

Enhanced Filesystem Mode — Fine‑Grained Access Control

You can now specify precise filesystem permissions on a per‑path basis, choosing between read‑only or read‑write access.

Typescript

export const main = task({
    name: "main",
    allowedFiles: [
        { path: "./data", mode: "read-only" },
        { path: "./output", mode: "read-write" },
    ]
}, async () => {
    ...
});

Python

@task(name="main", allowed_files=[
    {"path": "./data", "mode": "read-only"},
    {"path": "./output", "mode": "read-write"},
])
def main() -> str:
 ...

Note

The previous version still works but give a read and write permission:

  • allowed_files=["./data"]
  • allowedFiles:["./data"]

v0.6.5

Choose a tag to compare

@mavdol mavdol released this 09 Mar 23:01
43f1117

Extend linux compatibility to older version

improvements

  • Support glibc 2.28+

v0.6.4

Choose a tag to compare

@mavdol mavdol released this 09 Mar 14:16
2b7c712

Linux universal compatibility

What's new

Linux improvements

  • Rebuilt linux-x64 binary as a static MUSL binary — no more GLIBC version requirements, works on Debian Bookworm, Ubuntu 22.04, Alpine, and any Linux distro
  • Added linux-arm64 support (AWS Graviton, Apple Silicon Docker, Raspberry Pi)