Case study 08 of 11
Iris
Live, interactive cards inside agent chat
A plugin for the bb agent IDE: agents answer with cards drawn inside the reply, check them before the person sees them, and get the answers back as data.
- Role
- Author and maintainer
- Platform
- bb plugin
- Stack
- TypeScriptReactZodVitest
- Share
Context
Iris is a plugin for bb, the agent IDE, that lets agents answer with live, interactive UI instead of walls of text. The agent writes a short iris block in its reply, and bb draws it as a real card inside the reply: charts you can hover, sliders that recompute, tables you can sort, test runs that fill in while they run, pickers that wait for your answer.
A status report comes back as metrics and a progress bar, proof that work is done as a checklist of criteria with their evidence, and a comparison as a decision whose weights you can drag. Every card takes its colors from the bb theme and follows it when you switch; Iris has no palette of its own.
Role & approach
I built three ways to write a card, from small to large: iris markup (JSX-style, with live values), iris-react (a React module) and iris-app (a full HTML page), over well over a hundred components. The parser builds the card while the reply is still streaming, so each tag draws as it arrives, and a reply that ends early reads as incomplete, never as an error. What agents are told about Iris is generated from the same catalog as the validator and the renderers, so the three can never disagree.
The agent gets nine tools. iris_check validates a card before the person sees it: it reads the card's files, moves every input to its extremes and returns an outline of what the person will see. iris_ask replaces the composer with a picker and sends the answer back as JSON. iris_cards and iris_card_set read what the person set in a card and change it. Up to five cards per thread can be pinned beside the conversation, still live, with alerts that never message the thread or wake the agent.
Agent-written code runs inside tight bounds. Expressions run in a small interpreter of its own that never calls eval, exposes no globals and works under a step budget. Pages and React apps run in a sandboxed iframe with an opaque origin and a no-network content policy injected before anything the agent wrote, and a message a page wants to send waits in a bar outside the frame until the person clicks Send. The README states the known limit: a sandboxed page can still navigate itself.
The instructions are kept small on purpose, since every session pays for them. One change cut what every session pays from about 15,000 tokens to about 3,500: rules and a component index always on, details and examples on demand. An eval suite runs 35 chat moments through Claude Code headless with Iris's real tools, scores whether each answer used a fitting card that checks clean, runs every case twice, and fails the release check when the score drops more than 3 points below its baseline.
Outcome
Iris is open source under the Apache 2.0 license and installs from bb's community marketplace. Its website has a playground that runs Iris's real renderer in the browser; a card opened there carries its source after the # in the link, so no server sees it.
The release process is written down in the repository: the tests, the type check, the site build and the eval gate pass first, then a tag and release notes in plain language.