← BUILD LOGProject19 MIN READ

2026 · 19 min read · Engineering case study · Personal project

Relay

Making Coding Agents Work as a Team

One coding agent checking its own work is marking its own homework. Relay is the orchestration layer I built to stop that: it runs the official Claude Code and Codex command-line tools, and local models on my own GPU, as a team. One plans, one builds, my tests run, and a different model reviews, round after round, until the reviewer approves. It uses the subscriptions I already pay for, keeps every run on its own git branch, records every step as an event, and can be driven from a laptop anywhere. This is what it does, how it's built, what it can't do yet and why, and what our last audit found.

By Muhammad Usman Mateen

↺ changes requested: the review becomes the builder's next prompt
done · relay/<id> is ready to merge

Works with

  • Claude Code
  • Codex
  • Ollama
  • LM Studio
  • Gemma
  • Qwen
  • MCP
  • GitHub
  • Tailscale

~70 commits in 13 days · ~24k lines of JS and TS · 231 tests · 0 runtime dependencies in the engine · 3 real runs measured

Relay is a private, unreleased project with a working name. It has only ever run on my own machines, for me. Nothing is published and nobody else uses it.

01

One agent marking its own homework

Coding agents are good enough now that the interesting failures are no longer syntax. They are judgement: an agent that declares a task done when it isn't, that edits a failing test until it passes, or that reviews its own diff and finds it excellent. Asking the same model to check its own work tends to repeat the blind spots that produced it.

The fix people reach for by hand is a second opinion. Paste the diff into a different model, ask what's wrong, paste the answer back. It works, and it's tedious enough that nobody does it consistently. Relay automates that habit. A planner reads the repository and writes a brief, a builder makes the change, the project's own tests run, and a reviewer from a different model family reads the diff and the test output and ends with a verdict. If it asks for changes, its review becomes the builder's next prompt.

Who plays which roleFrom the source · the five presets

Planner

Codex

Builder

Claude Code

Reviewer

Codex
cross-family review

The default. Codex plans and reviews; Claude Code builds. Planner and reviewer share one read-only session.

A preset is a shortcut for a workflow. Any role can be any agent, and the tests always run between the builder and the reviewer.

Two constraints shaped everything after that. The first was money: I already pay for Claude and ChatGPT plans, and I didn't want a tool that also bills me per token through an API key. The second was trust: agents run unattended for minutes at a time, so whatever they do has to be contained, visible, and easy to throw away.

02

Six rules before any code

Relay's repository opens with a short list of rules that every change has to respect. They read like restrictions, but most of the design follows from them.

The hard rulesFrom the repository's context file
  1. 01

    Only the official CLIs

    Relay starts the unmodified claude and codex binaries and reads their output. It never reads, copies or reuses their logins, and never proxies anyone's subscription.

    why · Provider terms, and trust

  2. 02

    A prompt is never a command-line argument

    Prompts go in on standard input, or in an HTTP body for a model endpoint. Model and tool names are pattern-checked first.

    why · Quoting bugs become commands

  3. 03

    Agents commit only to their own branch

    Every run works on relay/<id> in its own worktree. Merging is the person's decision: a button, or git merge.

    why · Nothing to undo in your checkout

  4. 04

    The dashboard is locked to you

    It listens on 127.0.0.1, rejects other Host headers and needs a random token on every API call.

    why · Other websites can't drive it

  5. 05

    No runtime dependencies in the engine

    The engine is plain Node. The React dashboard is built separately and served as static files.

    why · Fewer things to trust or update

  6. 06

    Nothing leaves the machine

    No telemetry and no Relay server. Runs are stored locally. Only what the agents themselves send goes out.

    why · Your code stays where it is

Every change to Relay is checked against these. Most of the architecture follows from the first two.

The first rule matters most. Relay never touches a provider's login. It starts the unmodified claude and codex binaries as child processes, the same way you would in a terminal, and reads what they print. Anthropic's terms allow a person to use the unmodified Claude Code binary with their own subscription; they don't allow a third party to route or resell that access. So Relay is a tool for one person on their own machine, and anything that would host it for other people has to use their own API keys or local models instead. That one rule decides what a team version of Relay can and can't be.

