# The Prompt is the Platform

Dominik Tornow

AI Engineer World's Fair 2026

[Talk page](https://ai.engineer/talks/DqtmZE6Hl0g-prompt-is-platform) · [Video](https://www.youtube.com/watch?v=DqtmZE6Hl0g)

## The Prompt Is the Platform

Generating infrastructure from a specification requires more than passing basic tests: agents need a way to explore distributed algorithms, reproduce failures, and turn tested designs into concrete implementations.

Familiarity with key-value stores, versioned writes, and basic concurrency will help you follow the simulation example.

### What happens when the implementation becomes unnecessary?

[0:02](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=2s)

What would make a software platform unnecessary even if it worked well? Dominik Tornow opens with a prediction: in 2026, coding agents will retire the first platform by making its implementation unnecessary. This is a forecast about how software gets built, not a report of a platform already displaced. Tornow introduces himself as founder and CEO of Resonate, a durable execution platform whose technical values are minimalism and simplicity.

The proposed change is from adopting a general-purpose implementation to generating a bespoke extension of infrastructure already in place. Instead of installing another library, framework, or platform, a team could ask an agent to implement the required behavior on its existing stack. **Reuse moves upstream:** the reusable artifact becomes the specification, from which many target-specific implementations can be derived. In that sense, the prompt becomes the platform.

### A protocol that can produce many servers

[1:33](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=93s)

For Resonate, this possibility changes where the product's value lives. Tornow describes an existing server and SDK implementations for TypeScript, Python, Rust, Go, and Java. If agents can generate implementations, owning those implementations is no longer the whole proposition. The durable asset becomes the specification that connects one protocol to multiple servers.

![A specification box branches to three implementation boxes; the speaker inset partly covers the lowest box.](https://ai.engineer/api/talk-essay-media/980a5acd4897ffd0ed1820a105b965b222194b243fe4b23af015b414131d9704)

One specification connects to three implementations.

The general-purpose Resonate Server remains a reference implementation. Other implementations, built with infrastructure partners, can provide durable execution directly on customers' existing infrastructure with minimal additional dependencies. The engineering question therefore changes from whether a server can be built to whether **trusted servers can be synthesized repeatedly from the same specification**.

Verification asks whether the generated result is correct. There is an earlier question too: how can the agent help specify the system it will build? The case study is [Resonate's partnership with Synadia](https://www.linkedin.com/posts/dtornow_resonate-distributed-async-await-is-an-open-activity-7478477659233210368-LgEb), the company behind NATS, an open-source messaging system for distributed applications. Bringing Resonate to that infrastructure provides a concrete test of the path from specification to implementation.

### Keep the reusable specification abstract

[3:53](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=233s)

The familiar agentic coding workflow has three parts: a specification, an agent, and an implementation. For many applications, that is enough. But generating several implementations for different infrastructure targets introduces another requirement: the shared specification must survive a change of target.

![Three boxes labeled Spec, Agent, and Impl connected from left to right by arrows.](https://ai.engineer/api/talk-essay-media/5a05b563f223a56f5d23ae8c44b9667268eb0f2fa82c0898fbcff6671906eada)

Spec → Agent → Impl.

That rules out embedding a concrete database schema or index layout in the reusable specification. It also rules out assuming relational tables and transactions, a key-value store, or a weakly or strongly consistent storage substrate. Those are implementation decisions. **The specification describes the required behavior; the implementation must realize it using the target's actual capabilities.** Abstract does not mean that correctness is optional—it means the contract cannot depend on one convenient way of achieving it.

### The first attempt exposed a design gap

[5:04](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=304s)

The initial request was direct: build a Resonate server in Rust on top of Postgres, following the abstract specification. The agent produced a system that worked on the happy path and passed basic tests. But it broke under concurrency, process failure, and network failure. The distance from the abstract contract to a correct concrete implementation was too large; the result was a prototype rather than a production system.

The next attempt inserted a **concrete specification** between the abstract specification and the code. A human drove an interactive design process with the agent, making the Postgres decisions explicit: the schema, indices, SQL queries, and transaction boundaries. Tornow reports that, once those decisions were written down, the agent could implement a production system.

This solved the implementation problem while exposing a limitation in the workflow. The agent helped build the system, but the human still supplied its design. If specifications are themselves reusable products, helping only after the design decisions have been made leaves a substantial part of the work untouched.

### Design in simulation before building for production

[6:54](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=414s)

For NATS, the team changed the agent's first assignment. Rather than immediately requesting a production system, they asked what the agent needed to design the system first and build it second. They supplied a deterministic simulation environment and requested a simulated implementation.

The simulated implementation is **executable design**. Its purpose is to discover algorithms that work under partial order and partial failure: operations need not unfold in one convenient sequence, and parts of the system can fail independently. Once the algorithms have been explored and tested in simulation, the agent can describe the target-specific design and then implement it. The sequence becomes:

1. Start with the abstract specification.
2. Build a simulated implementation to explore the algorithm.
3. Derive a concrete specification from the tested design.
4. Build the concrete implementation from that specification.

Humans remain involved, but the agent now drives part of the design process instead of merely translating a human design into code.

### A small protocol still has a large behavior space

[8:29](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=509s)

Minimalism and simplicity make this approach more tractable, but they are the result of design work, not an initial condition. Tornow reports three years spent making the protocol smaller and simpler. When a problem appeared, the recurring questions were what abstraction could be erased, what property could be removed, and what relationship could be broken. The resulting protocol centers on two objects: a **Durable Promise** and a **Durable Task**. Even with that small conceptual surface, concurrency and distribution produce a complex space of possible states and behaviors.

For the NATS design, Tornow identifies three available building blocks: queues, a key-value store, and delayed or scheduled messages. These belong to the target infrastructure, not to the Resonate protocol. The task is to express the behavior of Durable Promises and Durable Tasks using those primitives, while preserving correctness when the primitives behave in inconvenient but permitted ways.

### A legal read can describe an outdated world

[9:54](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=594s)

Consider a key whose values progress from `foo` to `bar` to `baz`. In the demonstration's numbering, the latest value is `baz` at version `2`. A fresh read returns that pair. A stale read instead returns `foo` at version `0`, even though the current value remains `baz`.

| Read | Returned value | Returned version | Current value |
|---|---|---|---|
| Fresh | `baz` | `2` | `baz` |
| Stale | `foo` | `0` | `baz` |

Under the target behavior modeled in the talk, the stale result is neither corruption nor a store bug. These zero-based versions are illustrative simulator labels: [actual NATS revisions](https://docs.nats.io/learn/key-value/history-and-revisions) are bucket-wide sequence numbers, with the first stored write starting at `1`. The example should not be read as a guarantee that every production read path may return any arbitrary historical value.

**Correctness must cover legal target behavior, not only convenient behavior.** A simulator therefore needs to expose fresh reads, stale reads, and their associated versions. But receiving a version does not itself reveal whether the read is fresh: the client does not know the current version merely from seeing an observed one.

The conflict becomes visible when the client attempts a write. Having read version `0`, it requests an update conditional on version `0` still being current. The key has already advanced, so the update fails. That failed write establishes that the world the client observed is no longer current. Designing an algorithm that remains correct through such observations and failures is difficult for humans and agents alike.

### Make the failure repeatable and inspectable

[12:11](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=731s)

The agent needs immediate, unambiguous feedback that explains a failure's cause: which stale value was returned, which logic it triggered, which write failed, and which invariant broke. To provide that feedback, the team built a deterministic simulation environment in Python, modeling the parts of NATS on which its implementation depended.

The simulated key-value store retains a full version history for each key. On `get`, a deterministic random generator controls whether the returned entry is current or older. On `update`, the store enforces optimistic concurrency: the write succeeds only when the supplied version is still current; otherwise it raises. Keeping full history is a simulation choice—production NATS retains a configured, bounded history.

The essential behavior fits in a small Python model:

```python
from random import Random


class KVStore:
    def __init__(self, seed: int):
        self.rng = Random(seed)
        self.history: dict[str, list[str]] = {}

    def create(self, key: str, value: str) -> int:
        if key in self.history:
            raise KeyError(key)
        self.history[key] = [value]
        return 0

    def get(self, key: str) -> tuple[str, int]:
        versions = self.history[key]
        index = self.rng.randrange(len(versions))
        return versions[index], index

    def update(self, key: str, value: str, version: int) -> int:
        versions = self.history[key]
        if version != len(versions) - 1:
            raise KeyError("version conflict")
        versions.append(value)
        return len(versions) - 1


store = KVStore(seed=7)
version = store.create("example", "foo")
version = store.update("example", "bar", version)
version = store.update("example", "baz", version)
observed_value, observed_version = store.get("example")
```

Here `get` can select any retained entry, including the latest. An update carrying version `0` would fail once `baz` occupies version `2`; the failed update would leave the history unchanged.

![Python KVStore class showing initialization, get, create, and update methods, including random version selection and a KeyError on an update index mismatch.](https://ai.engineer/api/talk-essay-media/8bd6491ab60c8c2b33095272a1fc2804fb75fd1c332c779c2111ac69b34ccf78)

Python key-value store simulation with version history and an update index check.

The model reproduces the target behaviors that matter to this correctness problem while making their execution deterministic, repeatable, and inspectable. With the same inputs and random choices, the failing execution can be reproduced. The agent can then repair its algorithm against that particular trace instead of trying to infer what happened from an intermittent failure.

### Let the debugger see what the algorithm cannot

[13:53](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=833s)

Deterministic simulation can do more than inject stale reads. It can expose facts that the real platform hides. Tornow calls this the “forbidden fruit”: in production, a read provides the observed value and version, but not a freshness label or the latest value the client missed. The algorithm cannot depend on information unavailable through the real interface.

The simulator can nevertheless record that information for diagnosis. Every simulated `get` emits a trace event identifying whether the read was fresh or stale and recording both the observed value and the latest value. **The runtime algorithm and the agent inspecting its trace have different information privileges.** The extra facts help the agent understand a failure without becoming inputs to the algorithm it is designing.

The displayed `KVStoreGet` trace makes the distinction concrete. For the promise identified by `foo-1`, the result says `pending`. That is what the algorithm receives. The trace also labels the read `STALE` and records that the latest state of the same promise is `settled`.

| Information | Algorithm receives it | Diagnostic trace records it |
|---|---|---|
| Observed state: `pending` | Yes | Yes |
| Read type: `STALE` | No | Yes |
| Latest state: `settled` | No | Yes |

The trace exposes a disagreement between an observation and current state; it does not turn the stale observation into a fresh read.

![JSON trace for KVStoreGet on foo-1, with type STALE, result status pending, and latest status settled.](https://ai.engineer/api/talk-essay-media/410d76583e72852feb22055c3c5d0e208edab91391781de64ca5cf7f316de91c)

A stale read returns pending while the latest value is settled.

That difference makes a failure actionable. Instead of learning only that an invariant failed, the agent can identify a decision made from a stale view of the promise. It can use the hidden state to explain why its algorithm was wrong, while repairing the algorithm using only information that production code can actually obtain. Cause and effect become visible without granting the implementation unrealistic powers.

### From a tested algorithm to a reusable product

[16:16](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=976s)

Tornow reports that this process closed the design gap. The agent first built a proof of concept inside the deterministic simulator and tested it through fuzzing. It then derived a concrete specification from that simulated design. He describes the algorithm as correct at this point; fuzz testing supplies evidence from the executions it explores, rather than an exhaustive proof of every possible execution.

From the concrete specification, the agent derived an implementation. The additional simulation stage changed its role: it could participate in discovering the design, not merely implementing decisions already made by a human. Humans remained involved, but the agent drove the progression from an abstract contract through executable design to a concrete specification and implementation. That is the practical basis for the closing product thesis: **the prompt is the platform, and the specification is the product.**

## Resources

- [Resonate on NATS](https://github.com/resonatehq/resonate-on-nats) — A Go implementation of Resonate using NATS JetStream for transport and storage, with build instructions and deterministic testing endpoints. Production use requires a commercial license.
- [NATS key-value history and revisions](https://docs.nats.io/learn/key-value/history-and-revisions) — Examples explaining revision numbers, retained history, and compare-and-swap updates that reject conflicting writes.
- [Implementing the Distributed Async Await protocol](https://www.distributed-async-await.io/server) — A guide to the protocol's abstract machine, atomic transitions, implementation boundaries, and server implementations on different storage systems.
- [Testing a Resonate server](https://www.distributed-async-await.io/server/testing-and-conformance) — Explains oracle comparison, controlled time, invariant checks, and fault testing, including which conformance tools are publicly available.
- [Resonate server provider capabilities](https://docs.resonatehq.io/deploy/providers) — Current provider compatibility, licensing, test coverage, and deployment limitations for NATS and other infrastructure targets.

## Slides

### The Prompt is the Platform

Dominik Tornow predicts that coding agents will quietly retire the first software platform in 2026 because it will become unnecessary.

[0:00](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=0s) [Title slide reading “The Prompt is the Platform” and “Resonating…”](https://assets.ai.engineer/sites/aiecode2025/sha256/74a1bd3e920c7e48e9d1a24dfa6280f6dcd968df6ec5faea7ec36212f897b4d7.webp)

The Prompt is the Platform
* Resonating…

AI Engineer

### Dominik Tornow

Dominik Tornow introduces himself as the founder and CEO of Resonate, a durable execution platform built around minimalism and simplicity.

[0:13](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=13s) [Portrait of Dominik Tornow beside his name and Resonate HQ.](https://assets.ai.engineer/sites/aiecode2025/sha256/a58def05ca2d39a2826e0269fae135d54697772a3db0e4a140faea6a9c6daea9.webp)

Dominik Tornow
Resonate HQ

### Resonate Durable Execution on NATS.IO

The presentation uses Resonate on NATS.io to explore how agents move from specification to implementation.

[3:25](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=205s) [Title slide for Resonate Durable Execution on NATS.IO with two logos.](https://assets.ai.engineer/sites/aiecode2025/sha256/5039e94adce4c3ecbab35e7338b94302390411bf84774892e36eb465990459be.webp)

Resonate Durable Execution
on NATS.IO

### Agent workflow

An agent receives an abstract spec and a target spec to produce an implementation. The first attempt passed basic tests but failed under concurrency, process failure, and network failure.

[4:25](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=265s) [A spec and target spec feed an agent, which produces an implementation.](https://assets.ai.engineer/sites/aiecode2025/sha256/185c3ecf9f944764272c57cbe0f72bbca6f07503cf87a56fa2dd4245856a34c1.webp)

Target
Spec

Spec
Agent
Impl

### From abstract specification to concrete implementation

The human leads the concrete spec with the agent, which then implements it. For Postgres, the spec spelled out the schema, indices, SQL queries and transaction boundaries.

[5:50](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=350s) [A human turns an abstract spec into a concrete spec, and an agent turns that into a concrete implementation.](https://assets.ai.engineer/sites/aiecode2025/sha256/b5e2f2e35401e5a09fe11d4104304af61e3cd3d7fd969d529d42e52b98cc7621.webp)

Human
Agent

Abstract
Spec

Concrete
Spec

Concrete
Impl

### Agent-driven simulation process

Agents turn an abstract spec into a simulation implementation, where algorithms are tested and verified before an agent writes the concrete spec and implementation.

[7:01](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=421s) [Three agents connect an abstract specification, simulation implementation, concrete specification and concrete implementation.](https://assets.ai.engineer/sites/aiecode2025/sha256/90d4332fc64ae8dc932c1ab7558652374fdf66d57f0a0e9c27ae0162d02128f4.webp)

Agent
Agent
Agent

Abstract
Spec

Simulation
Impl

Concrete
Spec

Concrete
Impl

### Promise and task protocol

The protocol centers on a Durable Promise and a Durable Task. The diagram shows promise creation and settlement entering the promise, with task execution arrows leaving it.

[8:34](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=514s) [A promise receives creation and settlement calls and connects to task execution.](https://assets.ai.engineer/sites/aiecode2025/sha256/ff9f47290f099b2dc36d6ea4f991036e3f69ff43c7e76ce647f84eb58147ab7f.webp)

promise.create(id)
task(execute(id))

Promise
id

task(execute(id))
promise.settle(id)

### Resonate and platform primitives

The design question is how to express the Resonate protocol using NATS primitives: queues, a key-value store, and delayed messages.

[9:21](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=561s) [Resonate connects to queues, a key value store and delayed messages.](https://assets.ai.engineer/sites/aiecode2025/sha256/0f1233bf160d98b3cc3cad8fe2dff4e8d634b1fa99e8c3f36c1128e6f11a7465.webp)

Resonate

Queues
Key Value Store
Delayed Messages

### Fresh and stale reads

After updates from foo to bar to baz, a fresh read returns baz at version 2; a stale read returns foo at version 0. Both are valid under the target platform’s consistency model.

[9:53](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=593s) [Two sequences of key-value updates show a fresh read at version two and a stale read at version zero.](https://assets.ai.engineer/sites/aiecode2025/sha256/76133c41972af7527b463901a52b6b532af113c589bdb24e8706cfc51eae3358.webp)

>>> kvs = KVStore(...)
>>> t = kvs.create(“key”, “foo”)
>>> t = kvs.update(“key”, “bar”, t)
>>> t = kvs.update(“key”, “baz”, t)
>>> kvs.get(“key”)
(“baz”, 2) # FRESH

>>> kvs = KVStore(...)
>>> t = kvs.create(“key”, “foo”)
>>> t = kvs.update(“key”, “bar”, t)
>>> t = kvs.update(“key”, “baz”, t)
>>> kvs.get(“key”)
(“foo”, 0) # STALE

### Simulated key-value store

The simulated store keeps each key’s version history and can return an older value. Updates succeed only when the supplied index matches the latest version.

[12:09](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=729s) [Python code implements key-value reads, creation and version-checked updates.](https://assets.ai.engineer/sites/aiecode2025/sha256/2e879d00d4c0245a8483f8a91eb89079998373638418770256361478dc54294e.webp)

class KVStore:
    def __init__(self, ctx, rng, pro):
        self.ctx, self.rng, self.pro, self.store = ctx, rng, pro, {}

    def get(self, key):
        if self.rng.random() < self.pro:
            i = int(self.rng.random() * len(self.store[key]))
        else:
            i = len(self.store[key]) - 1
        return self.store[key][i], i

    def create(self, key, value):
        if key in self.store:
            raise KeyError(key)
        self.store[key] = [value]
        return 0

    def update(self, key, value, index):
        if index != len(self.store[key]) - 1:
            raise KeyError(key)
        self.store[key].append(value)
        return len(self.store[key]) - 1

### Tracing key-value reads

The simulated store traces whether each read is fresh or stale. For stale reads, it records both the returned value and the latest value, giving the agent information the algorithm cannot use.

[13:50](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=830s) [Python code highlights trace events for stale and fresh key-value reads.](https://assets.ai.engineer/sites/aiecode2025/sha256/d73302dab3d330be8c54b579cc80f1e507d7396a0b62130fcebfdf3eb85eefe8.webp)

class KVStore:

  def get(self, key):
    if self.rng.random() < self.pro:
      i = int(self.rng.random() * len(self.store[key]))
      self.ctx.trace(Get(type=STALE, key=key, result=self.store[key][I], latest=self.store[key][-1]))
    else:
      i = len(self.store[key]) - 1
      self.ctx.trace(Get(type=FRESH, key=key, result=self.store[key][I]))
    return self.store[key][i], i

### Stale Read Trace Event

The trace shows a stale read returning a pending promise while the latest value is settled. The simulator exposes that difference to the agent for debugging, while the algorithm receives only the result.

[15:02](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=902s) [A trace event compares a pending result with the latest settled value.](https://assets.ai.engineer/sites/aiecode2025/sha256/64ba940683da3f78e9313bfe3a903f7f097de51f8654087dd19f3a5044d9fe73.webp)

{
  "event": “KVStoreGet",
  “key”: “foo-1",
  "type": "STALE",
  "result": {
    "id": "foo-1",
    "status": "pending",
  },
  "latest": {
    "id": "foo-1",
    "status": "settled",
  }
}

### Build Resonate on NATS.IO

The speaker closes by inviting questions in Resonate's Discord.

[17:20](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=1040s) [Closing slide titled Build Resonate on NATS.IO, with a community link.](https://assets.ai.engineer/sites/aiecode2025/sha256/28aaf98382c18b22f8846693db564e6a978b8ffc228cbc926432970c265f53eb.webp)

Build Resonate on NATS.IO

* Resonating...

https://resonatehq.io/discord

## Full transcript

[0:02](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=2s) In 2026, coding agents will quietly retire the first software platform.

[0:09](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=9s) Not because it's bad, simply because the platform is unnecessary.

[0:15](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=15s) I am Dominik Tornow. I am founder and CEO of Resonate. Resonate is a durable execution platform built with minimalism and simplicity as its core technical values, and these properties will play a central role in this talk.

[0:31](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=31s) At Resonate, we have a working theory where software engineering is headed.

[0:37](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=37s) General-purpose implementations will increasingly be replaced by bespoke implementations generated on demand, not as a new library, a new framework, or a new platform, but as a minimal extension of the infrastructure that is already in place.

[0:57](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=57s) If this theory holds true, reuse will move upstream. Instead of reusing a general-purpose implementation, we will reuse a specification, and we will derive a bespoke implementation from it.

[1:16](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=76s) In fact, we can build many bespoke implementations tailor-made for the infrastructure that is already in place. We just have to ask the agent. At this point, the prompt is the platform.

[1:33](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=93s) Resonate is a durable execution platform. We have an implementation of the Resonate Server. We have implementations of the Resonate SDK for TypeScript, Python, Rust, Go, and Java. So we have to ask,

[1:47](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=107s) what does this new reality mean for us?

[1:51](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=111s) If implementations become generatable, where does our value live? And our answer, our value moves from implementation to specification.

[2:05](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=125s) Now, this changes how we think about Resonate. The product is no longer the implementation. The product is the specification, the protocol. And from that protocol, we want to derive multiple server implementations.

[2:22](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=142s) One is the general-purpose Resonate Server, our reference implementation.

[2:26](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=146s) Others are implementations built with infrastructure partners. For customers and partners, this means durable execution right on top of their existing infrastructure with minimal additional dependencies. So the question is no longer can we build a server?

[2:44](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=164s) The question is, can we repeatedly synthesize trusted servers from the same specification? And if so, how?

[2:58](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=178s) When we talk about agentic engineering, we focus all of our attention on verification. How do we know the result is correct?

[3:07](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=187s) But today, I want to focus on the specification instead, and more importantly, how can agents participate in specifying the system, not just building or verifying it?

[3:23](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=203s) Now, Resonate is partnering with multiple infrastructure providers to bring durable executions natively to their technology stack. One of them is Synadia, the company behind NATS.io, an open source messaging system designed for building modern distributed systems.

[3:41](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=221s) For the rest of this presentation, we will use Resonate on NATS.io to explore our agentic engineering practices. How do we go from specification to implementation?

[3:53](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=233s) First, we need to level set our mental model.

[3:58](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=238s) This picture is a common view of agentic coding. There's an agent, there's a specification, and then there's an implementation. And for many applications, that is enough.

[4:11](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=251s) But it is not enough for what we are trying to do

[4:15](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=255s) because we are not trying to generate one implementation from a specification.

[4:23](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=263s) We are trying to generate multiple target-specific implementations from the specification.

[4:30](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=270s) So the specification must not take any aspect of an implementation into account.

[4:36](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=276s) The specification must not assume a concrete database schema or concrete indices.

[4:42](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=282s) The specification must not even assume a relational database with tables and transactions at all. It must not assume a key-value store. It must not assume weak consistency. It must not assume strong consistency.

[4:56](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=296s) The specification must be abstract. Only the implementation must be concrete.

[5:04](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=304s) So we ask the agent to follow the abstract specification and generate a concrete implementation. Specifically, at first, we ask the agent, "Build a Resonate server in Rust on top of Postgres."

[5:20](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=320s) And the agent failed. The gap between the abstract specification and the concrete implementation was too large. The agent generated a system that worked on the happy path.

[5:35](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=335s) It passed the basic tests, but it was not correct. It broke under concurrency. It broke under process failure. It broke under network failure. The implementation was closer to a prototype, but not a production system.

[5:52](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=352s) So we amended the process. Instead of asking the agent to jump directly from abstract spec to concrete implementation, we inserted an intermediary artifact, the concrete specification

[6:07](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=367s) That concrete specification was derived interactively with the agent, but the human was the main driver.

[6:16](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=376s) For Postgres, that meant making target-specific decisions explicit, the data schema, the indices, the SQL queries, the transaction boundaries.

[6:28](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=388s) Once those decisions were written down, the agent was indeed able to implement a production system, so this worked.

[6:37](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=397s) But it also revealed the limitations. The agent helped us build the system,

[6:43](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=403s) but the agent did not help us design the system.

[6:48](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=408s) And if the specification is a reusable product, then that's not enough.

[6:54](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=414s) Now, the next step is obvious. Agents have to move upstream.

[7:00](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=420s) But how? When we started building Resonate on NATS.io, we changed the question.

[7:09](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=429s) We did not ask, "Can the agent build the production system?" Instead, we ask, "What does the agent need in order to design the system first and build the system second?"

[7:23](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=443s) So we gave the agent access to a deterministic simulation environment,

[7:28](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=448s) and we gave it a different task. Do not build the production system.

[7:35](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=455s) Build a simulated implementation. The simulated implementation is not the product.

[7:42](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=462s) It is executable design. Its purpose is to discover the correct algorithm under partial order, under partial failure. And once these algorithms are discovered, tested, and verified in simulation, then we ask the agent to write the concrete specification, and only then do we ask the agent to write the production implementation.

[8:06](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=486s) So the process becomes abstract specification, simulation implementation, concrete specification, and then concrete implementation.

[8:17](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=497s) This is a point where the agent moves upstream. Humans are still involved in the design process, but now the agent is a driver.

[8:29](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=509s) Two ingredients make this possible, minimalism and simplicity.

[8:35](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=515s) Unfortunately, minimalism and simplicity are not the starting point. They are the finish line. We spent three years making the protocol smaller and simpler. Every time we ran into a problem, we ask, "What can we take away?

[8:49](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=529s) What abstraction can we erase? What property can we remove? What relationship can we break?"

[8:56](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=536s) The result is a very small protocol centered around two objects, a Durable Promise and a Durable Task.

[9:05](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=545s) That simplicity matters because even simple concurrent distributed protocol have a complex state and behavior space. So in other terms, implementing even simpler protocols on top of a few simple primitives is tough.

[9:24](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=564s) Let's make this concrete with NATS. NATS gives us a small set of primitives we can build on, queues, a key value store, and delayed or scheduled messages.

[9:38](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=578s) These are not Resonate concepts. These are the concepts of the target platform.

[9:44](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=584s) So the design question becomes, how can we express the Resonate protocol using only these primitives?

[9:54](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=594s) Let's focus on the key-value store. The key-value store is versioned. We create a key with value foo, then we update it to bar, then we update it to baz.

[10:06](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=606s) So the latest value is baz at version two.

[10:11](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=611s) Most of the time, when we read the key, that is exactly what we get,

[10:17](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=617s) a fresh read. And if all reads were fresh, the design would be straightforward.

[10:23](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=623s) But sometimes the read is stale. Here, the latest value is still baz at version two,

[10:33](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=633s) but the read returns foo at version zero.

[10:38](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=638s) That is not corruption. That is not a bug in the key-value store.

[10:44](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=644s) That is a valid read under the consistency model of the target platform.

[10:52](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=652s) And that matters because our implementation cannot be correct only when the target behaves conveniently.

[10:59](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=659s) The implementation has to be correct when the target behaves legally.

[11:06](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=666s) So the simulation environment has to expose exactly this kind of behavior, fresh reads, stale reads, and the version information that tells us which world we are in.

[11:21](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=681s) Unfortunately, we do not know the read was stale simply by reading. We will find out later when we try to write.

[11:29](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=689s) Here we read version zero, so we try to update version zero,

[11:35](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=695s) but the key has already moved on. The write fails.

[11:39](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=699s) That is the moment the target tells us, "The world you saw is not the current world."

[11:48](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=708s) Building always correct applications on top of a concurrency model that allows occasional stale reads is not simple,

[11:57](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=717s) not for humans, not for agents. So how do we set up our agent for success? What tools does our agent need to ace this task instead of falling flat on its face?

[12:11](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=731s) Agents thrive on feedback. Immediate, unambiguous feedback. Not just feedback that shows this went wrong. Feedback that shows why and how this went wrong.

[12:27](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=747s) What stale value was returned? What logic was triggered? What write failed? And which invariant broke because of that?

[12:38](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=758s) So we built a deterministic simulation testing environment in Python. And inside that environment, we simulated the parts of NATS.io we depend on.

[12:48](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=768s) Here, for example, is the simulated key-value store.

[12:53](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=773s) It keeps a full version history for every key.

[12:57](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=777s) On get, the simulated store sometimes return the latest version. But sometimes, controlled by the deterministic random generator, the store returns an older version. On update, the store enforces optimistic concurrency.

[13:14](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=794s) The write only succeeds if the version you read is still the latest version. Otherwise, it raises.

[13:23](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=803s) This gives the agent a store that behaves like the real store in the ways that matter for correctness. But unlike the real target, the simulation is deterministic, it's repeatable, and it's inspectable.

[13:37](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=817s) So when the agent writes the wrong algorithm, we can reproduce the exact execution that broke it, and the agent can repair the algorithm against that trace.

[13:53](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=833s) But deterministic simulation does more than just inject stale reads.

[14:02](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=842s) It lets us expose facts the real platform hides.

[14:07](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=847s) We call this the forbidden fruit. In production, when you read from the key-value store, you only get the value and the version you observed. You do not get to know whether that read was fresh or stale.

[14:20](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=860s) You do not get to see the latest value you missed, and you shouldn't get that information because real code cannot depend on it.

[14:30](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=870s) But in simulation, we can record it. Here, every get emits a trace event. If the read is fresh, the trace says this was fresh. If the read is stale, the trace says this was stale.

[14:44](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=884s) This is what you got, and this is what the latest value was.

[14:49](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=889s) That information is forbidden to the algorithm, but it is incredibly useful to the agent.

[14:57](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=897s) It lets us explore failures in terms the agent can act on.

[15:05](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=905s) Now, this is what a trace event looks like.

[15:09](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=909s) The production code only receives the result. It sees the promise was pending.

[15:17](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=917s) This is all the real platform would tell us.

[15:21](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=921s) But the simulation also records the type of the read. This read was a stale read,

[15:28](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=928s) and it records the latest value that was hidden from the algorithm. The latest value says the same promise is already settled.

[15:38](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=938s) That difference is exactly the kind of fact an agent needs when it's debugging a distributed algorithm.

[15:45](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=945s) Not just the invariant failed, but the invariant failed because the algorithm made a decision from a stale view of the world.

[15:54](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=954s) Again, the algorithm is not allowed to depend on this information, but the agent is allowed to use it to explain why the algorithm it designed was wrong.

[16:04](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=964s) Cause and effect becomes visible. The agent does not just learn that the system is wrong, it learns why the system is wrong.

[16:16](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=976s) And with this approach, the agent was able to close the gap.

[16:22](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=982s) First, the agent built a proof of concept in the deterministic simulator

[16:29](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=989s) verified by fuzz testing. From the proof of concept, the agent derived the concrete specification where we already knew the algorithm was correct.

[16:45](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=1005s) And like before, from the concrete specification, the agent derived an implementation. Deterministic simulation lets agents participate in the design, not just in the implementation.

[17:03](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=1023s) Humans are still in the design process, but this time the agent is the driver. From a single abstract specification, the agent designed and built the platform via simulation to concrete specification to concrete implementation.

[17:18](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=1038s) The prompt is the platform, and the specification is the product.

[17:24](https://www.youtube.com/watch?v=DqtmZE6Hl0g&t=1044s) Thank you very much for watching. If you have any questions, please don't hesitate to reach out. You will find me in Resonate's Discord.
