Version: 0.1 (2026-04-19)
Status: Draft — open for adoption
Reference implementation: agent-bouncer/ in this repo
A convention for structured iterative refinement between AI agents using in-document markers with auto-expiry. Two agents take turns editing the same document; structured disagreement is recorded inline; staleness rules guarantee convergence in a bounded number of passes.
Two markers are defined. Both appear inline in the document, on a line immediately below the text they reference.
Used when an agent disagrees with the preceding text and proposes a concrete alternative.
The classifier should retry on transient errors with exponential backoff up to 5 attempts.
[CONTESTED] Five attempts is too aggressive for an LLM call costing $0.10/invocation.
Cap at 2 attempts and surface the failure; let the caller decide whether to retry.
A [CONTESTED] note must include both the disagreement and a specific alternative. Notes that only register dissent ("I disagree") are non-conforming.
Used when an agent finds the preceding text ambiguous and needs the next agent to disambiguate.
Rate-limit all endpoints.
[CLARIFY] Does "all endpoints" include /metrics and /health? (A) Yes, treat all paths
equally. (B) No, exempt observability endpoints.
A [CLARIFY] note must include either two concrete interpretations or a question with a finite answer space. Open-ended notes ("what does this mean?") are non-conforming.
The protocol guarantees termination in a bounded number of passes:
- The bounce runs for at most
Npasses (typically 2).Nis fixed before the bounce starts. - On every pass except the last, agents may add new
[CONTESTED]/[CLARIFY]notes and may resolve inherited ones (resolving = deleting the note, not replying to it). - On the final pass, the agent must not introduce new notes and must resolve every remaining inherited note.
- The document is converged when zero
[CONTESTED]and zero[CLARIFY]notes remain.
Total wall-clock cost is capped: at most N passes × cost-per-pass. The number of unresolved notes is strictly bounded after the final pass — by rule 3, it is zero.
This is the protocol's load-bearing property. Without the final-pass rule, debate can chain indefinitely; with it, every bounce produces a converged artifact in finite time.
Implementations may assign each pass a role lens to bias the agent's perspective. The reference implementation uses two:
- Reviewer — looks for what's missing, wrong, or unclear. Adds notes liberally.
- Composer — integrates resolutions. Resolves notes liberally; adds new notes only when genuinely necessary.
Roles typically alternate by pass. The protocol does not require any specific role taxonomy — implementations may use domain-specific lenses (e.g., security / performance / correctness).
The protocol is substrate-agnostic. The reference implementation uses markdown files on the filesystem, but the markers are plain text and work in any text-editable document. JSON, source code, plain text, RFC drafts, and chat transcripts have all been demonstrated.
A conforming implementation must:
- Accept a document and a fixed pass budget
N ≥ 1 - Run two agents alternately for
Npasses - Pass each agent a prompt that includes the current document, the pass number, and the agent's role
- Enforce the final-pass resolution rule (count markers; reject output that violates rule 3)
- Return the converged document
Optional but recommended: persist per-pass artifacts (the document state after each pass) for audit and debugging. The reference implementation writes these to runs/bouncer-{name}-{timestamp}/.
This protocol is published as an open convention. Tools that emit and resolve these markers can interoperate — a document refined by one tool can be picked up and refined further by another, as long as both honor the convergence rule.
To adopt:
- Implement the marker format above
- Wire it into your existing multi-agent pipeline as an in-document refinement layer
- Honor rule 3 (final-pass resolution) — this is the only non-negotiable
The reference implementation in agent-bouncer/ is ~200 lines of bash, agent-agnostic, and ships with adapters for Claude and Codex CLIs. Adapters for additional agents are 5–10 lines each.
This specification is published under CC0 1.0 Universal — no rights reserved. Adopt freely.
Co-Evolution project: github.com/alanshurafa/co-evolution