The second rule is about safety rather than terms. A prompt can contain anything, including text written by whoever wrote the repository. If it went on a command line, quoting bugs on Windows could turn it into a command. So prompts always go in on standard input, and anything that does reach a command line, like a model name, is checked against a strict pattern first.

03

Anatomy of a run

A run starts from a task in plain English and a repository. Relay creates a git worktree, a second checkout of the same repository in its own folder, on a new branch called relay/<run-id>. The agents only ever work there. My own checkout, including uncommitted work, is never touched until I press Merge.

Anatomy of a runIllustration of the run lifecycle
your branchrelay/<id> · own worktreeyou merge
who
You
writes
-
sees
The branch, the transcript, the diff
result
Merge into your branch, discard, or reply to continue.
Each round is one commit on the run's own branch. Nothing reaches your branch until you merge.

The planner runs once and can't edit files. The builder is the only role that writes, and Relay commits its changes after every round, so each round is a commit you can inspect. Relay then runs the test command itself, rather than trusting the builder's word that tests pass. The reviewer is read-only too. It sees the task, the plan's checklist, the diff and the test output, and is told to block only on real problems: bugs, a missed requirement, failing tests or a security issue. Everything else goes in a list of optional suggestions, so runs don't spend extra rounds on polish.

The verdict is a single line at the end of the review, and the parser is deliberately suspicious. The last verdict line wins, and a review with no verdict line at all counts as changes. A reviewer that rambles never approves by accident.

prompts.js
export function parseVerdict(text = '') {  const matches = [...text.matchAll(/VERDICT:\s*(APPROVE|CHANGES)/gi)];  if (!matches.length) return 'changes';  return matches[matches.length - 1][1].toLowerCase() === 'approve' ? 'approve' : 'changes';}
How a review becomes a verdict. The reviewer is told to end with exactly one line, VERDICT: APPROVE or VERDICT: CHANGES. The last match wins, and no match at all counts as changes, so an unclear review never approves by accident.

A run stops in one of three ways: the reviewer approves and the tests pass, the round limit is reached (three by default), or the builder answers a review without changing anything. That last check exists because an agent that disagrees with its reviewer will otherwise burn round after round restating its position. A finished run can be merged, discarded, or continued with a reply, which becomes the builder's next instructions on the same branch.

Here is the real dashboard doing exactly that, on Relay's built-in demo. Scripted mock agents play every role, so it costs nothing to watch: the first review finds a missing section, the builder resumes its session and adds it, and round two is approved and ready to merge. The run graph, timeline, changed files, checks, rounds and usage all update live from the event log.

A run in the dashboardScreen recording · built-in demo
32s · muted · loops
Relay's built-in demo: scripted mock agents play every role, so no subscription is used. Round one comes back with changes, the builder resumes its session, and round two is approved and ready to merge.

04

One interface, four kinds of agent

Each kind of agent is one small file with the same shape: a name, a label, a check() that confirms the CLI is installed, and a run() that takes a prompt, a working folder and a few options, and streams back text, tool calls and token usage. The engine never knows which vendor it's talking to.

Four adapters, one interfaceFrom the source
Claude Codeyour Claude plan
started as
claude -p --output-format stream-json
prompt
standard input
sessions
--resume between rounds
plan usage
a rate-limit event in its stream
read-only roles
write and shell tools disallowed
Codexyour ChatGPT plan
started as
codex exec --json
prompt
standard input
sessions
codex exec resume
plan usage
its session log on disk
sandbox
workspace-write, approvals off
Local modelyour GPU
started as
Ollama or LM Studio, or a home GPU endpoint
prompt
standard input, or the HTTP body
sessions
none: one prompt, one reply
plan usage
not reported
writes
files printed in fenced blocks
Mockno subscription
started as
a scripted fake agent
used for
every test and the demo
options
approve on round n, edit a test, fake limits
Every adapter exports the same shape: { name, label, via, loginHint, check(), run(ctx) }. Adding a vendor means adding one file.

