exaspec / Documentation

exaspec manual

This service is currently only available by invitation.

  1. Overview
  2. Requirements
  3. Endpoints
  4. Setup
  5. Requests and results
  6. Sessions
  7. MCP tools
  8. Session items
  9. Agent
  10. Billing
  11. Account and tokens
  12. Use of your work

Also see the Terms of use and the Privacy policy.

Overview

exaspec runs agents that develop verified programs in your GitHub repositories. It uses leanexe, which compiles functions written in a restricted dialect of Lean to WebAssembly, C, and machine code and proves in Lean that the compiled code computes those functions. The agent also uses exaspec's private library of Lean proofs and its knowledge base of proof methods.

exaspec is designed for agent use. There is no UI beyond account management.

Your agents work with exaspec through exaspec's MCP server. An exaspec agent has its own session running on its own computer. The agent pushes its work to a branch in each repository it changes. You pay for the session's computer time and for the agent's inference with prepaid credits.

Requirements

  1. An MCP client that supports the streamable HTTP transport and a custom request header, such as Claude Code.
  2. A GitHub repository for each project, with at least one commit on its default branch. The repository contains a Lake package that requires leanexe, or the agent creates one. The package requires a tagged leanexe release that exaspec supports and uses that release's Lean toolchain, and each of its git dependencies has a https://github.com/ URL. exaspec supports no release yet, because leanexe has none.
  3. A GitHub fine-grained personal access token with read and write access to the contents of those repositories and of their private dependencies. A token can access only the repositories of one GitHub user or organization, so the projects and their private dependencies must belong to one owner.

Endpoints

EndpointURL
Signupexaspec.com/signup (by invitation)
Manualexaspec.com/manual
Account pageexaspec.com/account
MCP serverapi.exaspec.com/mcp

Setup

  1. Sign up at exaspec.com/signup with an email address, accept the terms of use, and choose whether to share your work, as Use of your work describes. The page shows your exaspec token once, with the command that adds the MCP server. The account starts with $20 of free credit.
  2. Create the GitHub token on GitHub under Settings, Developer settings, Personal access tokens, Fine-grained tokens, Generate new token. Under Repository access, choose Only select repositories and select the project repositories and their private dependencies. Under Permissions, give Contents read and write access. The token can read public repositories, such as leanexe, without further grants. An organization can require approval before the token can access its repositories.
  3. Open exaspec.com/account, sign in with your exaspec token, and save the GitHub token. Save a new token there before the old one expires.
  4. Add the MCP server to Claude Code:
    claude mcp add --transport http exaspec https://api.exaspec.com/mcp --header "Authorization: Bearer TOKEN"
    Add --scope user to make the server available in every project. Do not use --scope project, which writes the token into .mcp.json in the repository. For another client, use the URL https://api.exaspec.com/mcp, the streamable HTTP transport, and the header Authorization: Bearer TOKEN.
  5. Ask Claude Code, or the agent in your other client, to create an exaspec session and send your request to it.

Requests and results

A request specifies the repositories, the functions, the properties to prove, the compilation targets, and whether the agent may change the program. For example: "In alice/sorting, prove that insertionSort returns a sorted permutation of its input, and compile it to WebAssembly with a call theorem. You may change the program if that makes the proof easier."

The agent starts from each repository's default branch unless the request specifies another branch or commit, and it can read only what is pushed to GitHub. It works on the branch exaspec/SESSION, where SESSION is the session ID, and pushes that branch after each stage of the work. exaspec refuses the agent's pushes to any other branch or tag. Do not push to exaspec/SESSION yourself while the session exists.

To make a program provable, the agent proposes changes to it. A change that keeps the program's behavior comes with a Lean proof that the new program equals the old one, and permission in a request applies only to such changes. A change to the behavior or to the specification always waits for your answer.

The agent finishes its work within a turn and ends a task with a report that lists the repository, branch, commit, and theorems. Intermediate pushes can be incomplete, and the final branch builds without exaspec. To check a result, read each theorem's statement and the specification it uses, build the branch, and run #print axioms on each theorem. A theorem whose axioms are only propext, Classical.choice, and Quot.sound uses no sorry and no added axiom. Merge the branch yourself, for example through a pull request.

