Remiora: A Local Runtime for Constrained Autonomous Trading
This document specifies how the runtime constrains an autonomous agent that trades real funds on real venues: the trust boundary, the enforcement path, the permission lattice, and the record it leaves behind. It is a working draft — parameters and mechanisms are subject to change as the build evolves.
Version
0.2
Status
Draft
Launch chain
Solana
Runtime
Solana & Ethereum
1. Abstract and design thesis
Remiora is a local-first autonomous trading runtime. It is a desktop application that runs on the operator's own hardware, holds its own keys, executes on-chain trades under constraints declared before a run begins, and writes every outcome to a local append-only log. It is not a hosted service, not a chatbot wrapper, and not a custodian.
The design thesis is narrow and unfashionable: a language model is a competent planner and an unreliable guardian. Any architecture where the same component both proposes and authorises an action inherits the weakest property of that component. Remiora therefore splits the system into a persuadable half and an unpersuadable half, and puts every irreversible operation behind the second one.
- Planning is probabilistic; enforcement is deterministic and written in ordinary code.
- Every irreversible action is preceded by a check that fails closed when it cannot complete.
- Nothing that leaves the machine is required for the runtime to keep working.
- A run that ends must state why it ended, in one of a fixed set of reasons.
2. System architecture
The runtime is layered so that trust decreases as you move up the stack and authority decreases with it. Upper layers may request; only the lowest layer may sign.
| Layer | Responsibility | May sign? |
|---|---|---|
| Planner | Reads market context, proposes candidate actions | No |
| Policy compiler | Turns session limits into machine-checked constraints | No |
| Safety gate | Validates each action against the compiled constraints | No |
| Executor | Builds, simulates, and submits the transaction | Yes |
| Keystore | Holds encrypted keys, signs only executor-approved payloads | Yes |
| Ledger | Appends hashed records of every attempt and outcome | No |
The planner never receives key material, never receives raw signing capability, and never receives a handle it can call to skip the gate. It receives a request/response interface: it proposes, and it is told yes or no with a machine-readable reason.
3. Threat model
We assume the model can be wrong, can be manipulated by adversarial market data, and can be talked out of the operator's intent. We assume some venues are hostile, some tokens are traps, and some RPC responses are stale or forged.
| Threat | Example | Mitigation |
|---|---|---|
| Prompt injection | A token page or social feed instructing the agent to raise its limits | Limits live outside the model; the gate cannot read instructions |
| Model error | A hallucinated pool or a mispriced route | Pre-trade simulation; the gate rejects on failed simulation |
| Malicious asset | Honeypot, transfer tax, blocklist, unlimited mint | Contract heuristics plus a sell-path probe before buying |
| Data poisoning | Forged quotes or a manipulated spot price | Multi-source price agreement within a bounded deviation |
| Infrastructure compromise | An attacker gains our servers | Our servers never hold keys, funds, or strategy state |
| Operator error | A run left unattended past its usefulness | Mandatory deadline and maximum-loss bounds on every mission |
Out of scope
A compromised operating system, a keylogger on the host, or a coerced operator. Local-first shifts the trust boundary onto the machine; it does not remove the need to keep that machine clean.
4. The fail-closed safety gate
Every swap and every bridge passes one mandatory check before execution. The check is identical in restricted and full permission modes, is evaluated inside the executor, and is not addressable from the planner. If any predicate cannot be evaluated — a timeout, an unreachable oracle, a malformed response — the action does not execute.
gate(action, policy) -> ALLOW | DENY(reason)
1 policy.freshness session policy signed and unexpired
2 scope venue, chain, and asset are in allow-list
3 budget notional <= remaining allocation
4 loss realised + projected <= max_loss
5 price_integrity sources agree within deviation bound
6 asset_risk sell path proven, no tax/blocklist trap
7 slippage quoted impact <= configured ceiling
8 simulation dry run succeeds against pinned state
9 rate_limit action count within session cadence
10 approval satisfied, or mode == full
any error, timeout, or unknown -> DENY(fail_closed)- There is no bypass flag, no privileged caller, and no natural-language escape.
- Denials are recorded with the failing predicate, not as generic errors.
- The gate is pure with respect to funds: it can only refuse, never initiate.
- Policy is compiled once per session and pinned by hash for the run's lifetime.
5. Permission lattice
A session locks two independent dimensions at start: shape (agent or mission) and authority (restricted or full). The four combinations form a lattice in which permission may be narrowed at any time and can never be widened mid-session. Widening requires ending the run and starting a new one.
| Configuration | Behaviour | Typical use |
|---|---|---|
| Agent · restricted | Continuous operation, every signature approved by hand | Learning the agent's judgment |
| Agent · full | Continuous operation, no prompts, gate still mandatory | Long-running market presence |
| Mission · restricted | Bounded objective, every signature approved by hand | A single supervised thesis |
| Mission · full | Bounded objective, unattended execution to a stop condition | Overnight or away-from-desk runs |
In restricted mode an unanswered approval request expires after one hour. Expiry is a denial, not a pause: the opportunity is dropped, the reason is logged, and the run continues. Silence never becomes consent.
6. Missions and the stop machine
A mission is a declaration of intent with hard bounds: a goal, a deadline, a capital allocation, and a maximum acceptable loss. It is a state machine with exactly one entry state and five terminal states.
DRAFT -> ARMED -> RUNNING -+-> DEADLINE_REACHED
+-> CAPITAL_DEPLETED
+-> MAX_LOSS_REACHED
+-> NO_VIABLE_OPPORTUNITY
+-> EMERGENCY_STOP
every terminal state writes: reason, timestamp, pnl, open_positionsThere is no sixth reason and no silent exit. A run that stops without a recorded terminal state is treated as a defect, surfaced to the operator, and reproduced from the log rather than explained away. Emergency stop is synchronous: it revokes signing authority first and unwinds afterwards.
7. Tiered local memory
Memory exists so the runtime improves without shipping the operator's behaviour to anyone. It is stored on disk, tiered by durability, and never synchronised by default.
| Tier | Horizon | Contents |
|---|---|---|
| Working | Current run | Open positions, live quotes, in-flight intents |
| Recent | Last sessions | Lessons from concluded runs, still probationary |
| Long-term | Indefinite | Durable conclusions promoted by the local judge |
- Lesson strength halves every thirty days and asymptotes toward, but never reaches, zero.
- Promotion to long-term memory is decided by a local judge that fails closed; a malformed verdict promotes nothing.
- Keys, seed phrases, and raw signatures are redacted before any write.
- Memory informs the planner. It is never an input to the safety gate, so a poisoned lesson cannot widen a limit.
8. Key custody and data boundary
Private keys are generated or imported locally and encrypted at rest with a key derived from the operator's passphrase. They are never transmitted, never included in backup or restore payloads, and never placed in model context. Compromise of any Remiora infrastructure does not expose operator funds, because that infrastructure never holds them.
| Data | Leaves the device? |
|---|---|
| Private keys and seed phrases | Never |
| Strategy configuration and limits | Never |
| Memory, lessons, and local logs | Never, unless explicitly exported |
| Signed transactions | Yes — to the chain, as any wallet does |
| Market data requests | Yes — to venues and price sources |
| Published track record | Only when the operator opts in |
9. Verifiable track records
The local ledger captures wins, losses, and blocked attempts in a single append-only stream. Each entry is hashed with the previous entry so that selective deletion is detectable rather than invisible; a published record that omits a losing week no longer verifies.
- Publication is opt-in and produces a derived attestation, not the raw log.
- Denied and blocked actions are part of the record; a clean record with no refusals is a red flag, not a badge.
- The underlying strategy is never part of what is published.
- Followers verify the attestation independently before mirroring anything.
10. $REM: token and network
$REM launches on Solana. The runtime itself is dual-chain by design and executes and bridges across Solana & Ethereum, while the token lives on Solana. The application is free and works without holding the token; $REM coordinates the network that forms around it.
| Function | Mechanism |
|---|---|
| Fee flow | Trading fees generated by the runtime fund buybacks |
| Followable strategies | Verified records become mirrorable inside limits set locally |
| Network access | Priority access to published records and premium venues |
| Coordination | Signals which strategies and integrations the network prioritises |
Legal
$REM is a utility token. It is not a security, it confers no claim on revenue, and nothing in this document is financial advice or an offer to sell. Only trust a contract address published by @remiora.
11. Known limitations
Stating what the system does not do is part of the specification. The following are accepted trade-offs, not undiscovered bugs.
- The gate reduces the probability of a bad trade; it cannot make trading profitable.
- Simulation is only as accurate as the state it pins, and chain state moves between simulation and inclusion.
- Local-first means local responsibility: a compromised host compromises the runtime.
- Deterministic enforcement will sometimes refuse a genuinely good opportunity. This is the intended asymmetry.
- Bridging inherits the security of the bridge; the gate constrains size and destination, not the bridge's own risk.
12. Roadmap and verification
| Capability | Status |
|---|---|
| Desktop build for macOS, Windows, and Linux | Shipped |
| Agent and mission modes, restricted and full | Shipped |
| Fail-closed safety gate and pinned policy | Shipped |
| Tiered local memory with decay and local judge | Shipped |
| Broader venue and chain coverage | In progress |
| Published, independently verifiable track records | Next |
| Followable strategies with locally enforced limits | Next |
The runtime is open source. Every claim in this document is written so that it can be checked against the code rather than believed on the strength of the wording. Where a claim and the code disagree, the code is correct and the document is a bug.
A. Glossary
- Fail-closed
- When evaluation cannot complete, the action is denied rather than allowed.
- Policy pin
- The hash of the compiled session limits, fixed for the run's lifetime.
- Terminal state
- One of five recorded reasons a mission may end.
- Local judge
- The on-device evaluator that decides whether a lesson becomes durable.
- Attestation
- A derived, verifiable summary of a local ledger, published by choice.
Ready to run it yourself?
Free and open source. Available today for macOS, Windows, and Linux.
Download the app