Claude Code runs in headless mode with streaming JSON output, so Relay can show every file it reads and every command it runs as it happens. Codex runs through codex exec with its workspace-write sandbox and approvals off, because nobody is there to approve. Local models run through Ollama or LM Studio. A scripted mock agent plays every role in the test suite and in the demo, so neither ever spends a real subscription.

Both CLIs report how much of the plan's five-hour and weekly windows are used, but neither documents how. Claude Code includes it in a rate-limit event in its stream, and Codex writes it to a session log on disk. Relay reads both, shows them as meters, and pauses a run at 95% of a window. Both readers fail soft: if a CLI update changes the format, the meters go blank rather than the run failing.

05

Everything is an event

Every state change in a run is appended to a file of events, one JSON object per line: run started, step started, a tool call, some text, usage, a guard warning, a verdict, run finished. The dashboard keeps no state of its own. It is a pure function of that list, so replaying the file rebuilds exactly what was on screen.

The dashboard is a function of the logIllustration · real event names

events.jsonl

  • 11 step.started reviewer · codex
  • 12 round.finished verdict: changes
  • 13 round.started round 2
  • 14 step.started builder · claude · resumed
  • 15 tests passed
  • 16 round.finished verdict: approve
  • 17 run.finished completed
status
completed
round
2
working
-
files
3
tests
passed
verdict
approve
Drag the slider: the panel on the right is recomputed from events 1 to n and nothing else. That is how a restarted dashboard, a second window and a reconnecting phone all show the same run.

That one decision paid for itself several times over.

  • Restarts. A run's summary file holds its config, agent sessions, plan and usage, so a run can be rebuilt from disk after a crash and continued with a reply.
  • Several windows. The VS Code extension runs its own engine. A dashboard in the browser tails that run's event file live, so both show the same run.
  • Reconnects. Every event has a durable sequence number. A client that drops its connection asks for everything after the last number it saw, and nothing is missed or shown twice.
  • Retries. Starting a run takes an idempotency key, so a flaky network that sends the request twice still creates one run.
  • Debugging. When a run goes wrong, the event file is the trace. There is no separate logging system to keep in step with it.

06

Spending a subscription like it's yours

Usage limits are the loudest complaint about coding agents, and a multi-agent loop makes them worse: every step is a full agent session, and an agent re-sends its whole context with every tool call. The first real run made that concrete. Relay built its own relay clean command in four rounds and seventeen minutes, and the Claude builder used about 5.5 million input tokens, almost all of them cached context re-sent between calls.

So the defaults changed.

  • Sessions carry over. From round two, the builder resumes its own session instead of re-reading the repository. When the planner and reviewer are the same agent, they share one read-only session, so the reviewer already knows the plan.
  • Incremental review. A resumed reviewer sees only the diff since its last review.
  • No MCP servers by default. Claude Code normally loads every MCP server and claude.ai connector you have, and their tool lists ride along on every model call. With a typical set that was about 7,000 tokens per call, and a build step makes dozens of calls.
  • Proportionate prompts. Short plans, reviews that only block on real problems, and a builder that is told Relay runs the tests, so it doesn't run them too.
  • Budgets. A token budget per agent pauses the run when an agent's new tokens pass it. Usage is split into new input, cached input and output, because cached input costs far less.
What connectors cost a build stepArithmetic on one measured figure

extra input from tool lists: 280,000 tokens

Mostly cached after the first call, so it costs less than fresh input, but it still counts against the plan, every call, every step, every round.

About 7,000 tokens of MCP tool lists ride along on every model call when Claude Code loads a typical set of connectors. The number of calls per step varies; slide it. Relay's default is the right-hand switch.

Here is the honest part. Only three real runs have been measured, and the run that would show the Claude savings hasn't happened yet: my weekly Claude limit was already at 88% when the fixes landed. The Codex-only measurement is real but small. Treat the table as a record of what happened, not a benchmark.

Every measured run so farMeasurements · from the project's records

3 Nov 2026 · default: Codex plans and reviews, Claude Code builds

4 rounds · approved · merged

build relay clean

