Skip to content
Go back

What if the harness built its own integration?

Edit page

rein demo

I’ve been running a small experiment in rein: instead of writing an adapter for each coding agent I want to plug in, I hand the agent a short bootstrap prompt and let it write the adapter itself.

The setup is small. rein is a server that speaks a tiny protocol — events going up over HTTP POST, prompts coming down over SSE. When you start a session, rein launches a coding agent inside a sandbox with about a paragraph of instructions: install the harness SDK, read its README, write an extension that bridges your events to the protocol, then reload.

That’s it. The agent does the integration.

What surprised me is how well it works. Coding agents are, by definition, good at reading a README and writing a small TypeScript file. The SDK fits on one page. Within a minute the agent has produced its own glue, dropped it into .pi/extensions/rein-harness/, and reloaded into a fully integrated harness.

The reload step is where the real work was. rein currently runs on top of hotpi — my fork of pi-mono, mostly so I could add a ctx.reload() primitive that swaps the runtime’s extension graph mid-session without losing state. Without that, the bootstrap only works once per process.

A few things I didn’t expect going in:

The agent owns the integration. When the bridge has a bug, the agent can read the bridge — it’s a file in its own workspace — and fix it. Compared to debugging an opaque adapter layer, this is delightful.

Adoption is meant to be cheap. Any agent that can install a package and write a file can in principle integrate. Today only hotpi is wired up, but nothing in the protocol cares which agent does the bootstrapping.

The protocol stays small. Because the agent does the translation, the wire format doesn’t have to absorb every quirk of every agent. Each agent translates locally, in code it understands.

It’s an experiment more than a product, but it’s a runnable one. npx @rein-ai/cli picks up hotpi if it’s on your machine, and you can watch the bootstrap happen live — which I’d recommend at least once, just to see an agent assemble its own integration in real time.


Edit page
Share this post on:

Next Post
Welcome