Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Newegg’s Ryzen 7 9850X3D combo bundle offers over $500 in savings on three key components, including 64GB DDR5 RAM

    Tenku Pocket 8 micro laptop launched with 8-inch touch display and 8-core Intel Alder Lake-N CPU

    Endorfy Signum M30 Air and M30 ARGB arrive as brand-new micro ATX PC towers

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Tensions between the Pentagon and AI giant Anthropic reach a boiling point

      February 21, 2026

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026
    • Business

      How Smarsh built an AI front door for regulated industries — and drove 59% self-service adoption

      February 24, 2026

      Where MENA CIOs draw the line on AI sovereignty

      February 24, 2026

      Ex-President’s shift away from Xbox consoles to cloud gaming reportedly caused friction

      February 24, 2026

      Gartner: Why neoclouds are the future of GPU-as-a-Service

      February 21, 2026

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026
    • Crypto

      BitMine Buys $93 Million in ETH, but Ethereum Slides as Holders Resume Selling

      February 24, 2026

      XRP Ledger Sets Multiple Key Records in February Despite Price Decline

      February 24, 2026

      Bhutan Rolls Out Solana-Backed Visas Even As Demand Stays Weak

      February 24, 2026

      ZachXBT Teases Major Crypto Exposé Ahead of Feb. 26 — How Is Smart Money Positioned?

      February 24, 2026

      Acurast turns 225,000 smartphones into a secure AI network on Base

      February 24, 2026
    • Technology

      Newegg’s Ryzen 7 9850X3D combo bundle offers over $500 in savings on three key components, including 64GB DDR5 RAM

      February 25, 2026

      Tenku Pocket 8 micro laptop launched with 8-inch touch display and 8-core Intel Alder Lake-N CPU

      February 25, 2026

      Endorfy Signum M30 Air and M30 ARGB arrive as brand-new micro ATX PC towers

      February 25, 2026

      Ditch the Adobe subscription: This PDF editor is yours for life for $25

      February 25, 2026

      Her AI agent nuked 200 emails. This guardrail stops the next disaster

      February 25, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»Show HN: Amla Sandbox – WASM bash shell sandbox for AI agents
    Technology

    Show HN: Amla Sandbox – WASM bash shell sandbox for AI agents

    TechAiVerseBy TechAiVerseJanuary 30, 2026No Comments2 Mins Read1 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Show HN: Amla Sandbox – WASM bash shell sandbox for AI agents
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    Show HN: Amla Sandbox – WASM bash shell sandbox for AI agents

    amla-sandbox

    Every popular agent framework runs LLM-generated code via subprocess or exec(). That’s arbitrary code execution on your host. One prompt injection and you’re done.

    Framework Execution Method Source
    LangChain exec(command, globals, locals) CVE-2025-68664, GitHub #5294
    AutoGen subprocess.run() Code Executors docs
    SWE-Agent subprocess.run(["bash", ...]) SWE-ReX

    Some frameworks offer Docker isolation (OpenHands, AutoGen), but that requires running a Docker daemon and managing container infrastructure.

    amla-sandbox is a WASM sandbox with capability enforcement. Agents can only call tools you explicitly provide, with constraints you define. Sandboxed virtual filesystem. No network. No shell escape.

    uv pip install "git+https://github.com/amlalabs/amla-sandbox"

    No Docker. No VM. One binary, works everywhere.

    t.disputed);
    console.log(disputed[0]);
    ”’, language=”javascript”)

    # Or with shell pipelines
    result = sandbox.run(”’
    tool stripe.listTransactions –customer cus_123 | jq ‘[.[] | select(.disputed)] | .[0]’
    ”’, language=”shell”)”>

    from amla_sandbox import create_sandbox_tool
    
    sandbox = create_sandbox_tool(tools=[stripe_api, database])
    
    # Agent writes one script instead of 10 tool calls (JavaScript)
    result = sandbox.run('''
        const txns = await stripe.listTransactions({customer: "cus_123"});
        const disputed = txns.filter(t => t.disputed);
        console.log(disputed[0]);
    ''', language="javascript")
    
    # Or with shell pipelines
    result = sandbox.run('''
        tool stripe.listTransactions --customer cus_123 | jq '[.[] | select(.disputed)] | .[0]'
    ''', language="shell")

    Why this matters

    Tool-calling is expensive. Every MCP call is a round trip through the model:

    LLM → tool → LLM → tool → LLM → tool → ...
    

    Ten tool calls = ten LLM invocations. Code mode collapses this:

    LLM → script that does all 10 things → result
    

    But you can’t just eval whatever the model spits out. So people either pay the token tax or run unsafe code. This gives you both: code-mode efficiency with actual isolation.

    Security model

    The sandbox runs inside WebAssembly with WASI for a minimal syscall interface. WASM provides memory isolation by design—linear memory is bounds-checked, and there’s no way to escape to the host address space. The wasmtime runtime we use is built with defense-in-depth and has been formally verified for memory safety.

    On top of WASM isolation, every tool call goes through capability validation:

    from amla_sandbox import Sandbox, MethodCapability, ConstraintSet, Param
    
    sandbox = Sandbox(
        capabilities=[
            MethodCapability(
                method_pattern="stripe/charges/*",
                constraints=ConstraintSet([
                    Param("amount") <= 10000,
                    Param("currency").is_in(["USD", "EUR"]),
                ]),
                max_calls=100,
            ),
        ],
        tool_handler=my_handler,
    )
    
    # This works
    sandbox.execute('await stripe.charges.create({amount: 500, currency: "USD"})')
    
    # This fails - amount exceeds capability
    sandbox.execute('await stripe.charges.create({amount: 50000, currency: "USD"})')

    The design draws from capability-based security as implemented in systems like seL4—access is explicitly granted, not implicitly available. Agents don’t get ambient authority just because they’re running in your process. This matters because prompt injection is a fundamental unsolved problem; defense in depth through capability restriction limits the blast radius.

    Quick start

    “HELLO”

    # Shell
    sandbox.run(“echo ‘hello’ | tr ‘a-z’ ‘A-Z'”, language=”shell”) # -> “HELLO”

    # With tools
    def get_weather(city: str) -> dict:
    return {“city”: city, “temp”: 72}

    sandbox = create_sandbox_tool(tools=[get_weather])
    sandbox.run(“const w = await get_weather({city: ‘SF’}); console.log(w);”, language=”javascript”)”>

    from amla_sandbox import create_sandbox_tool
    
    sandbox = create_sandbox_tool()
    
    # JavaScript
    sandbox.run("console.log('hello'.toUpperCase())", language="javascript")  # -> "HELLO"
    
    # Shell
    sandbox.run("echo 'hello' | tr 'a-z' 'A-Z'", language="shell")  # -> "HELLO"
    
    # With tools
    def get_weather(city: str) -> dict:
        return {"city": city, "temp": 72}
    
    sandbox = create_sandbox_tool(tools=[get_weather])
    sandbox.run("const w = await get_weather({city: 'SF'}); console.log(w);", language="javascript")

    With constraints:

    sandbox = create_sandbox_tool(
        tools=[transfer_money],
        constraints={
            "transfer_money": {
                "amount": "<=1000",
                "currency": ["USD", "EUR"],
            },
        },
        max_calls={"transfer_money": 10},
    )

    JavaScript API Notes

    Tools require object syntax:

    // WORKS - tools always take an object argument
    await get_weather({city: "SF"});
    await transfer({to: "alice", amount: 500});
    
    // FAILS - positional arguments don't work
    await get_weather("SF");  // Error: argument after ** must be a mapping

    Use return or console.log() for output:

    {“city”:”SF”,”temp”:72}
    return {a: 1, b: 2}; // -> {“a”:1,”b”:2}
    return “hello”; // -> hello (strings not double-quoted)

    // console.log also works
    console.log(JSON.stringify({a: 1})); // -> {“a”:1}

    // No return = no output
    const x = 42; // -> (no output)”>

    // Return value is captured and output
    return await get_weather({city: "SF"});  // -> {"city":"SF","temp":72}
    return {a: 1, b: 2};  // -> {"a":1,"b":2}
    return "hello";  // -> hello (strings not double-quoted)
    
    // console.log also works
    console.log(JSON.stringify({a: 1}));  // -> {"a":1}
    
    // No return = no output
    const x = 42;  // -> (no output)

    VFS is writable only under /workspace and /tmp:

    // WORKS - /workspace and /tmp are ReadWrite
    await fs.writeFile('/workspace/data.json', '{}');
    await fs.mkdir('/tmp/cache');
    
    // FAILS - root is read-only
    await fs.mkdir('/mydir');  // EACCES: Permission denied

    LangGraph

    For LangGraph integration:

    from langgraph.prebuilt import create_react_agent
    from langchain_anthropic import ChatAnthropic
    from amla_sandbox import create_sandbox_tool
    
    sandbox = create_sandbox_tool(tools=[get_weather, search_db])
    agent = create_react_agent(
        ChatAnthropic(model="claude-sonnet-4-20250514"),
        [sandbox.as_langchain_tool()]  # LLM writes JS/shell that calls your tools
    )

    For fine-grained capability control:

    from amla_sandbox import SandboxTool, MethodCapability, ConstraintSet, Param
    
    caps = [
        MethodCapability(
            method_pattern="mcp:search_db",
            constraints=ConstraintSet([Param("query").starts_with("SELECT")]),
            max_calls=5,
        )
    ]
    
    sandbox_tool = SandboxTool.from_functions([search_db], capabilities=caps)
    agent = create_react_agent(model, [sandbox_tool.as_langchain_tool()])

    Architecture

    ┌────────────────────────────────────────────────┐
    │              WASM Sandbox                      │
    │  ┌──────────────────────────────────────────┐  │
    │  │         Async Scheduler                  │  │
    │  │   tasks waiting/running/ready            │  │
    │  └──────────────────────────────────────────┘  │
    │  ┌────────────┐ ┌──────────┐ ┌──────────────┐  │
    │  │  VFS       │ │ Shell    │ │ Capabilities │  │
    │  │ /workspace │ │ builtins │ │ validation   │  │
    │  └────────────┘ └──────────┘ └──────────────┘  │
    │                    ↓ yield                     │
    └════════════════════════════════════════════════┘
                         │
                         ▼
    ┌─────────────────────────────────────────────┐
    │              Python Host                    │
    │                                             │
    │   while sandbox.has_work():                 │
    │       req = sandbox.step()  # tool call     │
    │       sandbox.resume(execute(req))          │
    │                                             │
    └─────────────────────────────────────────────┘
    

    The sandbox yields on tool calls. Host executes them (after capability checks) and resumes. QuickJS runs inside WASM for the JS runtime.

    Precompilation

    First run compiles the WASM module (~300ms). Cache it:

    Subsequent loads: ~0.5ms.

    Constraint DSL

    = 100,
    Param(“amount”) <= 10000, Param("currency").is_in(["USD", "EUR"]), Param("path").starts_with("/api/"), ])">

    from amla_sandbox import Param, ConstraintSet
    
    constraints = ConstraintSet([
        Param("amount") >= 100,
        Param("amount") <= 10000,
        Param("currency").is_in(["USD", "EUR"]),
        Param("path").starts_with("/api/"),
    ])

    Pattern matching for method names:

    • stripe/charges/create — exact match
    • stripe/charges/* — single path segment
    • stripe/** — zero or more segments

    Tradeoffs

    What you get: Isolation without infrastructure. Capability enforcement. Token efficiency.

    What you don’t get: Full Linux environment. Native module support. GPU access. Infinite loop protection (a while(true){} will hang – the step limit only counts WASM yields, not JS instructions).

    If you need a real VM with persistent state and arbitrary dependencies, use e2b or Modal. amla-sandbox is for the common case: agents running generated code with controlled tool access.

    License

    Python code is MIT. The WASM binary is proprietary—you can use it with this package but can’t extract or redistribute it separately.


    Website · Examples · Docs

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleRichard Feynman Side Hustles
    Next Article Microsoft has already contracted GPUs to balance costs
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    Newegg’s Ryzen 7 9850X3D combo bundle offers over $500 in savings on three key components, including 64GB DDR5 RAM

    February 25, 2026

    Tenku Pocket 8 micro laptop launched with 8-inch touch display and 8-core Intel Alder Lake-N CPU

    February 25, 2026

    Endorfy Signum M30 Air and M30 ARGB arrive as brand-new micro ATX PC towers

    February 25, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025693 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025279 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025160 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025122 Views
    Don't Miss
    Technology February 25, 2026

    Newegg’s Ryzen 7 9850X3D combo bundle offers over $500 in savings on three key components, including 64GB DDR5 RAM

    Newegg’s Ryzen 7 9850X3D combo bundle offers over $500 in savings on three key components,…

    Tenku Pocket 8 micro laptop launched with 8-inch touch display and 8-core Intel Alder Lake-N CPU

    Endorfy Signum M30 Air and M30 ARGB arrive as brand-new micro ATX PC towers

    Samsung Galaxy S26 series go official, 512GB base storage for Malaysia, from RM5199

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Newegg’s Ryzen 7 9850X3D combo bundle offers over $500 in savings on three key components, including 64GB DDR5 RAM

    February 25, 20262 Views

    Tenku Pocket 8 micro laptop launched with 8-inch touch display and 8-core Intel Alder Lake-N CPU

    February 25, 20262 Views

    Endorfy Signum M30 Air and M30 ARGB arrive as brand-new micro ATX PC towers

    February 25, 20262 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.