17 min

  • ≈ 5.5M input incl. cache · 76k out
  • 537k new · 3.8k out

Before the token fixes. 99 tool calls. The reviewer nitpicked; the builder couldn't run the tests.

4 Nov 2026 · codex-only, no planner

1 round · approved

add a version command

2m 0s

  • 63,440 new · 163,456 cached · 1,476 out

Builder 61 s, reviewer 19 s, tests 37 s. A much smaller task, so it doesn't measure the Claude savings.

4 Nov 2026 · same run, one follow-up reply

stopped · changes requested

restore a file, show git output

1m 10s

  • +66,868 new · +355,200 cached · +1,919 out

Both builder and reviewer resumed their sessions. Codex's Windows sandbox refused a git index write.

New input is what mostly counts toward a plan; cached input is context re-sent between calls and costs far less. The Claude half of the token measurement is still outstanding.

07

Guard rails for unattended agents

An agent running alone for ten minutes will eventually try something you wouldn't. Relay's guards target the failures people report most often.

What happens when the agent…From the source and README
flagged

Weakened-test check

Flagged in the transcript and the Checks panel. The reviewer is told a weakened test is a blocking problem.

Guard rails, not a sandbox. They catch the failures people report most, not a determined attacker.

The deny rules are passed to Claude Code as permission rules, so a recursive delete is refused before it runs rather than flagged afterwards. I checked this on a real run: the rm -rf was refused. Codex is held to its own workspace-write sandbox instead, and Relay flags any risky command either agent attempts.

guards.js
/** * Test files whose existing lines were changed or removed in this diff stat. * Adding new tests is fine; editing or deleting old ones is worth a look. */export function weakenedTests(files = []) {  return files.filter((f) => isTestFile(f.path) && f.del > 0);}// Claude Code permission rules that refuse the same commands before they run.// (Codex is held to its workspace-write sandbox instead.)export const CLAUDE_DENY = [  'Bash(rm -rf:*)', 'Bash(rm -fr:*)', 'Bash(rm -r -f:*)', 'Bash(rm -f -r:*)',  'Bash(rmdir /s:*)', 'Bash(rd /s:*)', 'Bash(del /s:*)',  'Bash(Remove-Item -Recurse:*)',  'Bash(git push:*)', 'Bash(git reset --hard:*)', 'Bash(git clean:*)',  'Bash(git checkout -f:*)', 'Bash(git switch -f:*)',  'Bash(shutdown:*)', 'Bash(format:*)', 'Bash(mkfs:*)',];
Two guards, abridged. Claude Code receives the deny list as permission rules, so these commands are refused before they run. A test file whose existing lines were changed or deleted is flagged; new tests are not.

The weakened-test check is the one I like best, because it's so simple. Agents are good at making tests pass, and sometimes they do it by editing the test. Adding new tests is fine. Changing or deleting existing lines in a test file is flagged in the transcript, and the reviewer is told to treat a weakened test as a blocking problem. These are guard rails, not a sandbox, and the README says so in as many words. Section 12 is about what that difference costs.

08

A canvas for workflows

The first version was a list: planner, builder, tests, reviewer. That covered the default, but not the runs I actually wanted, such as a person approving the plan before anyone builds, or three builders working on different files at once. So runs became a versioned workflow graph of nodes and edges, and the dashboard got a canvas to draw them on.

The canvas works like any node editor. You add steps from a palette, drag them into place, and connect two steps by dragging from the circle on one's right to the circle on the next one's left. A connection can carry a condition. Selecting a step opens an inspector: role, agent, model and effort for an agent, a command for a check, a server name for an MCP step. The recording below is the real canvas.

The real workflow canvasScreen recording · sped up 1.5×
45s · muted · loops
Recorded on a throwaway repository. Nothing was saved and no run was started. The cursor is drawn in, because a headless browser doesn't show one.

In about a minute of real time it adds a second builder that runs in parallel and switches it to a local Qwen model on my GPU, adds an MCP server step so the agents after it get GitHub's tools, adds a Browse step between the tests and the reviewer, rewires the graph, and gives the tests a command. Pressing Parallel builder adds the parallel and combine steps and wires both branches by itself. From there, Save to folder writes the graph into the repository's relay.config.json, and Start run runs it.

