← Back to blog
AiAbout 7 min read

Rune is a Rust UI framework built so an agent can check its own work

Published Nov 15, 2026
Rune is a Rust UI framework built so an agent can check its own work

Rune is a Rust UI framework from Anomaly. 7,199 stars as of 15 November 2026, MIT licensed, native and GPU rendered on macOS, Windows, Linux and the web, with its own renderer, text stack, layout engine and springs. Most of that is table stakes. One line in the README is not.

> Every app can run headless, so an agent can render to PNG, dump the element tree and drive it with scripted input.

And then:

Give your coding agent this repo. Have it start from examples/hello and crates/rune/README.md, then check its own work headlessly by rendering PNGs and inspecting the element tree.

That reads like setup notes for a build tool, except the thing documented is a user interface.

The sample is a switch, and the metadata is the interesting part

The hello example is a light switch. Trimmed:

fn view(s: &State, _: &mut Cx<State>) -> El {
    let t = tok::theme(true);
    let label = text(if s.on { "Lights on" } else { "Lights off" })
        .font(type_::TITLE).color(t.text);
    let knob = el().key("knob").size(18.0, 18.0).radius(9.0).fill(t.knob)
        .absolute(if s.on { 18.0 } else { 2.0 }, 2.0);
    let switch = el().key("switch").role("switch").label("Lights").checked(s.on)
        .focusable(true).size(38.0, 22.0).radius(11.0)
        .fill(if s.on { tok::accent(0, true) } else { t.control_off })
        .motion(motion::SNAPPY)
        .on_press(|s: &mut State| s.on = !s.on)
        .child(knob);
    col().w_full().h_full().center().gap(16.0).fill(t.bg)
        .child(label).child(switch)
}

The signature is a function from state and a context to an element tree. Theming runs through tok::theme(true) for dark and tok::accent() for the highlight, a value you pass rather than a file you load. Properties are typed and chained: .font, .color, .size, .radius, .fill, .absolute, .key, .role, .label, .checked, .focusable, .on_press. A .motion(motion::SNAPPY) preset on the container is where the springs attach.

Five offset sheets of etched acrylic in a rack, their outlines stacking into one legible structure.

Look at what is declared on that switch. .key("switch"), .role("switch"), .label("Lights"), .checked(s.on), .focusable(true). Every one is accessibility metadata, there so a screen reader can say "Lights, switch, on" instead of "unlabeled element". They are also the assertions a test loop wants: find the node keyed switch, confirm role is switch, confirm checked flipped from false to true, confirm the knob's absolute x moved from 2.0 to 18.0.

I doubt anyone wrote .role() with an agent in mind. It falls out of the fact that a screen reader and a language model need the same two things: a stable name for a piece of the tree, and a declared state to compare against. Accessibility was the first consumer that needed machine-readable semantics. Agents are the second, and they inherit the vocabulary free.

A PNG is a weak signal, a tree is a strong one

A screenshot is a lossy channel for a text model. You can feed a PNG back into a multimodal model and get an answer about whether it looks right. That answer is not diffable and not stable. Move a button two pixels and the verdict might flip for no reason. Change the label to something misleading and the verdict might not change at all.

An element tree behaves differently. It is text, it is ordered, it has keys, and a diff between two dumps is a list of specific changes. An agent can assert on it the way a test asserts on JSON: this key exists, this role is set, this text node contains that string. Checkable signals are what let a loop run more than one iteration without a human in the middle.

The catch is that a headless render proves the pixels exist, and proves the tree matches the tree you expected. It does not prove the layout reads well. A 38 by 22 switch with an 18 by 18 knob inside an 11 radius track satisfies every assertion in that sample and still looks wrong at a larger font size, or crowds the label at gap 16.0, or sits off center in a wide window.

An agent can verify that it built what it meant to build. It cannot verify that what it meant to build was good. The project makes the mechanical half of UI work verifiable and leaves the taste half where it was.

Installation is a git revision, and Windows wants dlltool

Rune is pre-release. You do not add it by version number:

rune = { git = "https://github.com/anomalyco/rune", rev = "<dev rev>" }

The README says to pin a rev of dev, and that dev is never rewritten. That is a stronger promise than semver in one narrow way, since a rev is immutable and a build that worked yesterday still resolves today. It is a weaker promise in the obvious way, because there are no published versions and no guarantee the API you pinned resembles the one on dev next month.

On Windows there is a specific trap. The MSVC toolchain, rustup's default, needs only the Visual Studio C++ build tools. The GNU toolchain also needs MinGW-w64 binutils on PATH, and the reason is layered: windows-link, which sits under parking_lot, libloading, windows-core and windows-sys, so under every Windows UI crate, imports with raw-dylib; rustc builds those import libraries with dlltool on GNU targets; and the dlltool inside rustup's rust-mingw cannot run without an as it does not ship, which is rust-lang/rust#140704. The build stops at windows-result with "error calling dlltool 'dlltool.exe': program not found".

The fix is in the README, which is more than most projects manage: install MSYS2, run pacman -S mingw-w64-ucrt-x86_64-binutils, put C:\msys64\ucrt64\bin on PATH, or pass RUSTFLAGS=-Cdlltool=C:\msys64\ucrt64\bin\dlltool.exe. The underlying bug belongs to rustup's packaging, but the cost lands on Rune's first hour for anyone on the GNU toolchain.

No pull requests

From the README, verbatim:

> We don't take pull requests. Have your agent open an issue describing the bug or idea, and our agents usually turn it around fast.

This is the first contribution section I have read that closes a door and opens a different one in the same breath. As a statement about who writes software next, it fits everything above. If the workflow is already agent-driven, a human pull request arrives in a shape that does not fit the pipeline. An issue in prose does.

As a bet about a project you might depend on, it is riskier. No pull requests means no outside contributor ever learns the codebase well enough to become a maintainer. The bus factor stays whatever it was on day one: whoever sits behind Anomaly, plus their agents. And "our agents usually turn it around fast" is a claim you cannot audit from outside.

None of that makes the choice wrong. It makes it a choice with a cost, and the cost lands on anyone who adopts a pre-release framework and expects a community to form around it. Communities form around contribution paths. This one is deliberately narrow.

The pattern is bigger than one repo

The features I now look for in a new tool aimed partly at agents make a short list: headless rendering so output can be inspected without a display, a deterministic element tree instead of an opaque framebuffer, scripted input so a loop can click without a mouse, and a pinned revision so the loop can reproduce yesterday. Rune has all four and leads with them.

That ordering is the news. The API still serves humans, since somebody has to read the view function and decide the switch should be 38 pixels wide. But the constraint that shaped the headless mode, the element dump and the input scripting was a consumer that cannot see. A framework whose first reader is a loop looks different from one whose first reader is a person. The demo folder says how far it goes: a coding-agent app, a chat interface, a split diff, a liquid metal effect, a settings window. That is the furniture of the tools people now use to write software.

Concrete thing to try if you have an afternoon: take the switch example, render it headlessly at 100 percent and at 150 percent scaling, dump both trees, diff them, and count how much of the difference is layout against text metrics. That diff tells you more about whether Rune is ready for your project than the star count does.

Related articles