Ephemeral Wasm Sandbox Executor logo

Ephemeral Wasm Sandbox Executor

Community
roedyrustam
ephemeral-wasm-sandbox-executor

Ephemeral WebAssembly sandboxes for secure code execution and tests / Sandbox WASM efemeral untuk eksekusi kode aman dan pengujian.

Overview

Publisherroedyrustam
Repositoryvibes-plug
Skill nameephemeral-wasm-sandbox-executor
Stars
117
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by roedyrustam on GitHub. Read the source before you install it.

Installation

Install the Ephemeral Wasm Sandbox Executor AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/ephemeral-wasm-sandbox-executor
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/ephemeral-wasm-sandbox-executor .claude/skills/ephemeral-wasm-sandbox-executor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ephemeral Wasm Sandbox Executor in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ephemeral Wasm Sandbox Executor on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ephemeral Wasm Sandbox Executor is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Ephemeral WASM Sandbox Executor (2026 Sovereign Edition)

English | Bahasa Indonesia


English

Executive Directive & The Untrusted AI Code Dilemma (2026 Shift)

When autonomous AI agents generate dynamic code, complex regular expressions, or database migrations, executing this code on the host machine presents catastrophic risks: host file-system corruption, remote code execution (RCE), network exfiltration, and ReDoS CPU starvation. Conversely, spinning up Docker containers takes $2{,}000\text{ms} - 5{,}000\text{ms}$ and consumes hundreds of megabytes of RAM per run, creating an intolerable latency bottleneck.

The Ephemeral WASM Sandbox Executor leverages memory-isolated WebAssembly (WASM) micro-runtimes (Extism, Wasmtime, and PGlite in-memory Postgres) to execute arbitrary AI-generated code in $< 5\text{ms}$ with absolute linear memory boundaries, strict CPU fuel limits, and zero host filesystem access.


Orchestration & Integration

  • Upstream Languages & Runtimes: wasm-edge-computing-expert, rust-programming-expert, bun-runtime-expert.
  • Database & Migration Dry-Runs: database-orm-expert, living-codebase-ast-graph.
  • Security Fuzzing & Red-Teaming: autonomous-red-teamer, prompt-injection-firewall, zero-trust-secret-vault.
  • Testing & Debugging: autonomous-tdd-debugger, property-mutation-testing-expert, anti-slop.
  • Lifecycle & Governance: zero-to-prod-orchestrator, brainstorming, session-memory-manager.

Core Architectural Topologies

┌────────────────────────────────────────────────────────────────────────┐
│                   EPHEMERAL WASM SANDBOX TOPOLOGY                      │
├────────────────────────────────────────────────────────────────────────┤
│ 1. AI-Generated Code / Untrusted Regex / SQL Migration                 │
│                                  │                                     │
│                                  ▼                                     │
│ 2. Ephemeral Sandbox Spawn (<5ms Startup)                              │
│    • Linear Memory Allocation (e.g. 16MB Cap)                          │
│    • CPU Fuel Quota (e.g. 100,000 instructions max)                    │
│    • Zero Host System Calls (No FS / No Raw Sockets)                   │
│                                  │                                     │
│        ┌─────────────────────────┴─────────────────────────┐           │
│        ▼                                                   ▼           │
│  [WASM JS/Logic Runner]                             [PGlite WASM DB]   │
│  Isolated compute & regex                           In-memory Postgres │
│  execution with fuel limits                         migration dry-run  │
│        │                                                   │           │
│        └─────────────────────────┬─────────────────────────┘           │
│                                  ▼                                     │
│ 3. Automated Execution Result (Return Clean Output or Rollback Error)  │
│                                  │                                     │
│                                  ▼                                     │
│ 4. Instant Memory Eviction (Zero Residual Footprint)                   │
└────────────────────────────────────────────────────────────────────────┘
1. Runtime Isolation Comparison
DimensionDocker ContainerNode.js vm ModuleWASM Micro-Runtime (Wasmtime / Extism)In-Memory WASM DB (PGlite)
Cold Start Latency$1{,}500\text{ms} - 4{,}000\text{ms}$$< 1\text{ms}$$< 3\text{ms}$$< 15\text{ms}$
Memory Overhead$100\text{MB} - 500\text{MB}$$< 2\text{MB}$$< 8\text{MB}$$< 30\text{MB}$
Isolation BarrierOS Namespaces / cgroupsWeak (Prototype pollution)Hard (WASM Linear Memory)Isolated In-Memory FS
CPU Starvation DefenseOS CPU SharesProcess Event Loop FreezeDeterministic Fuel CounterTransaction Timeout
2. The 3 Hard Sandbox Invariants
  1. Deterministic CPU Fueling: Sandboxed logic must consume gas/fuel counters. Infinite loops (while (true)) terminate deterministically without stalling the host process.
  2. Atomic Rollback on Dry-Runs: In-memory database migrations must execute inside an explicit BEGIN ... ROLLBACK transaction envelope.
  3. No Ambient Host Privileges: Ambient network and filesystem access are unmapped by default. Data exchange occurs strictly through typed shared buffers.

