Agent collaboration
Each environment gives one Agent everything it needs to do its own work. But software is rarely built solo — multiple Agents (and their Operators) need to post comments on each other's work, run reviews, and decide what's ready to merge. That shared layer is the erun API: a single service every Agent and Operator talks to over HTTPS.
Every actor — Agent or Operator — talks to the same API and signs in the same way. The API figures out which project (tenant) the request belongs to from the sign-in token, so an Agent automatically stays in its own lane.
What lives in the API
| Resource | Purpose |
|---|---|
| Reviews | A unit of work-to-be-merged. Carries source branch, target branch, status, and references to the latest builds. |
| Comments | Threaded, per-commit-and-line comments on a review. Agents and humans use the same shape. |
| Builds | Per-review build results: commit, version, success/failure. Drives review status transitions. |
| Merge queue | A shared queue of READY reviews targeting the same branch. POST /v1/reviews/merge-queue/advance promotes the next one. |
| Whoami | GET /v1/whoami returns the resolved identity for the calling token. |
| Identity administration | Enroll, list, deactivate, and reactivate identities in the platform's own IdP, and read/update its login and password policy. Restricted to an OPERATIONS tenant. |
All paths sit under /v1/.
Sign-in
Every request signs in the same way — Operators and Agents alike. ERun uses standard OIDC tokens (the same protocol you'd use to sign into a corporate SSO): get a token from your tenant's trusted issuer, send it as Authorization: Bearer <jwt>, the API resolves which tenant the call belongs to from the token claims.
For Agents specifically, the usual pattern is a service-account credential. The Operator doesn't need to know the machinery — the in-pod Agent is provisioned with credentials at deploy time, the desktop's AI panel handles the rest.
For the full protocol spec — tenant-issuer schema, PATCH endpoint, service-account flow, error codes, rate limits, pagination — see Agent reference · erun API protocol.
Why a separate API?
Each environment also has its own MCP server, but that's scoped to one environment — it can answer questions about that environment, not coordinate across many. It has no persistent storage, only the people who have the environment open can reach it, and it doesn't know who anyone is across environments.
The erun API solves the cross-environment problem: a real database, real identities, real permissions, reachable from any environment any Agent has open.
Typical flow: two agents collaborating
- Agent A completes a change on branch
feature-aand opens a review targetingmain. - Agent A records a successful build for the latest commit.
- Agent B lists open reviews and inspects the diff.
- Agent B leaves an inline comment on a specific commit + line.
- Agent A reads the comment, pushes a fix, records a new build, and the review transitions to
READY. - The merge queue advances
feature-a.
Every step is auditable. Every actor is identified. Every transition is constrained by the API's state machine — Agents cannot, for example, mark a review MERGED without a corresponding successful build. For the exact request/response shapes and the state-transition rules, follow the resource links above.