Sessions

A session ID is 8 lowercase hexadecimal digits, such as 3f9a2c1d. The session's type determines its computer's size and price, and files on the computer remain until you delete the session.

TypevCPUsMemoryPrice per hour
medium416 GiB$0.40
large832 GiB$0.80
xlarge1664 GiB$1.60
xxlarge32128 GiB$3.20
StateMeaning
runningThe computer is on, and its time is charged each minute.
suspendedThe computer is off and keeps its files. send or resume starts it.
deletedThe computer and its files are gone. The session's items remain readable with wait.

A turn is one run of the agent on the messages you have sent, and busy is true while a turn runs or a message waits for one. A message sent during a turn waits for the next turn. The agent asks a question by ending its turn with it, and you answer with another message.

A turn runs until the agent ends it, stop or delete_session ends it, or exaspec stops the session for lack of credit. A turn that ends early does not run again, and work that the agent has not pushed stays on the computer. A running session stops after 15 minutes with no turn running, and computer time is charged until it stops. Calls that start no turn do not extend that time.

MCP tools

Every request must include the header Authorization: Bearer TOKEN, and a request without a valid token receives HTTP 401. A failed call returns an MCP error result whose text begins with one of the error codes below. A session argument is a session ID, and item IDs are integers. Amounts are US dollars as decimal strings with six places, such as "-0.012500", and a ledger row for a charge has a negative amount. Times are UTC in RFC 3339 form.

To carry out a request, call send, then call wait repeatedly with after set to the largest id among the items that wait has returned for that session, or 0 at first. Stop when a result has busy false and fewer than 100 items. The last agent or held item before the last end item is the agent's report or question. Show the user each held, refused, and push_failed item, and answer a question with send.

exaspec keeps all items, so you can stop calling wait and continue later with the same after. exaspec staff decide on a held item later, and a later wait returns the decision as a new item. Do not ask the agent to repeat a held item.

ToolArgumentsResultBehavior
create_sessiontype: medium, large, xlarge, or xxlarge; default medium. development: a short name for the work, such as sortingsessionCreates a session and starts its computer. Fails with no_github_token or no_credit.
list_sessionsnonesessions: each session's session, development, type, state, busy, created_at, hourly_usd, and charged_usdLists every session of the account, including deleted ones. charged_usd is the total of the session's charges, as a positive amount.
sendsession, textmessage: the ID of the new user itemStarts a suspended session, and starts a turn if none is running. Fails with no_credit.
waitsession, after: an item ID; default 0items, busy, state, and turn while a turn runsReturns up to 100 items with IDs greater than after. Returns at once if such an item exists or the session is not busy, and otherwise when the first such item appears or after 50 seconds.
stopsessionstateSuspends the session and ends a running turn.
resumesessionstateStarts a suspended session without starting a turn. Fails with no_credit.
resizesession, typestateChanges the session's type. Fails with session_running unless the session is suspended.
delete_sessionsessionnoneEnds a running turn and deletes the computer and its files. Pushed branches remain on GitHub.
balancenonebalance_usd, ledger: the latest 50 rows, each with at, kind, amount_usd, and session, which is null on grant and purchase rowsReturns the balance and the latest ledger rows.
buy_creditsamount_usd: an integer number of dollars from 10 to 1000urlReturns the URL of a checkout page. The purchase happens when the user pays on that page.
Error codeCause
no_creditThe balance is zero or below.
no_github_tokenThe account has no saved GitHub token.
unknown_sessionThe account has no session with that ID.
session_deletedThe session is deleted.
session_runningThe call needs a suspended session.
invalid_argumentAn argument is missing or invalid.

A tool that takes a session fails with unknown_session for an ID that the account does not own. On a deleted session, every such tool except wait fails with session_deleted.

While a turn runs, wait also returns turn, a description of the turn that gives counts and resources and none of the agent's work.

FieldMeaning
elapsed_sSeconds since the turn started
memory_bytes, memory_peak_bytesThe turn's memory use now and at its peak
cpu_sCPU seconds that the turn has used
model_requests, tool_callsModel requests and tool calls of the agent and its subagents so far
tasks_runningSubagents and background commands running now

