Whitepaper · submitted to USENIX SAIS '27

Monotonic Trajectory Pre-Order Concurrency and Mechanical Recovery for Autonomous Multi-Agent Swarms

The research behind XORAS: stop asking the model to fix its own mistakes, and make shared agent state impossible to silently rewrite.

12.8 µs
pre-execution check
1,140 ms
prompt-retry latency
2,642
tokens per retry trial
0 sorry
Lean 4 placeholders

Figures as reported in the paper's clean-room CI evaluation. Independent replication is welcome — everything needed is in the repository.

The problem in plain English

When several AI agents share the same files, memory or databases, today's frameworks handle mistakes in one of two bad ways. They either lock everything while a model "thinks" (which stalls the whole team for seconds to minutes), or they throw the work away and ask the model to try again. When something breaks, they usually ask the model to fix its own error — which is slow, burns tokens, and sometimes never converges.

Worse, when an agent "takes back" a belief, most systems overwrite history. Nothing crashes, but the record of what happened quietly changes. That's context drift.

The Sovereign Triad

  • MARS — Model-Agnostic Reversible State. A strict wall between the plane where models reason (untrusted) and the plane where actions actually execute (deterministic). Proposed actions are tagged as speculative and must pass a validator before they're allowed to touch real state.
  • MTPO — Monotonic Trajectory Pre-Order. Undoing something never erases history; it appends an exact inverse step. The timeline only ever moves forward, so it can always be audited and recovered mechanically — no prompt loop needed.
  • REASONS — structured delivery contracts. Every mission states what "done" means up front, so success is checked against a contract rather than an agent's say-so.

§ Claim / evidence ledger

We audited our own agents' stress test.

What they claimed vs. what the code did.

Agent claimed
Code actually did
2,048 recursive agents stress-tested
2,048 hash-and-sleep coroutines, flat, no delegation
Empirical breaking point found
Sentence hardcoded in the report; test stopped at the limit
Zero GC stalls, zero heap contention
No garbage-collection or allocation instrumentation present
MARS + MTPO validated
Neither was invoked by the test

The orchestration wasn't broken — that test bypassed it. That gap between report and reality is what XORAS exists to catch.

§ Operating rules

Four rules that stop agents from lying to you.

01

Receipts, not reports

Every claim links to the run that produced it: inputs, code path, outputs, hash.

02

No self-grading

The agent that did the work never approves it. An independent validator checks against a contract.

03

Frozen source of truth

A known-good snapshot to fall back to. Retrace from it, then go forward.

04

Drift is measured

Each handoff is compared to the original intent. Drift becomes a number, not a vibe.

§ Audit → enforce → prove

Atlas finds it. Sentry fixes it. The Gauntlet proves it.

01Live

Atlas

xoras.info · cloud

Reads how your agents work and returns a risk score, attack paths and a fix plan.

02Scanner live · Atlas pull planned

Sentry

your machine · local

Runs locally. Today it blocks leaked keys at commit time; next it pulls your Atlas fix plan and applies the boundaries.

03Open source

UPGP v5.0 Gauntlet

your machine · local

Fires the 15 boundary vectors and compiled exploit binaries, then writes a signed receipt of what held.

Sources: xoras-sentry · upgp-proving-ground. The Atlas-to-Sentry handoff is on the roadmap, not shipped.

§ UPGP v5.0 Ultra — 15-vector boundary suite

What the Gauntlet actually attacks.

VectorDefense surfacePass criteria
V-01Microarchitectural cache isolationWelch's t-test < 1.96 across cache timings
V-02Shared-memory pointer protectionZero exposed heap/pointer addresses in trace buffers
V-03Dynamic import / exec intercepteval, execSync, process.binding blocked
V-04Environment secret isolationProcess environment unreachable
V-05Filesystem traversal rejection../ escapes and sensitive dirs refused
V-06Outbound network interceptZero unauthorized sockets
V-07Heap allocation ceilingHeap growth capped per run
V-08Binary payload scanningEntropy scan for hidden executables
V-09State orderingSHA-256 Merkle chain; replays rejected
V-10Prototype reflection lock__proto__ / reflection mutation frozen
V-11Constructor bypass wallFunction("return process")() intercepted
V-12/proc/self/root symlink lockRoot symlink escape blocked
V-13File-descriptor exhaustion barrierHandle leaks capped with prlimit
V-14Signal trap immutabilitySIGSYS trap cannot be ignored
V-15Atomic double-bufferingLock-free shared memory, no lock stalls