The Browse step is the one I'd miss most. With the Playwright browser server installed from the dashboard's MCP marketplace, it opens the app in a real browser (serving the run's own files on a private local port when there's no dev server) and hands the console errors and what's on each page to the reviewers and the planner. A reviewer then judges the page it can see, not just the diff.

Try it yourself. The buttons add the same steps, and the graph rearranges the way the canvas does.

Build a workflowInteractive · the canvas's real step types
changes → back to the plannerstarts herePlannerCodexAgentBuilderClaude CodeCheckTestsnpm testAgentReviewerCodex · read-onlyDecisionDecisionapprove or redoEndEndready to merge
▸ The graph JSON the canvas saves (relay.config.json)
{ "version": 1, "entry": "planner", "loop": "builder", "nodes": [ 
  { "id": "planner", "type": "agent", "role": "planner", "agent": "codex" }, 
  { "id": "builder", "type": "agent", "role": "builder", "agent": "claude" }, 
  { "id": "tests", "type": "check", "run": "npm test" }, 
  { "id": "reviewer", "type": "agent", "role": "reviewer", "agent": "codex" }, 
  { "id": "decision", "type": "decision" } ], "edges": [ 
  { "from": "planner", "to": "builder" }, 
  { "from": "builder", "to": "tests" }, 
  { "from": "tests", "to": "reviewer" }, 
  { "from": "reviewer", "to": "decision" }, 
  { "from": "decision", "to": "end", "when": "approve" }, 
  { "from": "decision", "to": "planner", "when": "changes" } ] }
Add steps the way the canvas does. Parallel builder adds the parallel and combine steps and wires both branches itself; a review always comes back to the planner. The JSON is the graph format the canvas saves.

Under the canvas, a node is an agent, a check (a test command), a decision, a human approval, a tool command, an MCP server for the agents that follow, a Browse step, or parallel branches that meet at a combine node. An edge can carry a condition: approve, changes, pass or fail. The presets compile to graphs too, and the engine walks the edges. A human approval pauses the run until someone presses Approve or Reject, and a rejection's note becomes the next agent's feedback.

Parallel builders share one worktree, which is a real limitation. They must not edit the same files, so the planner hands each builder its own list of files, and any file two builders both commit in the same round is flagged before review.

09

One recorded run, and the local models in it

The run below was recorded on 6 November 2026 and replayed with paths and prompts removed. The task was a small local-first ops console with four sections, JSON persistence and a test suite. A local Gemma model planned, three builders worked in parallel (two local models on my GPU and Codex in the cloud), the tests passed, and a local vision model reviewed and approved. Nine minutes, thirty-three files, one round.

One recorded run, 6 November 2026Real run · replayed from its sanitised record

9m 02s / 9m 02s

Select a step. ■ local GPU · ■ cloud · ■ tests

33 files+4,907 linestests passedapproved in round 1
Three builders worked at once on separate file lists, two of them on the local GPU. Bars show each step's real start and duration; select a step for what it produced.

It's a good run, and it hides the main limitation of the local path. A local model in Relay is not an agent. It gets one prompt and gives one reply. It writes files by printing them in a fenced block that Relay parses, it can call a tool by printing a line Relay executes (six calls at most), and it keeps no session between rounds. Claude Code and Codex read files, run commands and correct themselves in a loop; a local model in this adapter cannot.

Context is the other limit. One run sent a local reviewer 11,434 tokens with an 8,192-token window, and the run failed. Lockfiles are now left out of review diffs, a context error is retried with a shorter diff, and if that still doesn't fit the round continues as changes instead of failing. LM Studio also keeps one model loaded at a time, so parallel local steps queue behind each other.

A review that didn't fitFrom the project's known issues
window 8,192sent 11,434 (+3,242)

The prompt was 3,242 tokens larger than the model's 8,192-token window.

  1. 1Leave lockfiles out of review diffs. They are long and almost never what the review is about.
  2. 2Retry a context error with a shorter diff. The reviewer gets a capped diff and is told it was capped.
  3. 3Still too big: continue as changes. The round ends as changes requested instead of failing the run.