Session items

Every item has id, at, and kind, and a session's item IDs increase in the order in which the items are created. exaspec checks every message and push from the agent before you receive it. exaspec staff review each item that the check holds and then release or refuse it, and exaspec gives no reason for a hold.

KindFieldsMeaning
usertextA message you sent.
agenttextA message from the agent.
pushrepo, branch, commitA push that exaspec forwarded to GitHub.
push_failedrepo, branch, commit, errorA push that GitHub rejected, with GitHub's error text.
heldof: agent or pushAn item held for review.
refuseditem: the held item's IDYou will not receive the held item.
endcause: done, stopped, balance, or error; result; duration_s; pendingThe turn ended. exaspec writes this item after it has checked every message and push of the turn.

When exaspec staff release a held item, wait returns it as a new agent or push item whose released field is the held item's ID.

An end item's result is the outcome that the agent's runtime reports, such as success or error_max_turns, and duration_s is the turn's length in seconds. pending, present when it is not 0, counts the subagents and background commands that were still running when the turn ended. Their results are lost, so the agent's last report may promise work that it did not do.

Agent

The agent has full use of its computer, which has git, the Lean toolchain, Lake, Python, Node, and uv, with exaspec's private library, knowledge base, and tools. The computer can connect only to exaspec. exaspec serves the agent's git requests for https://github.com/ repositories, which it fetches with your GitHub token, and forwards the agent's pushes to GitHub after checking them. The agent has no web search and no other network access.

The agent follows the instructions in the CLAUDE.md and AGENTS.md files in your projects where they do not conflict with exaspec's rules. It asks you only about the request, the specification, or a change in behavior. exaspec does not disclose the model that the agent uses, and the agent does not discuss it.

Billing

Credits are prepaid US dollars. The account's ledger has a row for each credit, each charge, and each expiry of unused credit.

KindAmount
grantFree credit at signup
purchaseA purchase on a checkout page
computeEach minute a session is running: minus the type's hourly price divided by 60
inferenceEach model request of the agent: minus a charge based on the amount of text that the request reads and writes
expiryCredit unused 12 months after it was added: minus the unused amount

exaspec deducts charges from the oldest credit first. An account that shares its work pays 30% less for computer time and model use. exaspec can change that percentage with 30 days' notice. Charges can take the balance below zero. Within a minute after the balance reaches zero or below, exaspec stops every session of the account. create_session, send, and resume fail with no_credit until a purchase raises the balance above zero. A purchase is from $10 to $1,000.

Account and tokens

The exaspec token is the account's credential, and exaspec shows it once, at signup. Anyone who has the token can spend the balance and direct the agent in your repositories. On the account page, you can get a new token, which cancels the old one. If you lose the token, enter the account's email address on the account page to receive a one-time link that issues a new token. The account page shows the balance, the full ledger, and the sessions, and on it you can save or replace the GitHub token and change the sharing choice. exaspec uses the GitHub token only for the agent's git operations and never shows it again. exaspec staff can limit or suspend an account.

Use of your work

exaspec keeps each session's messages, the agent's transcripts, records of its pushes, and copies of the repositories that the agent fetches. An automated reviewer and exaspec staff read your messages, pushes, and project files when they review an item. A model provider that exaspec does not name processes the agent's model requests.

At signup, you choose whether to share your work, and you can change the choice on the account page. For an account that shares, the agent sends exaspec the lessons of each proof task with the relevant files from your project. exaspec generalizes each lesson, removes details specific to your project, and may add it to the knowledge base that the agent uses for every user. exaspec also uses that account's transcripts, project files, and pushes to improve its knowledge base and to train its own models. When that work reveals a defect or a missing theorem in leanexe, exaspec staff may report it in a public issue or pull request on leanexe's repository, with none of your code, names, or other details of your project. For an account that does not share, exaspec uses its work only to run and check the service, and it deletes the records of that work 90 days after the session is deleted or the account closes. Work that the agent pushes can include material from exaspec's private library, which the terms of use license you to use in your projects. The terms of use and the privacy policy govern these uses.