An Experiment in Agent-Native Software
What if we designed software with intelligent agents as first-class users, rather than figuring out how to bolt them on afterward?
* This article is based on a project I have been working on and thinking about for several months. There's a lot to talk about and this may turn into a few more posts. The project is still under heavy development and I am undecided on whether I will publish the source code.
Software has a new kind of user
Most applications give people a UI and other programs an API.
Agents can work out what we mean, make a judgment about what they're looking at, and put together something nobody spelled out for them. That makes them a different kind of user.
So what do we give an agent? The agent gets the API we built for programs, the web interface we built for people, some documentation and a pile of tools. Then we hope it figures out the rest.
Incredibly, that somehow works better than it probably should. But I kept coming back to one question: how much does the agent actually understand about the application it's working in? I don't mean which endpoints exist. I mean what its numbers mean, what the application is for, how to enter data properly, and what the agent is allowed to touch.
It started with a reporting application
I own a small coffee business and I wanted better reporting than my POS gave me. I started out doing some stuff in Jupyter notebooks. The problem I've always had with Jupyter notebooks is they are incredibly useful for a data analyst and then become clunky when you want to share things with a non-technical person. At the same time, I'm a heavy user of LLM tools and I was curious about having an agent that could see what I was looking at and follow the numbers back to the data. I didn't want a dashboard with a chat window bolted onto the side. I wanted an analyst that lived in my data and noticed things before I did.
That became a project I called Prism and the analyst became Iris.
Prism started out simple. You define a report once and the framework turns it into an application. You get a web page, CSV and PDF exports, and an MCP tool Iris can call to run the report. You don't write routes, templates or glue code. In fact, you hardly write anything at all except calls to a Clojure macro, defreport, which defines reports in a declarative way. Iris could offer her own take on the report I was looking at, answer questions about underlying data and I was feeling like I had a pretty cool setup.
Then the requirements kept changing. I was dreaming, my ambitions were growing, I was confronted with new challenges and I was going down one rabbit hole after another.
First, Iris needed to know what the data meant, not just how to fetch it. Is this column cents or dollars? Gross or net? How do we identify a new customer? She needed to know that gift card activations don't belong in gross revenue. She needed to know that a drawer pop with a $0 transaction shouldn't count as a cover or in average order value. The answers were scattered across SQL queries and my head. I pulled them out into a semantic layer of named metrics she could read.
Next, she needed to know why any of it mattered. At one point, my cost for brownies jumped and I kept selling them at the old price for months because I didn't catch it in a pile of invoices. So I built a vendor database with items and price history, of course completely automated by an agent because there was no way I was going to maintain the database if I was missing things like that price change in the first place. Anyway, with invoice prices in the system, Iris could see price changes. To judge whether the resulting margin was good enough, she needed to know what I was aiming for. So goals and targets became declarations too.
Then she needed to know what the app could do and what she was allowed to do. Permissions became data. I gave her a whoami tool so she could read her own limits instead of finding them by running into walls.
Each time I wanted Iris to do more, I had to put something into the application that had been buried in the code or lived in my head.
The application is the self-model
The usual approach is to build the application and then describe it to the agent. You write tool definitions, a system prompt and some docs. Every time the application changes, it's another thing to maintain or it will drift.
What if the description was the application? By self-model, I mean the definitions the application itself uses to run. In Prism, the same report definition feeds the page and the tool Iris uses to run it.
You can see the difference by tracing where each interface comes from.
Conventional
code βββ¬βββΊ UI ββββββββββββββββββββββΊ people
ββββΊ API βββββββββββββββββββββΊ programs
ββββΊ tools + prompt + docs βββΊ agents (can drift)
Agent-native
ββββΊ web pages βββββββΊ people
application model βββΊ engine βΌβββΊ MCP tools βββββββΊ agents
(plain data) ββββΊ REST / exports ββΊ programs
A simplified comparison. The human and agent interfaces are different materializations of the same application model.
Once Iris could read those definitions, it opened up new possibilities in terms of what I could ask and what she could do. If I ask why margin dropped, she can use the application's definition of margin to investigate the sales data. If I ask for a new margin report, she can reuse that definition in a proposal for a new page. What would it take for the application to accept that proposal and make the page available?
What if the agent could change the model?
I tried it in Prism first, as a narrow proof of concept. A scripted client proposed a margin report over MCP. The engine validated it, I clicked Approve, and Prism wrote a report source file and made the page, exports and MCP tool available without a restart.
It worked. It also showed me the problem. A Prism report could contain a data function written in arbitrary Clojure. Letting an agent write those is remote code execution as a service. The proof of concept worked because I'd fenced it into a tiny, restricted subset.
So I started over. This time I designed the application around what Iris could safely build from the start. That's Daedalus, named after the architect who built the labyrinth and the wings to escape it. And it actually worked.
Here is a demo where I run a test instance with simulated sales data and tell Iris, βSurprise me with something awesome.β She decides what to build and calls it βThe Pulse of the Business.β It brings together a sales overview, a sales forecast, and a menu engineering chart that compares how well items sell with how much margin they earn.
In the demo above, I gave Iris room to choose what belonged on the page. Well, truthfully it was more of a curiosity than any deliberate plan and she did surprise me with something awesome. The result was a report in the application I was already using. Daedalus applied the declarations in the running process, without a source code change or a deployment.
What Iris reads and writes
The demo shows a whole page taking shape. A smaller example shows what changes underneath. This Daedalus declaration, written in EDN, defines a bar chart and a table for the five menu items with the highest net sales.
{:kind :component
:name :top-menu-items
:label "Top five menu items by net sales"
:inputs
{:items {:from :example/sales
:group [:item-name]
:select [:item-name :net]
:order [[:net :desc]]
:limit 5
:window {:days 28 :anchor :latest-data}}}
:view
[{:block :chart :type :bar :input :items
:x :item-name :y :net :y-fmt :money}
{:block :table :input :items
:columns [:item-name {:key :net :fmt :money}]}]}
When Daedalus processes this declaration, it looks up :example/sales to find the database table and the definitions of :item-name and :net. The model defines :net as a sum of net-cents, so Daedalus generates a parameterized SQL query that filters to the 28-day window and totals net sales by item. PostgreSQL returns one row per item. Daedalus sorts those rows, takes the top five, and hands the same result to the bar chart and the table. If I ask Iris for ten items, she can change the limit in one place and both views pick it up.
That's where the Lisp influence shows up. The query and the views are structured data, so a value like :limit can be edited directly. Daedalus defines what the field means.
How does Iris know to write :group, or that a chart can read a named query result? Daedalus gives her a vocabulary she can look up as she works. It describes the kinds of declarations the engine understands, the fields each one takes, and how the pieces fit together. If I ask for a chart of the top five items, Iris can look up how to express the query and how to point a chart at its result. The engine then checks the declaration she proposes.
Here's the vocabulary entry for the time window in that query, with the signature and example it gives Iris.
{:topic :window/days
:sig "{:days n :anchor :latest-data|:today} ; :anchor optional"
:doc "The last n days, ending on the anchor day (included)."
:examples [{:window {:days 28 :anchor :latest-data}}]}
If my sales feed is a few days behind, the choice between :today and :latest-data changes which days the report counts. The entry gives Iris a way to express that choice. Once she submits it, the engine takes over.