One run sent a local reviewer 11,434 tokens with an 8,192-token context window, and failed. Three fixes followed.

The planned fix is to stop treating local models as a different kind of thing. Codex can run against a local model, which puts a real, sandboxed tool loop on a model running on my own GPU through an adapter Relay already has.

10

Reaching it from anywhere

In early November I flew to Web Summit in Lisbon, and I wanted Relay to keep working while I was away: the agents, models and tests on my PC at home, and me on a laptop somewhere else. That's the part of Relay most worth getting right, because a remote control for a machine that runs commands is a remote shell if it's built carelessly.

The local dashboard already had strict rules: it listens on 127.0.0.1 only, rejects requests for any other hostname (which defeats DNS rebinding), and every API call needs a random token printed at startup. None of that changes. Instead, a second listener, the gate, sits in front of it and is the only thing published to the network, over Tailscale.

The only way in from outsideIllustration of the gate's checks · from the source

This device may

and sends

refused

Refused with 403: this device does not have "run". Grant it on the PC.

A new device starts with view only. Every other permission is granted on the PC, one at a time, and can be revoked there.
  • Device keys. A browser pairs by generating a P-256 key pair in WebCrypto. The private key is non-extractable: page scripts can use it to sign, but can't read it out.
  • Signed requests. Each request's signature covers the method, path, body, time, a nonce and the machine's id, so a request can't be altered, replayed later or sent to a different PC.
  • Pairing is approved on the PC. A new device stays pending until I approve it at the machine, and starts with view-only access.
  • Scopes. View, run, approve, merge, configure, shell, admin, GitHub and browse are granted one at a time. Anything that would run an arbitrary command needs shell, not run.
  • An allow-list, not a proxy. The gate forwards an explicit list of routes to the local API over loopback and adds the token itself, so the token never crosses the network.
  • An interlock. The gate refuses to start if Tailscale is publishing the local API port directly.
  • Revocation. Revoking a device on the PC closes its open streams within a second, and every request leaves a line in an audit log.

An end-to-end smoke test passed 23 of 23 checks over the real tailnet: pairing, refusals, health, a real local-model run approved from the laptop, live events with resume, changed files and revocation. Then it got a real test: I used Relay from the airport in Portugal, with the laptop reaching the GPU in my house over Tailscale. A Cloudflare Access transport is implemented and tested against a stand-in, but isn't deployed.

11

What it can't do yet, and why

Every limitation below has a reason, and most of the reasons were choices that made sense for a tool one person runs on their own PC.

Limitations, with the reason for eachFrom the audit, design notes and known issues
  • Agents run as you, with your environment, on your real disk

    Isolation

    why Relay relies on each CLI's own sandbox and a git worktree. The sandboxes restrict writes, not reads, and a worktree is a folder, not a process boundary.

    → Stage D · a container per run for anything triggered or remote

  • Worktrees isolate files, not side effects

    Isolation

    why A worktree is a second checkout. It doesn't get its own installed dependencies or ports, so two dev servers can still collide.

    → A setup command today · containers in Stage D

  • Parallel builders share one worktree

    Isolation

    why One branch per run keeps merging simple, so parallel builders write to the same folder.

    → Separate file lists per builder; overlapping files are flagged

  • Local models are not agents

    Models

    why The adapter pipes one prompt into a chat CLI and parses one reply. No tool loop, no session, at most six tool calls.

    → Stage B · Codex on a local model, one HTTP client with streaming and timeouts

  • Usage meters can break on a CLI update

    Models

    why Neither CLI documents how it reports plan usage. Relay reads a stream event and a session log that may change.

    → Readers fail soft: blank meters, never a failed run

  • Nothing is always on

    Operations

    why Relay was built as a tool you start. There are no schedules or triggers, and an interrupted run needs a manual Retry.

    → Stage C · queue, triggers, runs that resume, approvals on the phone

  • Controls only work in the process that owns a run

    Operations

    why The VS Code extension runs its own engine. Other windows can watch its runs from the event file, but can't pause them.

    → Stage C · the extension becomes a client of one worker

  • It can't be hosted for other people on subscriptions

    Terms

    why Provider terms allow one person to use the official CLI with their own plan, not a service routing it for others.

    → Team mode uses local models and a company's own API keys

  • Three measured runs is not a benchmark

    Evidence

    why The Claude plan was nearly spent when the token fixes landed, and there is no standard task set yet.

    → Stage B · an evals harness: success, rounds, tokens and time per preset

