Spec

What Aruna claims, what it does not, and where it relies on trust. Two parties must be trusted: the attestor, permanently, and at this stage a dispute arbiter. The words used here are verifiable and reproducible.

Limits, stated openly

Listed up front so nobody has to ask.
  • The attestor must be trusted, permanently

    Five routes without a third party were tested and all are closed. The arbiter is a second trust assumption. Aruna runs both at first, openly.

  • immutable_verified is a bounded claim

    It means no detected upgrade path under the checks listed. Import presence is conservative, so the basis is always shown.

  • An immutable vault cannot be patched

    A bug is remedied by migrating to a new vault.

  • Recorded exposure is not current value

    The vault cannot read the target's state.

  • The TOCTOU window is at least 3 blocks

    A single-shard lower bound. The vault can refuse the next transaction, not one in flight.

  • Aruna itself is not covered

    The vault is a central point of failure. Mitigation is a TVL cap, immutability and an audit.

  • What Aruna does not promise

    No guarantee that an agent decides well, no reimbursement for trading losses, no claim that any contract is safe, no assumption that every code change is an attack, no guarantee the pool always suffices.

Closed detection routes

Five routes to detecting a code change without an outside observer were tested. All are closed, so the attestor is a permanent trust assumption.
Closed routes
RouteWhy it is closed
A contract reading another account's code_hash, state or access keysNo host function exists. near-sys offers own-account storage, promises, crypto, validators.
A contract calling RPCThe runtime provides no such path.
A cross-contract call reading raw stateIt can invoke methods only.
Guaranteeing the target's code at execution time by checking beforehandTOCTOU window of at least 3 blocks.
Trusting a target to report its own code identityMalicious code can return a false value.

The measured behaviour behind each row is on the lab results page.

Assumption register

Every place the system depends on something not proved, with the document it comes from.
Assumption register
IDAssumptionStatusSource
A1The attestor is trusted to observe code changes and report them.Permanent under the current protocol. Aruna runs it openly; an independent attestor is a condition of mainnet coverage.ARCHITECTURE.md, DECISIONS.md D-22
A2The arbiter resolves disputed drift reports.A contract cannot verify counter-evidence from chain data. At MVP the arbiter is the protocol owner.ARCHITECTURE.md, DECISIONS.md D-22
A3A lookback bound limits backdating of a reported change.It bounds backdating and does not eliminate it. It is not temporal truth.DECISIONS.md D-23
A4The window between a check and execution is at least 3 blocks.Measured single-shard, a lower bound. Multi-shard is untested.NEAR-FACTS.md section 5
A5Function-call key semantics measured with gas keys carry over to classic keys on a contract account.Expected, not proved. Tests T5 to T9 are owed before relying on it.NEAR-FACTS.md section 2
A6Testnet behaves like the lab.Not assumed. The lab ran at protocol 88; confirm the testnet protocol version and re-measure gas before the demo.NEAR-FACTS.md section 8
A7A contract cannot call a host function it does not import.Sound for absence. Presence of an import is weaker: it means a route may exist, not that it is reachable.NEAR-FACTS.md section 4
A8A contract that deletes its own account cannot be recreated with other code.Open. The delete-account import is scanned, and lab test T9 must confirm the behaviour before the word proof is used without qualification.NEAR-FACTS.md section 4
A9Event probabilities and capital cost used for premiums.Underwriting assumptions owned by the contract team, not measurements. The pricing dial on the landing page is a mock.CONTRACTS.md, premium

Three contracts

A per-owner vault cannot hold a shared underwriter pool, cross-owner concentration limits or a freeze beyond its own agents. So the system is split in three. The factory deploys vaults, and adapters translate named actions per protocol.
  • vault

    One per client, deployed by hash, no full-access key

    Funds, agents, policy, budgets, exposure, cached classes. The whole spend path stays inside the vault.

  • registry

    Shared

    Classifications, drift reports, challenge windows, attestor bonds, authorized classifiers, vault versions. Only authorized classifiers may write a class.

  • pool

    Shared, testnet only until release gate B

    Underwriter capital, coverage policies, capital adequacy, concentration limits, payouts. A waiting period defends against self-dealing.

Refusals return, authorization failures panic. A panic reverts state, so a refusal that panicked could not count toward auto-disable. Policy refusals return a blocked outcome and persist their effects.

Canonical refusal reasons
ReasonCounts toward auto-disableWhy not
ARUNA_TARGET_NOT_ALLOWEDyes
ARUNA_MAX_PER_TX_EXCEEDEDyes
ARUNA_DAILY_CAP_EXCEEDEDyes
ARUNA_SLIPPAGE_TOO_HIGHyes
ARUNA_RISK_CLASS_NOT_ALLOWEDnoa target can be reclassified under an honest agent
ARUNA_TARGET_FROZENnoa freeze hits every honest agent on the target
ARUNA_CLASS_STALEnoroutine, and absorbed by the SDK
ARUNA_INSUFFICIENT_BALANCEnothe owner's funding, not the agent's behaviour
ARUNA_AGENT_NOT_ACTIVEnoalready stopped
ARUNA_AGENT_AUTO_DISABLEDnoalready stopped

Coverage lifecycle

Coverage is parametric: the payout is recorded exposure times a ratio, capped, with no judgement about whether an upgrade was malicious.
  1. attestor observes a change

    then
  2. report_drift(DriftReport)

    Bond locks. Lookback bound checked.

    then
  3. target frozen

    Pushed in batches. A missed vault learns at its next refresh. New transactions are refused, not atomic across vaults. Anything already in flight cannot be stopped.

    then
  4. challenge window

closes clean

claim approved

parametric payout from pool, to the owner

conflicting report

Disputed: no payout

arbiter decides

  • report upheld: claim approved, payout
  • report rejected: claim rejected, bond slashed

Not covered

  • poor investment decisions, such as an agent buying a worthless token
  • losses from price movement
  • a vulnerability exploited without a code change
  • bugs or exploits in Aruna itself, explicitly excluded