Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<div align="center">

<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark-mode.png" />
<source media="(prefers-color-scheme: light)" srcset="assets/logo-light-mode.png" />
<img alt="Capsule" src="assets/logo-light-mode.png" width="100" />
</picture>

# `Capsule`

**A secure, durable runtime for AI agents**
[![CI](https://img.shields.io/github/actions/workflow/status/capsulerun/capsule/ci.yml?branch=main&label=CI)](https://github.com/capsulerun/capsule/actions/workflows/ci.yml) [![NPM Downloads](https://img.shields.io/npm/dm/@capsule-run%2Fcli?label=npm&color=orange)](https://www.npmjs.com/package/@capsule-run/cli) [![PyPI Downloads](https://img.shields.io/pypi/dm/capsule-run?label=PyPI&color=3775A9)](https://pypistats.org/packages/capsule-run)

[![CI](https://github.com/mavdol/capsule/actions/workflows/ci.yml/badge.svg)](https://github.com/mavdol/capsule/actions/workflows/ci.yml)

[Getting Started](#getting-started) • [Documentation](#documentation) • [Issues](https://github.com/capsulerun/capsule/issues/new) • [Contributing](#contributing)

Expand All @@ -14,17 +19,13 @@

## Overview

```Capsule``` is a runtime for coordinating AI agent tasks in isolated environments. It is designed to handle untrusted code execution, long-running workflows, large-scale processing, or even multi-agent systems.

Each task runs inside its own WebAssembly sandbox, providing:
```Capsule``` is a runtime for executing untrusted code in isolated environments. Each task runs inside its own WebAssembly sandbox, providing:

- **Isolated execution**: Each task runs isolated from your host system
- **Resource limits**: Set CPU, memory, and timeout limits per task
- **Automatic retries**: Handle failures without manual intervention
- **Lifecycle tracking**: Monitor which tasks are running, completed, or failed

This enables safe task-level execution of untrusted code within AI agent systems.

## How It Works

### With Python
Expand Down Expand Up @@ -58,15 +59,6 @@ export const analyzeData = task({
// Your code runs safely in a Wasm sandbox
return { processed: dataset.length, status: "complete" };
});

// The "main" task is required as the entrypoint
export const main = task({
name: "main",
compute: "HIGH"
}, () => {
return analyzeData([1, 2, 3, 4, 5]);
});

```

> [!NOTE]
Expand All @@ -81,7 +73,7 @@ Each task operates within its own sandbox with configurable resource limits, ens
| Package | Description |
|---------|-------------|
| [`capsule`](https://github.com/capsulerun/capsule) | Core runtime (this repository) |
| [`capsule-bash`](https://github.com/capsulerun/bash) | Sandboxed bash interface built for AI agents |
| [`capsule-bash`](https://github.com/capsulerun/bash) | Sandboxed bash interface built from capsule |

## Getting Started

Expand Down Expand Up @@ -191,7 +183,7 @@ export const main = task({
```

> [!TIP]
> If you're looking for a pre-configured, ready-to-use solution, check out the [Python adapter](https://github.com/mavdol/capsule/tree/main/integrations/python-adapter) or [TypeScript adapter](https://github.com/mavdol/capsule/tree/main/integrations/typescript-adapter).
> If you're looking for a pre-configured, ready-to-use solution, check out the [Python adapter](https://github.com/capsulerun/capsule/tree/main/integrations/python-adapter) or [TypeScript adapter](https://github.com/capsulerun/capsule/tree/main/integrations/typescript-adapter).

## Documentation

Expand Down Expand Up @@ -433,7 +425,7 @@ You can create a `capsule.toml` file in your project root to set default options
# capsule.toml

[workflow]
name = "My AI Workflow"
name = "My Workflow"
version = "1.0.0"
entrypoint = "src/main.py" # Default file when running `capsule run`

Expand Down Expand Up @@ -520,7 +512,7 @@ Contributions are welcome!
**Prerequisites:** Rust (latest stable), Python 3.13+, Node.js 22+

```bash
git clone https://github.com/mavdol/capsule.git
git clone https://github.com/capsulerun/capsule.git
cd capsule

# Build and install CLI
Expand All @@ -543,7 +535,7 @@ npm install && npm run build && npm link
3. **Run tests**: `cargo test` (only needed if modifying `crates/capsule-cli` or `crates/capsule-core`)
4. **Open** a Pull Request

Need help? [Open an issue](https://github.com/mavdol/capsule/issues)
Need help? [Open an issue](https://github.com/capsulerun/capsule/issues)

## Credits

Expand Down
Binary file added assets/logo-dark-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-light-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions crates/capsule-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name = "capsule-run"
version = "0.8.9"
edition = "2024"
description = "Secure WASM runtime to isolate and manage AI agent tasks"
description = "Secure WASM runtime to execute untrusted code"
license = "Apache-2.0"
repository = "https://github.com/mavdol/capsule"
repository = "https://github.com/capsulerun/capsule"
keywords = ["webassembly", "sandbox", "isolation", "llm", "ai"]
categories = ["command-line-utilities", "wasm"]
readme = "../../README.md"
Expand Down
14 changes: 4 additions & 10 deletions crates/capsule-cli/docs/README-pypi.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# capsule-run

**A secure, durable runtime for agentic workflows**
# `capsule`

## Overview

Capsule is a runtime for coordinating AI agent tasks in isolated environments. It is designed to handle untrusted code execution, long-running workflows, large-scale processing, or even multi-agent systems.

Each task runs inside its own WebAssembly sandbox, providing:
`Capsule` is a runtime for executing untrusted code in isolated environments. Each task runs inside its own WebAssembly sandbox, providing:

- **Isolated execution**: Each task runs isolated from your host system
- **Resource limits**: Set CPU, memory, and timeout limits per task
- **Automatic retries**: Handle failures without manual intervention
- **Lifecycle tracking**: Monitor which tasks are running, completed, or failed

This enables safe task-level execution of untrusted code within AI agent systems.

## Installation

```bash
Expand Down Expand Up @@ -251,5 +245,5 @@ def main() -> dict:

## Links

- [GitHub](https://github.com/mavdol/capsule)
- [Issues](https://github.com/mavdol/capsule/issues)
- [GitHub](https://github.com/capsulerun/capsule)
- [Issues](https://github.com/capsulerun/capsule/issues)
14 changes: 4 additions & 10 deletions crates/capsule-cli/npm/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# capsule

**A secure, durable runtime for agentic workflows**
# `capsule`

## Overview

Capsule is a runtime for coordinating AI agent tasks in isolated environments. It is designed to handle untrusted code execution, long-running workflows, large-scale processing, or even multi-agent systems.

Each task runs inside its own WebAssembly sandbox, providing:
`Capsule` is a runtime for executing untrusted code in isolated environments. Each task runs inside its own WebAssembly sandbox, providing:

- **Isolated execution**: Each task runs isolated from your host system
- **Resource limits**: Set CPU, memory, and timeout limits per task
- **Automatic retries**: Handle failures without manual intervention
- **Lifecycle tracking**: Monitor which tasks are running, completed, or failed

This enables safe task-level execution of untrusted code within AI agent systems.

## Installation

```bash
Expand Down Expand Up @@ -282,5 +276,5 @@ export const main = task({

## Links

- [GitHub](https://github.com/mavdol/capsule)
- [Issues](https://github.com/mavdol/capsule/issues)
- [GitHub](https://github.com/capsulerun/capsule)
- [Issues](https://github.com/capsulerun/capsule/issues)
6 changes: 3 additions & 3 deletions crates/capsule-cli/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@capsule-run/cli",
"version": "0.8.9",
"description": "Secure WASM runtime to isolate and manage AI agent tasks",
"description": "Secure WASM runtime to execute untrusted code",
"bin": {
"capsule": "./bin/capsule.js"
},
Expand All @@ -19,9 +19,9 @@
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/mavdol/capsule.git"
"url": "https://github.com/capsulerun/capsule.git"
},
"homepage": "https://github.com/mavdol/capsule",
"homepage": "https://github.com/capsulerun/capsule",
"publishConfig": {
"access": "public"
},
Expand Down
6 changes: 3 additions & 3 deletions crates/capsule-cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "maturin"
[project]
name = "capsule-run"
version = "0.8.9"
description = "Secure WASM runtime to isolate and manage AI agent tasks"
description = "Secure WASM runtime to execute untrusted code"
readme = "docs/README-pypi.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.10"
Expand Down Expand Up @@ -43,8 +43,8 @@ dependencies = [
]

[project.urls]
Homepage = "https://github.com/mavdol/capsule"
Repository = "https://github.com/mavdol/capsule"
Homepage = "https://github.com/capsulerun/capsule"
Repository = "https://github.com/capsulerun/capsule"

[tool.maturin]
bindings = "bin"
Expand Down
2 changes: 1 addition & 1 deletion crates/capsule-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "capsule")]
#[command(version)]
#[command(about = "A secure, durable runtime for AI agents", long_about = None)]
#[command(about = "A secure, durable runtime for untrusted code", long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
Expand Down
4 changes: 2 additions & 2 deletions crates/capsule-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name = "capsule-core"
version = "0.8.9"
edition = "2024"
description = "Core library for Capsule - WASM runtime for AI agent isolation"
description = "Core library for Capsule"
license = "Apache-2.0"
repository = "https://github.com/mavdol/capsule"
repository = "https://github.com/capsulerun/capsule"
keywords = ["webassembly", "sandbox", "isolation", "runtime", "wasm"]
categories = ["wasm"]
readme = "../../README.md"
Expand Down
16 changes: 5 additions & 11 deletions crates/capsule-sdk/javascript/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
# capsule

**A secure, durable runtime for agentic workflows**
# `capsule`

## Overview

Capsule is a runtime for coordinating AI agent tasks in isolated environments. It is designed to handle untrusted code execution, long-running workflows, large-scale processing, or even multi-agent systems.

Each task runs inside its own WebAssembly sandbox, providing:
```Capsule``` is a runtime for executing untrusted code in isolated environments. Each task runs inside its own WebAssembly sandbox, providing:

- **Isolated execution**: Each task runs isolated from your host system
- **Resource limits**: Set CPU, memory, and timeout limits per task
- **Automatic retries**: Handle failures without manual intervention
- **Lifecycle tracking**: Monitor which tasks are running, completed, or failed

This enables safe task-level execution of untrusted code within AI agent systems.

## Installation

```bash
Expand Down Expand Up @@ -194,7 +188,7 @@ Create a `capsule.toml` file in your project root to set default options:

```toml
[workflow]
name = "My AI Workflow"
name = "My Workflow"
version = "1.0.0"
entrypoint = "src/main.ts" # Run `capsule run` without specifying a file

Expand Down Expand Up @@ -282,5 +276,5 @@ export const main = task({

## Links

- [GitHub](https://github.com/mavdol/capsule)
- [Issues](https://github.com/mavdol/capsule/issues)
- [GitHub](https://github.com/capsulerun/capsule)
- [Issues](https://github.com/capsulerun/capsule/issues)
6 changes: 3 additions & 3 deletions crates/capsule-sdk/javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@capsule-run/sdk",
"version": "0.8.9",
"description": "Capsule JavaScript SDK - run AI agent tasks in secure WASM sandboxes",
"description": "Capsule JavaScript SDK - Execute untrusted code in secure WASM sandboxes",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"homepage": "https://github.com/mavdol/capsule",
"homepage": "https://github.com/capsulerun/capsule",
"repository": {
"type": "git",
"url": "https://github.com/mavdol/capsule.git"
"url": "https://github.com/capsulerun/capsule.git"
},
"exports": {
".": {
Expand Down
8 changes: 4 additions & 4 deletions crates/capsule-sdk/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "capsule"
version = "0.8.9"
description = "Capsule Python SDK - run AI agent tasks in secure WASM sandboxes"
description = "Capsule Python SDK - run untrusted code in secure WASM sandboxes"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
Expand Down Expand Up @@ -45,9 +45,9 @@ dev = [
]

[project.urls]
Homepage = "https://github.com/mavdol/capsule"
Repository = "https://github.com/mavdol/capsule"
Documentation = "https://github.com/mavdol/capsule"
Homepage = "https://github.com/capsulerun/capsule"
Repository = "https://github.com/capsulerun/capsule"
Documentation = "https://github.com/capsulerun/capsule"

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript/dialogue-evaluator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dialogue Evaluator

GitHub Repository: https://github.com/mavdol/capsule
GitHub Repository: https://github.com/capsulerun/capsule

This example demonstrates how to build a multi-task workflow in that processes data, interacts with an external LLM, and manages file I/O.
We're creating many tiny agents that evaluate video game dialogue emotions and save them in a CSV.
Expand Down
6 changes: 3 additions & 3 deletions integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This directory contains integrations for Capsule with popular AI frameworks and

## Available Integrations

- [MCP Server](https://github.com/mavdol/capsule/tree/main/integrations/mcp-server) - Model Context Protocol server implementation
- [Python adapter](https://github.com/mavdol/capsule/tree/main/integrations/python-adapter) - Adapter to run Python/JavaScript code from your Python applications
- [Typecript adapter](https://github.com/mavdol/capsule/tree/main/integrations/typescript-adapter) - Adapter to run Python/JavaScript code from your Typescript applications
- [MCP Server](https://github.com/capsulerun/capsule/tree/main/integrations/mcp-server) - Model Context Protocol server implementation
- [Python adapter](https://github.com/capsulerun/capsule/tree/main/integrations/python-adapter) - Adapter to run Python/JavaScript code from your Python applications
- [Typecript adapter](https://github.com/capsulerun/capsule/tree/main/integrations/typescript-adapter) - Adapter to run Python/JavaScript code from your Typescript applications

## External Integrations

Expand Down
8 changes: 4 additions & 4 deletions integrations/mcp-server/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `Capsule` MCP Server

[![MCP Server Release](https://github.com/mavdol/capsule/actions/workflows/mcp-integration-release.yml/badge.svg)](https://github.com/mavdol/capsule/actions/workflows/mcp-integration-release.yml)
[![MCP Server Release](https://github.com/capsulerun/capsule/actions/workflows/mcp-integration-release.yml/badge.svg)](https://github.com/capsulerun/capsule/actions/workflows/mcp-integration-release.yml)

Give your AI agent the ability to write and run Python and JavaScript code, in a secure sandbox.
Give your agent the ability to write and run Python and JavaScript code, in a secure sandbox.

Every execution happens inside its own WebAssembly sandbox with strict resource limits. No file system access, no risk to your host system.

Expand All @@ -15,7 +15,7 @@ Every execution happens inside its own WebAssembly sandbox with strict resource

### Example

Ask your AI agent:
Ask your agent:

> *"I have monthly revenue of [12400, 15800, 14200, 18900, 21000, 19500]. What's the average and which month grew the most?"*

Expand Down Expand Up @@ -56,7 +56,7 @@ The server ships two pre-compiled WebAssembly modules: one for Python, one for J
- **CPU/Ram limits** — fuel-metered execution prevents runaway loops
- **No host access** — no filesystem or network unless explicitly allowed

Learn more about [Capsule](https://github.com/mavdol/capsule).
Learn more about [Capsule](https://github.com/capsulerun/capsule).

## Limitations

Expand Down
4 changes: 2 additions & 2 deletions integrations/mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
},
"repository": {
"type": "git",
"url": "https://github.com/mavdol/capsule.git"
"url": "https://github.com/capsulerun/capsule.git"
},
"homepage": "https://github.com/mavdol/capsule",
"homepage": "https://github.com/capsulerun/capsule",
"scripts": {
"build:ts": "tsc",
"build:wasm:py": "capsule build src/python_sandbox.py --export && mv src/python_sandbox.wasm dist/sandboxes/python_sandbox.wasm",
Expand Down
4 changes: 2 additions & 2 deletions integrations/python-adapter/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `Capsule` Python Adapter

[![Python Adapter Release](https://github.com/mavdol/capsule/actions/workflows/python-adapter-release.yml/badge.svg)](https://github.com/mavdol/capsule/actions/workflows/python-adapter-release.yml)
[![Python Adapter Release](https://github.com/capsulerun/capsule/actions/workflows/python-adapter-release.yml/badge.svg)](https://github.com/capsulerun/capsule/actions/workflows/python-adapter-release.yml)

Execute Python and JavaScript code securely inside Capsule sandboxes from your Python applications.

Expand Down Expand Up @@ -138,4 +138,4 @@ async with Session() as s:

The adapter compiles Python and JavaScript sandboxes into WebAssembly modules during the build step. When you call `run_python()` or `run_javascript()`, the adapter invokes these pre-built sandboxes using Capsule's runner with the code you provide.

Learn more about [Capsule](https://github.com/mavdol/capsule).
Learn more about [Capsule](https://github.com/capsulerun/capsule).
Loading
Loading