The pattern is the same in most rows. Relay leans on the vendors' CLIs for the hard parts (the agent loop, the sandbox, the login), which kept the engine small and the terms clean. The price is that Relay inherits the CLIs' boundaries: it can't contain an agent more tightly than the agent's own sandbox does, and it can't read usage figures the CLIs don't publish.

12

What our last audit found

On 14 November 2026 we audited the whole codebase: the engine, the adapters, the remote gate, and the GitHub and MCP layers, read in full. All three test suites passed (148 engine, 76 web, 7 extension), npm audit on the web app was clean, and every one of the 44 packages in the MCP marketplace was looked up on the npm registry. No live attack was run; the findings come from reading the code.

Audit of 14 November 2026From the audit · fixes in progress

16

security

10

reliability

9

product gaps

Security findings by severity

  • ■ 4 high
  • ■ 6 medium
  • ■ 6 low

The four high findings

  • A remote permission could be widenedfix in progress

    → Validate every workflow field against a strict pattern

  • Agents can read the host's secretsfix in progress

    → Keep secrets off disk, scrub the agent's environment, redact events

  • A sandbox escape through gitfix in progress

    → Drop the writable git directory; neutral git config for Relay's own git

  • The marketplace's supply chainfix in progress

    → Remove missing packages, pin versions with integrity hashes

What the audit called solid

  • ✓ Device keys that can't be exported
  • ✓ Signatures bound to method, path, body, time, nonce and machine
  • ✓ Route allow-list, scopes that default to view
  • ✓ Local server: loopback only, Host check, token
  • ✓ Idempotent runs, replayable events
  • ✓ Read-only planner and reviewer, worktree per run
  • ✓ Zero runtime dependencies in the engine
Severity is for the deployed shape: one owner, the gate on a private tailnet, paired devices with scopes. Findings come from reading the code; no live attack was run.

The verdict, in one line: the remote gate is well designed and the engine is tidy and well tested, but one layer down, agents run as you, with your environment, on your real disk. The four high-severity findings all come from that.

  • A remote permission could be widened. One field in a workflow sent from a paired device reached an agent's tool permissions without being validated, so a device allowed to start runs could have granted an agent unrestricted shell access.
  • Agents can read the host's secrets. The CLIs' sandboxes restrict writes, not reads. An agent, or a prompt injection hidden in a repository or web page, could print local secrets such as the dashboard token or the GitHub App key into a transcript.
  • A sandbox escape through git. On macOS and Linux, the Codex builder's writable git directory would let it plant git configuration that Relay's own git commands then run outside the sandbox.
  • The marketplace's supply chain. MCP entries installed the latest version of each package on every use, and some entries named packages that don't exist on npm, which anyone could register.

The medium findings follow the same theme: a repository's own config file can run commands and loosen the sandbox, a view-only device can see more than it should, a revoke can be lost to a write race, the secret scan before a push fails open on a diff it can't read in full, and the remote web app has no Content-Security-Policy. The reliability findings are the ones any long-running process meets eventually: no process-wide error handler, runs that don't resume by themselves after a restart, missing timeouts, and some files written non-atomically.

We're fixing these now, in the order the audit set out. The small, contained fixes come first: validate every workflow field, drop the writable git directory, pin and verify every marketplace package, fail the secret scan closed, and add error handling and atomic writes. Then come the structural ones: scrub the environment agents inherit, require the owner to trust a repository's config before it runs, and filter what remote devices see. None of this has been exposed: Relay has only run on my own machines, behind my own tailnet, for me. The repository stays private until every high and medium finding is closed with a test.

