Skip to content

v0.6.0

Choose a tag to compare

@mavdol mavdol released this 16 Feb 15:02
· 251 commits to main since this release
6aaecd6

SDK Runner & Network Controls

This release enables seamless integration of Capsule into existing applications and adds network-level security controls for sandboxed tasks.

What's New

SDK Runner — run() Function

Both SDKs now include an async run() function that executes Capsule tasks as a subprocess, making it easy to integrate sandboxed execution into any existing project, no CLI orchestration needed. Just call run() from your application code and execute it with python main.py, npx tsx main.ts or your usual runner.

TypeScript / JavaScript

import { run } from '@capsule-run/sdk/runner';

const result = await run({
  file: './capsule.ts',
  args: ['code to execute']
});

Python

from capsule import run

result = await run(
    file="./capsule.py",
    args=["code to execute"]
)

Allowed Hosts — Network Whitelist

Tasks can now restrict outgoing HTTP requests to an explicit list of domains. Wildcard patterns are supported.

Language Parameter Default
Python allowed_hosts ["*"] (all)
TypeScript allowedHosts ["*"] (all)
export const main = task({
  name: "main",
  allowedHosts: ["api.openai.com", "*.anthropic.com"],
}, async () => { ... });
@task(name="main", allowed_hosts=["api.openai.com", "*.anthropic.com"])
def main():
    ...

Improved WASM Compilation & Caching

  • Each source file now produces its own dedicated .wasm and .cwasm (pre-compiled cache) artifacts, named after the file (e.g. capsule run main.py → main.wasm + main.cwasm).
  • Task introspection now only considers the main task from the entry file, preventing conflicts when multiple files in the same folder define a main task.

Notes

  • The run() function requires @capsule-run/cli as a dependency in JavaScript projects.
  • By default, all outbound HTTP requests are allowed (["*"]). Set allowedHosts / allowed_hosts to restrict access.
  • Wildcard domain patterns (e.g. *.anthropic.com) match any subdomain.