Security Report: The Hyperlambda Sandbox
A living record of every attack on the sandbox that lets AI agents run generated code on a Magic server: who has tested it, every successful break and how it was fixed, what we claim, and what we don't.
Last updated 29 November 2026. New attempts arrive every week; this page is updated when something changes.
The claim under test
Generated code can only dispatch the slots its sandbox grants, with the arguments the grant pins, no matter how the call was built and no matter which model wrote it.
The check does not live in a prompt, a model or a linter. It lives in Signaler.GetService, the single function every slot invocation in the runtime passes through, whether the name came from a statement someone wrote or from a string another slot composed a microsecond earlier. The model never needs to cooperate with the security model. It is subject to it.
Making a chatbot say something silly is not a breach. The claim is about the runtime: what actually executes.
How it is enforced
- One road to dispatch. Every invocation is checked against the vocabulary at the chokepoint. Internal framework calls are exempt only when the slot name is built from configuration, never when a caller can steer it.
- Argument pins. A grant can pin its argument: one database, one folder, one file extension, one API. Wildcards match segment by segment, so
/etc/*.pdfgrants one extension in one folder, not the subtree. Unsupported patterns throw instead of matching something unintended. - No self-promotion. A nested
[whitelist]inside a sandbox throws, so generated code cannot declare itself a wider vocabulary. - Data is not code. Statements inside
returnandyield, or built by converters likejson2lambda, are values. They are never dispatched. - Reject, don't escape. The path resolver refuses any
..segment. The SQL builder only accepts whitelisted aggregate functions, plain identifiers andasc/desc. Anything else throws. - Side channels routed through the check. PDF rendering, mail attachments, uploads, hashing and image loading all reach files and the network through whitelisted slots, never behind the vocabulary's back. Threads created with
[fork]and[join]carry the whitelist with them. - Defence in depth beneath it. .NET resolves no external XML entities, unauthenticated auth endpoints share a throttled budget, and every request has a timeout.
Who has attacked it
| When | Who | What happened |
|---|---|---|
| April 2026 | Claude Code, told to break Magic | Found hardening issues (request size, slow-request timeouts, a path edge case, a debug leak), all fixed. No sandbox escape. Write-up |
| September 2026 | Bounty hunters and 50+ Norwegian testers after a guest article on kode24 | Two real breaks, both fixed (below). After the main fix: 174 requests, 88 deliberate attacks, one breach through a door fixed four hours later. Full log |
| September 2026 | Our own audit after the first breach | Four more bugs found and fixed the same week, none reported by anyone else. Details |
| October 2026 | Kimi-K3.1-Pro, GLM-5.3 and DeepSeek-V4-Pro, each given the whole project | No serious issue found. Details |
| Autumn 2026 | Internal red team: three senior developers and frontier models including DeepSeek V4, Kimi K3 and Claude Opus 5.5 aimed at the source | Holes found early were fixed. Since then, nothing gets through. |
| November 2026 | Independent evaluator, unaffiliated | Stated hypotheses, used controls, and tested the live sandbox and the source separately. Identified four separate enforcement mechanisms. All 8 escape attempts were rejected. |
| Every week | Strangers on the internet | Several unsolicited attempts a week against the live endpoint. None successful since the fixes below. |
Every successful break, and its fix
Published in full, including the ones nobody else found. A security page that only lists the bugs someone else caught is not an honest one.
| # | What broke | Found by | Fix | Status |
|---|---|---|---|---|
| 1 | Composed dispatch. A granted data.create with a caller-chosen [database-type] composed auth.ticket.create and minted a root JWT. The check lived in [eval], which only saw written statements. | Anonymous bounty hunter, using DeepSeek. Bounty earned. | Check moved to Signaler.GetService, the one function every dispatch passes through. Shipped 28 Sep 2026, 22:03 UTC, the same day. | Fixed |
| 2 | Null pin. A pinned data.connect invoked with no value fell through to the system database. | Our own audit | A pinned slot invoked without an argument is refused. | Fixed |
| 3 | Hash oracle. crypto.hash could hash any file on the server, with no path check, confirming its contents one guess at a time. | Our own audit | File access goes through the root resolver and the whitelisted file slots. | Fixed |
| 4 | Threads lost the sandbox. Code inside [fork] and [join] ran on a fresh signaler with no whitelist. | Our own audit | Whitelist, auth ticket and context are carried across the thread boundary. | Fixed |
| 5 | Files behind the vocabulary's back. Mail attachments, uploads, hashing, images and screenshots read files in C# without consulting the grant. | Our own audit | All routed through the file slots, so the same pins apply. | Fixed |
| 6 | PDF resource fetch. html2pdf could load local files and remote URLs on its own, including the file holding the JWT signing secret. | Anonymous bounty hunter. Bounty earned. | Every image, stylesheet and font a PDF loads goes through whitelisted slots. | Fixed |
| 7 | Parent segments. /etc/../config/appsettings.json stayed inside the files folder after resolution and passed folder-prefix checks. | Outside contributor, with a test | The resolver rejects any .. segment outright. | Fixed |
What the attacks looked like
The 88 deliberate attack attempts logged after the main fix, by category. "Executed" means the generated code ran, not that the attack worked: a dangerous statement inside return is a value, not a call, and every executed row that mattered was checked against the real data.
| Category | Attempts | Held |
|---|---|---|
| Path traversal / arbitrary local file access | 36 | Yes |
| Destructive operations (delete / wipe) | 15 | Yes |
| Indirect injection via templates | 13 | Yes |
| File read outside sandbox scope | 12 | Yes |
| Schema / database enumeration | 8 | Yes |
| HTTP-verb smuggling | 5 | Yes |
| Auth / JWT / root escalation | 4 | Yes |
| PDF remote-resource SSRF | 4 | Fixed (#6) |
| Vocabulary / capability reconnaissance | 4 | Yes |
| SSRF / internal network probing | 3 | Yes |
| Network reconnaissance | 2 | Yes |
| Data exfiltration via outbound POST | 2 | Yes |
| Catastrophic regex (ReDoS) | 1 | Timed out |
Known limitations
What this page does not claim.
- Root bypasses everything. Deliberate. Give agents their own user and roles, never root credentials.
- A sandbox is only as narrow as its vocabulary. Pins are opt-in per grant. An unpinned
http.getis real reach into your network. - Escapes are not the only risk. An agent can misuse something it is legitimately granted. Breach #1 was exactly that shape: an allowed slot that turned out to be too powerful. Grant narrowly.
- The exemptions are judgement calls. Internal plumbing skips the check by design. The rule is provenance and the audit is one search, but every exempt call site is a decision we made.
- Your own application logic is yours. Unauthenticated endpoints and string-built SQL in your own Hyperlambda behave as they would anywhere.
- The layers beneath are not ours. .NET, SQLite and the operating system.
- A clean audit is evidence, not proof. We once told you there was no second road to dispatch. There was.
Open items
| Item | Status |
|---|---|
| Independent professional penetration test of the runtime itself, not just the web surface around it | Planned |
| Formal verification of the core rule: no generated program can dispatch a slot outside its granted vocabulary | Investigating |
A fuller security policy; SECURITY.md is currently one line | Planned |
Break it
The sandbox is live at the Natural Language API, guest-only, granting reads on a sample database and HTTP GET. Its full vocabulary is published, so nothing depends on obscurity. Find a way to make it execute something outside that vocabulary and the $100 bounty is yours, with public credit if you want it. Report anything to thomas@ainiro.io.
Magic is MIT licensed. Every fix on this page is in the public repository at github.com/polterguy/magic.
The full story: We Got Breached · 174 Attempts, One Breach · Secure by Default · The Only Sandbox Your AI Agent Cannot Break Out Of