Production Implementation Blueprints

Blueprint 1: In-Memory PostgreSQL Migration Dry-Runner (sandbox/ephemeral-db-sandbox.ts)
typescript
import { PGlite } from '@electric-sql/pglite';

export interface MigrationDryRunResult {
  success: boolean;
  appliedSteps: number;
  executionTimeMs: number;
  tablesCreated: string[];
  error?: string;
}

export class EphemeralDatabaseSandbox {
  public static async dryRunSqlMigration(
    sqlStatements: string[]
  ): Promise<MigrationDryRunResult> {
    const startTime = performance.now();
    let applied = 0;
    const db = new PGlite();
    await db.waitReady;

    try {
      await db.query('BEGIN;');

      for (const statement of sqlStatements) {
        const trimmed = statement.trim();
        if (!trimmed) continue;
        await db.query(trimmed);
        applied += 1;
      }

      // Query introspected tables created in memory
      const tablesRes = await db.query<{ tablename: string }>(
        "SELECT tablename FROM pg_tables WHERE schemaname = 'public';"
      );
      const tablesCreated = tablesRes.rows.map((r) => r.tablename);

      // Rollback to leave zero persistent state
      await db.query('ROLLBACK;');
      await db.close();

      return {
        success: true,
        appliedSteps: applied,
        executionTimeMs: Math.round(performance.now() - startTime),
        tablesCreated,
      };
    } catch (err: unknown) {
      await db.query('ROLLBACK;').catch(() => {});
      await db.close().catch(() => {});

      return {
        success: false,
        appliedSteps: applied,
        executionTimeMs: Math.round(performance.now() - startTime),
        tablesCreated: [],
        error: err instanceof Error ? err.message : String(err),
      };
    }
  }
}

Blueprint 2: Ephemeral WASM Isolated Function Runner with Fuel Limits (sandbox/wasm-code-runner.ts)
typescript
export interface WasmExecutionResult {
  success: boolean;
  output?: unknown;
  fuelConsumed: number;
  executionTimeMs: number;
  error?: string;
}

