5-minute local run
Run one complete workflow with the Rulith REPL and Worker on your machine: readinput.json, derive an exact total on the board, writeoutput.json, and finish only after an independent read-back matches.
Use the included sample data or other non-sensitive test data for this public-beta walkthrough.
What the five minutes cover
The clock starts after you have Node.js 20 or newer, a model API key or OpenAI-compatible local endpoint, and a Rulith account. The run itself requires no database, Docker image, or custom Worker code.
You will use:
- one durable Agent in Rulith Cloud;
- one local, workflow-independent REPL;
- one local, generic Worker;
- one governance-installed example capability;
- one JSON input and one JSON output.
Your model credential and Connection key remain in local environment variables. The setup program never asks for or stores them.
1. Create the Agent and Connection
Sign in to Rulith Console.
- Under Agents, create an Agent named
verified-calculation. - Under Access & credentials, generate an Agent token. Copy the full value; it is shown once.
- Under Connections, create a Worker Connection for that Agent, named
verified-calc-worker. - Copy both the public channel ID and the Connection key. The key is shown once.
- Open Capabilities → Capability market, search for
Verified Calculation, select this Agent, review its Vocabulary, Rules, Actions, and Sources, then install the Capability once.
The market presents one Capability and the Agent receives one installed Capability. Internally its manifest groups typed knowledge and source components so the protocol can validate them independently; users do not install those components separately. The example uses the same path as community capabilities and has no privileged installer. After installation, open Agent → Configuration → Data sources and bind verified-calculation-local to verified-calc-worker. The reusable Source declaration deliberately contains no Agent-owned Connection.
The Agent token lets the local REPL drive that Agent. The Connection key lets the local Worker claim work from that Agent's active cases, but not cases owned by another Agent. Capability packages are installed by the signed-in governance user in Console; neither credential can install or replace them.
2. Download and prepare the example
macOS or Linux:
curl -fSLO https://console.rulith.ai/examples/verified-calculation/setup.mjs
node setup.mjs
cd rulith-verified-calculation
Windows PowerShell:
Invoke-WebRequest https://console.rulith.ai/examples/verified-calculation/setup.mjs -OutFile setup.mjs
node setup.mjs
Set-Location rulith-verified-calculation
The setup downloads the public rulith-agent.mjs and rulith-worker.mjs, the local Adapter Manifest worker-tools.json, reference Adapters, and a sample input.json. It does not download, render, or upload capability packages; the REPL reads the approved Agent configuration from Rulith Cloud.
The complete local runtime is available under Apache-2.0 at github.com/rulith-dev/rulith-runtime.
3. Start the Worker
In terminal one, set the Connection credentials and start the Worker.
macOS or Linux:
export RULITH_CHANNEL='<channel-id>'
export RULITH_CHANNEL_KEY='<connection-key>'
export RULITH_TOOLS_FILE='./worker-tools.json'
node rulith-worker.mjs
PowerShell:
$env:RULITH_CHANNEL='<channel-id>'
$env:RULITH_CHANNEL_KEY='<connection-key>'
$env:RULITH_TOOLS_FILE='./worker-tools.json'
node rulith-worker.mjs
The Worker is an execution host, not a second reasoning agent. Capability Actions reference versioned Tools and Sources. The local Adapter Manifest maps those Tool IDs to the reference Adapters in this directory. On first poll Rulith pins only each Tool ID, digest, and Source to this Connection; Adapter paths and credentials stay local. The Worker validates bounds and returns structured receipts.
4. Run the local REPL
Open terminal two, enter the generated directory, then set your Agent and model credentials.
With Anthropic:
cd rulith-verified-calculation
export RULITH_TOKEN='<agent-token>'
export ANTHROPIC_API_KEY='<model-key>'
export RULITH_CASE_BOARDS=on
node rulith-agent.mjs --agent verified-calculation --ui \
"Read the configured calculation input, calculate the exact total, and write the verified result."
For an OpenAI-compatible local or hosted model, set these instead of ANTHROPIC_API_KEY:
export RULITH_MODEL_KEY='<model-key>'
export RULITH_MODEL_URL='http://127.0.0.1:1234/v1/chat/completions'
export RULITH_MODEL='<model-id>'
In PowerShell, use $env:NAME='value' for the same variables and run the final node command on one line. Start that terminal with Set-Location rulith-verified-calculation.
The --ui flag starts a loopback-only timeline for this local run and prints its URL. It does not expose a public listener or move your model credential into Rulith Cloud.
5. Verify the result
The input is:
{
"job_id": "calc-001",
"unit_price_cents": 129900,
"quantity": 2,
"shipping_cents": 3000
}
The board derives subtotal_cents = 259800 and total_cents = 262800. The expected runtime/output.json is:
{
"job_id": "calc-001",
"subtotal_cents": 259800,
"total_cents": 262800,
"status": "completed"
}
The case may close only when all three agree:
- the exact result derived from source-attested input;
- the synchronous Worker write receipt;
- a separate read-only verification of the persisted file.
A fluent model answer or a successful write alone cannot certify completion.
What came from where
- The Capability supplies its Vocabulary, Rules, Actions, and Sources as one governed unit.
- Actions declare bounded board transitions and may name versioned Tools for external work.
- Sources declare what may attest which predicates; governance binds each live Source to the Agent's Worker Connection.
- The local Adapter Manifest implements those Tools with fixed Adapters. It is deployment configuration, not another Capability component or market package.
- Constitution is empty in this minimal case; add it when an outward action needs a prohibition or human approval.
- The REPL remains workflow-independent. Install a different governed configuration in Console and provide matching local adapters to run another workflow.