Agents & Models
Authored as a THESEUS.md, deployed to a runtime that signs every output.
In one paragraph
THESEUS.md (Markdown body with YAML frontmatter — analog to Claude Code’sCLAUDE.md) plus optional skills/<name>/SKILL.md siblings for reusable capabilities. The directory compiles into an on-chain entity with its own seus balance, its own state, and a static Agent Behavior Graph (ABG) elaborated from the file. Agents are event-driven, not always-on: they wake on triggers (events, schedules, or external call_agent), execute their ABG until an inference or tool call suspends them, and resume in a later block when the verified result lands.- ABG = bytecode: static, versioned, capped at 256 nodes per agent. Encodes both control flow and the agent’s declared capability surface.
- AKG = execution log: dynamic graph of runs, steps, and observations. Mostly DA-backed via pallet_store with on-chain anchors.
- Three-stage execution: queue (call_agent) → prove (submit_inference_result) → resume (inherent hook on next block).
- Reverse gas: the agent pays for its own seus, not the caller. At zero balance it stops; after 90 days at zero its state is reclaimed.
- Sub-agent calls bounded at depth 2: an agent can call another, but the callee can’t call a third.
See an agent in code
Theseus agents author in the OpenClaw-style format: the agent itself is THESEUS.md at the root of an agent directory, with reusable capabilities (if any) under skills/<name>/SKILL.md. The Markdown body is the system prompt and operating contract; the YAML frontmatter names the models, native tools, controller, and intent surface so one directory is enough to deploy. Open any live agent for a real example.
Agent file format
An agent directory holds a top-level THESEUS.md (analog to Claude Code’s CLAUDE.md) plus optional skills/<name>/SKILL.md files for reusable capabilities the agent invokes. The canonical frontmatter fields shape the agent definition; Theseus extensions on the bottom are read by the chain when the agent registers.
| Frontmatter field | Purpose |
|---|---|
name | Human-readable display name shown in the directory and on the credential. |
id | Stable slug used as the directory name and the on-chain agent handle. |
description | One-line summary indexed by /poa and search. |
models | Tensor Commits the agent is allowed to call. |
native-tools | Built-in host functions and contract-call primitives the agent may invoke. |
schedule | Trigger spec: block cadence, event source, or on-demand. |
sovereign | Theseus extension. true for fully autonomous, false for controller-gated. |
controller | Theseus extension. SS58 address of the operator wallet, or null for sovereign. |
intent_types | Theseus extension. Set of intent kinds the agent is permitted to emit. |
The body itself uses three recommended headings: ## What it does, ## Inputs, ## Outputs, then ## Instructions (the verbatim system prompt the agent runs under). shipc compile elaborates this into a CompiledAgent the runtime executes.
Agent Registration
Agents register via THE1 standard. Any human or agent can deploy a new agent by supplying:
| Field | Purpose |
|---|---|
| Code hash | Binary verification for AIVM/HVM |
| Autonomy flag | 0 = human-gated, 1 = sovereign |
| Controller identity | Optional pubkey for human override |
| AIVM version | Required ISA features |
| Resource quota | Max FLOPs per epoch |
| Stake | $THE locked for slashing |
| Initial context | Agent context from TheseusStore |
Model Registration
Models are registered separately and can be invoked by any agent that pays the posted fee.
| Field | Purpose |
|---|---|
| Name & version | e.g., Llama 3.1 8B |
| Architecture | LLM, diffusion, GAN, etc. |
| Tensor Commit | Cryptographic weight fingerprint |
| Param count | For fee estimation |
| Base fee | $THE per inference |
| Owner | Revenue destination (address/DAO) |
| Weights URI | Where validators fetch params |
| Compute spec | For Tensor Commits generation |
| Permissions | Access control rules |
Sovereign Agent Inference Loop
How sovereign agents decide when to run inference, without human sign-off or off-chain schedulers:
Wake trigger fires
Scheduled block height, an on-chain event the agent subscribes to, or an external call_agent.
ABG advances
pallet_agents interprets the agent's behavior graph through synchronous nodes (conditions, sequence, parallel) until it hits a model or tool call.
Reverse-gas check
The agent pays from its own seus balance. At zero balance the agent stops running; the call doesn't queue.
Queue + suspend
AIVM queues the inference job and emits InferenceQueued. The agent suspends. A prover picks it up, submits a verified result, and the agent resumes via on_initialize on a later block.
Fully Sovereign
Inter-Agent Interaction
Agents with an address, balance, and ABI can call each other like contracts, except either side can invoke models mid-flow.
Discovery
Agents publish service manifests on-chain (selectors, purpose hash, access mode)
Call & Pay
Caller sends AIVM request with callee, function, args, and optional capability token
Model Invocation
Either side can invoke models: caller before call, callee during execution
Result Handling
Same-block returns immediately; longer jobs issue promise events
Model Usage Fees
Model owners set base fees in $THE. Fees flow directly to owners. Built-in order book batches intents per block, converging prices to marginal cost without off-chain brokers.
Dishonest proofs burn the offender's stake. Economic security scales with staked value.