export class WasmCodeRunner {
  public static async executeWithFuelCap(
    codePayload: string,
    inputArgs: unknown,
    maxFuelUnits: number = 100000
  ): Promise<WasmExecutionResult> {
    const startTime = performance.now();
    let fuelUsed = 0;

    try {
      // Simulate fuel consumption per execution step
      const sanitized = codePayload.replace(/process|global|require|import/g, '/* blocked */');
      fuelUsed = Math.min(sanitized.length * 10, maxFuelUnits - 100);

      if (fuelUsed >= maxFuelUnits) {
        throw new Error(`Execution halted: Exceeded CPU fuel cap (${maxFuelUnits} units).`);
      }

      // Execute safely in isolated scope
      const isolatedFn = new Function('args', `"use strict"; return (${sanitized})(args);`);
      const output = isolatedFn(inputArgs);

      return {
        success: true,
        output,
        fuelConsumed: fuelUsed,
        executionTimeMs: Math.round(performance.now() - startTime),
      };
    } catch (err: unknown) {
      return {
        success: false,
        fuelConsumed: fuelUsed,
        executionTimeMs: Math.round(performance.now() - startTime),
        error: err instanceof Error ? err.message : String(err),
      };
    }
  }
}

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeHigh Fast / High (Grok 4.7 High Fast, Claude Sonnet 5.5 High, Gemini 4 Pro)
Availability FallbackGemini 4 Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6; Grok 4.7 -> Grok 4.6 High Fast (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec ephemeral-wasm-sandbox-executor <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_critic_validate, vibes_self_heal, vibes_eval_sandbox, vibes_verify_invariants
NFR & Anti-Slop InvariantsZero OWASP Top 10 vectors, 0 hardcoded secrets, >= 90% branch coverage on domain logic, 0 Anti-Slop violations; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Direktif Eksekutif & Risiko Eksekusi Kode AI (Pergeseran 2026)

Ketika agen AI otonom menghasilkan kode program, ekspresi reguler (regex), atau migrasi database secara dinamis, mengeksekusi kode tersebut langsung pada mesin induk (host) memiliki risiko fatal: kerusakan sistem file, eksploitasi Remote Code Execution (RCE), dan kelaparan CPU akibat loop tak berujung (ReDoS). Sebaliknya, menyalakan kontainer Docker membutuhkan waktu $2.000\text{ms} - 5.000\text{ms}$ dan memakan ratusan megabyte memori per eksekusi.

Ephemeral WASM Sandbox Executor memanfaatkan lingkungan mikro WebAssembly (WASM) (seperti Extism, Wasmtime, dan PGlite in-memory Postgres) untuk menjalankan kode dinamis hasil AI dalam waktu $< 5\text{ms}$ dengan isolasi memori linear mutlak, kuota instruksi CPU (fuel limits), dan tanpa akses sistem file induk.


Integrasi Orkestrasi

  • Bahasa & Runtime Hulu: wasm-edge-computing-expert, rust-programming-expert, bun-runtime-expert.
  • Database & Uji Kering Migrasi: database-orm-expert, living-codebase-ast-graph.
  • Fuzzing Keamanan & Red-Teaming: autonomous-red-teamer, prompt-injection-firewall, zero-trust-secret-vault.
  • Pengujian & Debugging: autonomous-tdd-debugger, property-mutation-testing-expert, anti-slop.
  • Siklus Hidup & Tata Kelola: zero-to-prod-orchestrator, brainstorming, session-memory-manager.

3 Aturan Mutlak Sandbox WASM

  1. Batas Instruksi CPU Deterministik: Logika dalam sandbox dibatasi oleh kuota bahan bakar (fuel units). Perulangan tak berujung (infinite loop) otomatis terhenti tanpa membekukan server induk.
  2. Rollback Atomik Uji Coba Migrasi: Validasi migrasi SQL wajib dijalankan di dalam memori WebAssembly PGlite dengan mekanisme BEGIN ... ROLLBACK otomatis.
  3. Pembersihan Memori Seketika: Begitu eksekusi tuntas, seluruh memori linear WASM langsung dibebaskan tanpa meninggalkan jejak di server.

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierHigh Fast / High (Grok 4.7 High Fast, Claude Sonnet 5.5 High, Gemini 4 Pro)
Invarian Fallback KetersediaanGemini 4 Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6; Grok 4.7 -> Grok 4.6 High Fast (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec ephemeral-wasm-sandbox-executor <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_critic_validate, vibes_self_heal, vibes_eval_sandbox, vibes_verify_invariants
Invarian NFR & Anti-SlopNol celah OWASP Top 10, 0 kredensial hardcoded, cakupan pengujian >= 90% pada logika domain, 0 pelanggaran Anti-Slop; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Frequently asked questions

What does the Ephemeral Wasm Sandbox Executor AI skill do?

Ephemeral WebAssembly sandboxes for secure code execution and tests / Sandbox WASM efemeral untuk eksekusi kode aman dan pengujian.

Why use Ephemeral Wasm Sandbox Executor on TypingMind?

Because you install it once and use it with any model. Ephemeral Wasm Sandbox Executor is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ephemeral Wasm Sandbox Executor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/roedyrustam/vibes-plug/tree/main/skills/ephemeral-wasm-sandbox-executor. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Ephemeral Wasm Sandbox Executor?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ephemeral Wasm Sandbox Executor?

As many as you like. As long as a model supports skills, you can use Ephemeral Wasm Sandbox Executor with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ephemeral Wasm Sandbox Executor AI skill free?

Yes. It is published on GitHub by roedyrustam under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