Actual output from the declaration using simulated data.
One of the tests I cared about most was whether Daedalus could reproduce one of Prism's more involved reports, menu engineering. I tested it first with simulated data and then against my own shop's sales history, comparing the results with the existing Prism implementation. The numbers matched. I wanted to establish that this thing could produce more than convincing-looking dashboards.
The agent isn't the authority
I wanted Iris to be able to draft a change while I was looking at the app. For that to work, the engine had to control what a proposal could do, and I had to be able to decide what went live.
You ask for a change
β
Iris drafts a declaration
β
The engine validates the change
β
You preview the draft
β
An authorized person publishes it
Iris proposes edits through a tool called apply_changes. She sends a batch of declarations using a vocabulary the engine understands. She can ask for a table, group sales by menu item, or calculate a line total with [:* :qty :unit-price]. The first item names the multiplication operator. The next two name the fields it reads. The engine supplies the operators she can combine. Extending that vocabulary takes a change to the engine or a reviewed library.
Iris doesn't have access to the application's source code, a shell or a direct database connection. She runs in an isolated worker with restricted network access and a deliberately limited set of tools. The expression language itself has no loops, recursion or arbitrary function calls. Iris can combine operations the engine provides, but she can't introduce new ones.
The engine checks the whole model that would result from a batch before accepting it. A failed check leaves the draft definitions as they were and gives Iris a finding she can use to revise the proposal. An accepted batch becomes part of the draft. That separation applies to application definitions. Draft and published pages can still work with the same live records.
As an aside, there's something really interesting that happens in the demo above that's easy to miss. Iris makes a mistake in one of her declarations and the engine rejects it. She corrects the declaration on the fly based on feedback from the engine and then it is accepted.
Daedalus keeps the application's declarations in a Git repository behind the scenes. As a bonus, Iris reads the diff and writes a commit message explaining the change and all that history is visible in the application. I can see what changed between versions and restore an earlier definition as a draft. From there I can try it in the application and publish it again.
The agent can modify the description of the application, but not the machinery that interprets it.
Suppose I ask Iris which menu items bring in the most money. She builds the chart using net sales. The query runs, the chart looks right, and the figures match the sales data. But maybe I meant which items earn the most after ingredient costs. The engine can check that net sales is a measure the report can use. When I preview the draft, I can check whether it answers the question I meant to ask. So it's the engine ensuring that Iris used the vocabulary correctly - the vocabulary is developed in Clojure and validated by an extensive test suite to ensure correctness - and the human in the chair ensuring that the right question was answered.
Where this gets interesting
Right now, if an application doesn't do what you need, you have to fix it yourself or hope someone else does it for you. For small things, like one more column, a form for something you track on paper, or a page that combines three reports, that's a lot of friction for very little change.
Picture business software that grows alongside the business using it. You say what you need, in the place where you need it, and the application extends itself inside limits you can actually see and trust. The person who asked for the change can see it take shape in the application and decide whether itβs ready to publish.
Where things really get interesting is when you realize the agent has a runtime model of the application's construction, how it is used and what people are asking of it. What if it could use that information to propose improvements on its own?
That's another rabbit hole for another time.
Daedalus is a research prototype. I'm still exploring and trying crazy new things like a mad scientist. I'm still finding the limits of what its vocabulary can express. And there's still a ton that I haven't even mentioned.
I set out to build a better reporting tool for a coffee shop, and I ended up with an application that can describe itself and grow. I'm still hacking away at this one so stay tuned.