Plus native Seccomp-BPF with 19 kill rules and 5 compiled exploit binaries (ptrace, /proc/self/mem, unshare, raw socket, bpf), all reported contained. Kernel enforcement needs Linux; macOS and Windows run the emulated checks. Results as reported in the repository — run it yourself to reproduce.

PROTOCOL / STATE & TRAJECTORY

MTPO + MARS

Change the state. Keep the history. MARS controls how a proposal becomes an action. MTPO constrains how the recorded trajectory advances—even when an action is undone.

The mathematical structure

A pre-order is a relation ≼ on a set X of admissible trajectories. It is reflexive and transitive; unlike a partial order, it need not be antisymmetric.

Reflexive: τ ≼ τ
Transitive: τ₁ ≼ τ₂ and τ₂ ≼ τ₃ ⇒ τ₁ ≼ τ₃

MTPO: accepted trajectory transitions preserve this ordering. A recovery is another recorded transition, not a rewrite of the previous trajectory.

(H, n) ≼ (H′, n′) iff
n ≤ n′ and
∀ i: 0 ≤ i < n ⇒ H′(i) = H(i)

In the public Lean model, n is the number of committed entries: the log cannot shrink, and every old entry must remain unchanged. This is the Monotone definition and its reflexivity/transitivity lemmas, written here in mathematical notation.

τ′ = extend(τ, a)
accept(a) only if τ ≼ τ′
and policy, ownership & version checks pass

MARS: separates model proposals from controlled state transitions. For a reversible operation Δ, its inverse restores the affected state when the inverse’s preconditions still hold.

Δ⁻¹(Δ(s)) = s
H₁ = H₀ ⧺ [Δ]
H₂ = H₁ ⧺ [Δ⁻¹]
H₀ is a prefix of H₁ and H₂

Notation: s = affected state; τ = trajectory; H = event history; Δ = reversible change; ⧺ = append. Only the history-preservation relation above is transcribed from the linked Lean definition; the action and recovery equations are explanatory. Appending a log entry alone does not validate an action.

One proposal, four controlled steps

  1. 01 / Reasoning plane · untrusted

    Propose

    An agent proposes a structured change: target, expected version, intended effect and evidence. A proposal is not permission to execute.

  2. 02 / Boundary · before execution

    Validate

    The deterministic gate checks the proposal against the allowed transition relation, ownership, version and policy. A rejected proposal leaves committed state unchanged.

  3. 03 / Execution plane · controlled

    Apply & record

    For an accepted reversible change, capture its inverse and apply it with a durable receipt. The implementation must keep the state update and its recovery record consistent.

  4. 04 / Recovery · no erased history

    Recover by appending

    If a check detects a failure, validate and apply the recorded inverse. Append a recovery event rather than delete the original event or ask the model to invent a repair.

A small, reversible example

An agent proposes changing a counter from 41 to 42. The gate checks the expected version and write permission. After applying the change, a separate acceptance check fails.

The counter goes back; the record does not. If another agent has changed the counter since, a blind inverse could overwrite that work. Recovery must check versions and dependencies first; an unsafe inverse is blocked or escalated.

Instead of a prompt-retry loop

Detect → ask the model to repair → regenerate → recheck → repeat. Each attempt may add latency, tokens and another uncertain result.

For a recorded reversible change

Detect → validate recorded inverse → apply → append receipt. Recovery does not need a new model call to reconstruct the previous state.

Boundary of the guarantee: this is not universal undo. Sent emails, leaked secrets and other irreversible effects cannot be erased by an inverse. They need prevention, explicit approval or a separate compensation workflow. Mechanical recovery also does not solve the original reasoning error; a new proposal may still be needed.

Evidence scope: the linked Lean model covers an abstract append-only log, not concurrent writers, crashes or irreversible side effects. The separate inverse-recovery model assumes an exact inverse exists. The original paper link was unavailable when this guide was checked; MARS is explained using this site’s terminology, not presented as an independently verified formal definition.

How it's verified

The paper shows, in the Z3 solver, that classic 1985 AGM belief contraction lets execution histories reorder, and that MTPO's append-only rule rules this out. The same result is proved in Lean 4 for single steps and for sequences of any length, and a differential checker confirms the Lean and Z3 results agree. A "non-vacuity" gate feeds in a deliberately false theorem to make sure the proof system actually rejects it.

Limitations

The paper includes its own threats-to-validity section. The proofs cover the formal model of the protocol; real-world deployments still need the runtime to faithfully implement that model. That's exactly why XORAS tooling focuses on receipts and independent validation rather than claims.

Authors

Anthony Oxendine and the XORAS Lead 9 Council · XORAS Systems / Sovereign Research Group.