The audit also listed what's solid, and it's worth saying because it's the part most projects get wrong: the gate's keys, signatures, allow-list, scopes and interlock; a local server that only answers to loopback with a token; idempotent run creation with replayable events; worktree isolation with a read-only planner and reviewer; and an engine with no runtime dependencies.

13

Where it's going

Before writing much code, I looked at who else does this. The answer was: a lot of people. Running Claude Code and Codex side by side in worktrees behind a dashboard is now a common feature, and the vendors' own apps run parallel sessions. Even "Codex reviews Claude" ships free as an official plugin.

How crowded each idea already isMarket scan · 3 November 2026
  • Parallel worktrees with a live dashboardcommodity
  • Codex reviews Claudecommodity as a primitive
  • Phone or web remotecrowded
  • Automated plan, build, test, cross-review loopexists, tiny traction
  • Chat-first agent team threadexists, small traction
  • Drag-and-drop workflow canvas over subscription CLIsexists, small traction
  • Polished and solid on Windowspartial, a real gap
The green rows are the openings Relay is built around. The red ones are table stakes: worth having, not worth building a product on.

What's still open is narrower: a quota-aware plan, build, test and cross-review loop with real safety guards, solid on Windows, vendor-neutral, and able to mix local and cloud models. That's the bet. Relay should win on the loop, not on running agents in parallel.

The longer direction, adopted on 14 November, is a self-hosted agent runtime: agents that run on hardware you own, use local models first and cloud models only where you allow it, and can be reached from anywhere. The same code would serve one person on one PC and a company on its own servers, with the runner staying free and open source. It's planned in stages, and each stage is meant to be a finished product if it's the last one.

Stages, each a finished productFrom the adopted roadmap
  1. Stage A · Make it safe

    in progress

    done when Every high and medium audit finding is closed with a test.

  2. Stage B · Real local agents

    planned

    done when A local-only run plans, edits, tests and is reviewed with no cloud call.

  3. Stage C · Always on

    planned

    done when A scheduled agent runs overnight, survives a restart, and an approval reaches the phone.

  4. Stage D · Contained

    planned

    done when A test proves a triggered run cannot read the host's home directory.

  5. Stage E · More than one machine

    on request

    done when Only when a user asks for it.

  6. Stage F · Team

    on request

    done when Only when a user asks for it: sign-in, roles, policy, API-key providers.

Each stage has a test for done. The open-source runner stays free; a paid tier would be team features only.

Stage A comes first, and it's the audit. Evals come before features too. The next measurements will be a standard set of tasks scored on success rate, rounds, tokens and time for each preset, because "cross-family review catches more" is a claim, and it deserves numbers rather than one good run.

14

Questions people ask

What is Relay?
Relay is an orchestration layer that runs coding agents as a team: a planner writes a brief, a builder makes the change, the project's tests run, and a reviewer from a different model family ends with a verdict. If the reviewer asks for changes, its review becomes the builder's next prompt, until it approves or a round limit is reached.
Does Relay need API keys for Claude Code or Codex?
No. Relay starts the official, unmodified claude and codex command-line tools that the person is already signed into, so each step counts against their normal Claude or ChatGPT plan. It never reads, copies or reuses their logins.
How does Relay keep agents away from my own code?
Every run works in its own git worktree on a branch called relay/<run-id>. The planner and reviewer are read-only, only the builder writes, and nothing reaches your branch until you merge.
Does Relay have a visual workflow builder?
Yes. The dashboard's Workflows page is a drag-and-drop canvas: you add agents, checks, decisions, human approvals, tool commands, MCP servers, Browse steps and parallel branches, connect them with conditions such as approve or fail, save the graph into the repository, and start a run from it.
Can Relay use local models?
Yes, through Ollama or LM Studio, or an OpenAI-compatible endpoint on a home GPU. Today a local model gets one prompt and gives one reply, so it is not a full agent; the plan is to run Codex against a local model to give it a real tool loop.
Is Relay available to use?
Not yet. It is a private project with a working name, and it has only run on the author's own machines. An audit on 14 November 2026 found issues that are being fixed before any release.