SHIP Language

SHIP (Secure Heterogeneous Inference Programming) is a formally constrained Domain-Specific Language for translating natural language to verifiable bytecode.

Why SHIP Is Necessary

To bridge the gap between model inference and actionable outcomes, such as asset transfers, agent interactions, or smart contract invocations, Theseus introduces SHIP. SHIP is essential to express, verify, and govern the intent of sovereign AI agents, especially in inference-to-asset alignment scenarios where economic transactions or external actions result directly from model outputs.

The Problem with Raw LLM Outputs

While large language models (LLMs) are capable of generating text that resembles executable logic, they are inherently non-deterministic and lack formal guarantees about structure, safety, or correctness.

Attempting to use raw LLM outputs (e.g., via prompting) to generate bytecode or transaction logic introduces serious issues:

Unpredictability

LLMs may hallucinate functions, misplace parameters, or generate unsafe constructs

Unbounded Execution

Outputs may contain Turing-complete logic or fail to terminate, creating DoS risks

Lack of Proof Anchoring

Free-form outputs cannot be cleanly tied to proof anchors, making verification infeasible

Opaque Intent

The economic or operational intention behind raw outputs is implicit

SHIP Design Principles

To overcome these limitations, SHIP adheres to the following principles:

Determinism

All constructs are statically bounded and compiled to verifiable opcode sequences with known gas and memory profiles.

Verifiability

SHIP programs are compatible with Theseus' backends and generate Tensor Commit proofs alongside inference outputs.

Traceability

Each program is uniquely tied to its originating agent context and is traceable.

Composability

SHIP fragments can be staged, delegated, or templated by meta-agents.

SHIP Execution Flow

1. Inference

The agent runs a model and produces outputs (e.g., a token string).

2. Compilation

SHIP is used to translate natural language into structured outputs in two ways:

  • • The agent itself is fine-tuned on the SHIP language or provided context on the DSL
  • • There is a "meta-model" whose specific task is to transform natural language from an initial model into an output

The SHIP compiler transforms structured outputs into a valid, bounded sequence of operations.

3. Verification

Tensor Commit proves inference integrity, and SHIP bytecode is cross-validated against execution constraints.

4. Execution

Upon finalization, the program is submitted to the runtime.

Example Use Case

A sovereign agent runs a summarization model on-chain. The summary contains a trigger like "Pay 10 $THE to agent_xyz for document processing".

Without SHIP

This text would be parsed directly into bytecode, causing chances for execution unaligned with the agent's intention.

With SHIP

In pseudocode:

let payment = Transfer {
recipient: agent_xyz,
amount: 10 THE
};
commit(payment);

SHIP Integration with AIVM

SHIP programs are compiled to AIVM opcodes and executed via AGENT_TICK() or MODEL_INFER() syscall extensions.

Each SHIP construct maps directly to safe AIVM primitives, such as TLOAD, TCUSTOM, STATE_EXPORT, or TRANSFER_TOKEN.

Proofs are attached via Tensor Commit to anchor the linkage between inference and outcome.

📖 More Coming Soon

This page is being expanded with:

  • • Complete SHIP language reference
  • • Syntax and grammar specification
  • • Code examples and patterns
  • • Compiler usage and tooling