SystemOneHarness README

The project's README from github.com/HarnessRouter/SystemOneHarness. As one markdown file: README.md.

System One Harness
The harness for System One models.

GitHub stars License: Apache 2.0 Version 0.3.1 UHP conformance: Core Python 3.10 or newer

Turn a System One decision model into an agent loop. System One Harness observes an environment, compiles its finite action space into typed questions, gates each decision by confidence, executes the chosen action, and records the complete trace.

One model call per step. No generated actions. A probability on every transition.

Jev uses System One Harness to play a live browser game by choosing one typed action per step.
Jev playing a live browser game through System One Harness — one typed decision per step, with no generated control text.

The first supported model is Jev by TypeSafe, available through OpenRouter or TypeSafe directly.

Help build the System One ecosystem. Star this repo.

[!TIP] Start here: Run the example · Understand the loop · Connect an environment · Read the design

Quickstart

git clone https://github.com/HarnessRouter/SystemOneHarness.git
cd SystemOneHarness
pip install -e .

export OPENROUTER_API_KEY=sk-or-...   # or TYPESAFE_API_KEY=...
s1 run --env order:ship_fastest_gift

This runs the built-in order fulfilment environment against the live model:

goal: Order B-220 is a gift: note it, then ship it by the fastest carrier.
model: ~typesafe/jev-latest
    0  add_note(note='gift')              p=0.96  241 ms
    1  pick_item(item='scarf')            p=1.00  269 ms
    2  pack()                             p=0.99  166 ms
    3  choose_carrier(carrier='express')  p=0.98  151 ms
    4  ship()                             p=0.93  152 ms

status=completed reason=environment_terminal steps=5 wall=0.98s cost=$0.000208

Each step shows the selected action, its weakest required probability, and the model round trip. The final line records how the run ended, how long it took, and what it cost.

What it provides

Finite actions The model chooses only from actions and parameter values declared by the environment.
Confidence gates Read, write, and destructive actions can require different probability thresholds.
Explicit outcomes Every run ends as completed, incomplete, failed, or cancelled with a structured reason.
Complete traces State, questions, distributions, verdicts, results, latency, and usage are recorded step by step.
Pluggable environments Drive Python processes, MCP servers, or web pages with the same controller.
UHP compatibility Serve the loop through the Unified Harness Protocol for streaming, continuation, cancellation, and discovery.

Real-time environments

Games, live feeds, and other moving environments can return "realtime": true. The controller then treats a refused or repeated decision as a clock tick, keeps the model's history short, and lets the last action remain active until it changes.

How it works

            ┌──────────────────────────────────────────────────────────┐
            │                        controller                        │
 goal ────► │ observe ─► compile ─► encode ─► decide ─► gate ─► execute │ ────► trace
            │    ▲                                           │         │
            │    └────────────── environment ◄───────────────┘         │
            └──────────────────────────────────────────────────────────┘
  1. Observe. The environment reports text, structured fields, candidates, and terminal state.
  2. Compile. The available actions become typed choice, noul, and score questions.
  3. Encode. Goal, observation, bounded history, and memory become a state within the model budget.
  4. Decide. The model answers the action, its parameters, and the goal check in one request.
  5. Gate. The weakest required probability must clear the selected action's risk threshold.
  6. Execute. The environment applies the action and returns the next state.

finish and escalate are actions, not generated prose. The controller always knows why it stopped.

Read the measured design and architecture →

Connect an environment

Choose the smallest boundary that fits your system.

Environment Use it when Start with
Action space + process You own a local program or service loop. s1 run --actions actions.yaml --env-cmd "python3 env.py" --goal "..."
MCP server Your tools already expose enumerable inputs over MCP. s1 run --mcp "python -m your_server" --goal "..."
Browser The task is expressed through DOM controls in Chrome. s1 run --browser --headless --start-url https://example.com --goal "..."
Python You want an in-process integration. Subclass Environment and implement observe() and execute().

Declare an action space

An action space is YAML or the same structure in Python. Every parameter must be enumerable.

instructions: >-
  Move the order to shipped, or cancel it when the goal says so.

actions:
  choose_carrier:
    description: Select a carrier for the packed order.
    risk: write
    params:
      carrier:
        from: available_carriers
  ship:
    description: Hand the packed order to the selected carrier.
    risk: destructive

gate:
  read: 0.5
  write: 0.6
  destructive: 0.8
  finish: 0.5

Parameters can use fixed choices, observation candidates, a boolean flag, or ordered levels. Free text is rejected because a System One model does not generate text.

Open the complete example →

Use an MCP server

The harness lists an MCP server's tools, compiles supported schemas into actions, and explains every unsupported tool instead of silently dropping it.

pip install -e ".[mcp]"
s1 tools --mcp "python -m systemone_harness.envs.order_mcp"
s1 run --mcp "python -m systemone_harness.envs.order_mcp --scenario ship_fastest_gift" \
  --goal "Order B-220 is a gift. Ship it by the fastest carrier."

An observe tool provides state. An optional reset tool starts a run. Every other compatible tool becomes an action. MCP annotations determine whether the action is read, write, or destructive.

Drive a browser

The browser environment uses Browser Use to turn visible DOM controls into a finite action space. Text comes from named values supplied by the caller. The model chooses values by name and never writes them.

pip install -e ".[browser]"
s1 run --browser --headless --start-url https://example.com/book \
  --text name=Customer --text [email protected] \
  --goal "Book a table at 19:30 with a window seat."

Browser setup, measurements, and limits →

Serve over UHP

Expose any configured loop as a Unified Harness Protocol server:

export OPENROUTER_API_KEY=sk-or-...
s1 serve --api-key choose-a-secret --port 8710
input                  → goal
function_call          → selected action
function_call_output   → environment result
reasoning              → distribution and gate verdict
previous_response_id   → continued environment and history

Streaming emits each item as it happens. Cancellation lets the current model step finish and records it. The included report passes all 40 checks in the UHP core conformance class.

View the conformance report →

Measured, not implied

Five live runs per scenario on 2026-09-19 with typesafe/jev-1.13-20260917 through OpenRouter:

Scenario Goal met Mean steps Mean model latency Mean wall time Cost per run
Ship by cheapest carrier 5/5 6.0 241 ms 1.45 s $0.000265
Ship fastest and add gift note 5/5 5.0 199 ms 0.99 s $0.000214
Cancel a fraudulent order 5/5 1.0 197 ms 0.20 s $0.000044

The benchmark proves the controller, compiler, gate, and model can complete these small deterministic tasks. It does not claim the same result for ambiguous state, arithmetic, dates, or long irrelevant context.

Inspect the raw benchmark rows →

Configuration, objective and the outer loop

Everything that shapes the reflex's decisions except the model and the world is one versioned YAML, the action-space file extended: version, instructions, gate, encoder, tunables (numbers an environment's rendering reads), the optional declared actions, and an objective (what the environment counts as success, failure, ordered metrics and place). Skills, directories of SKILL.md, are compiled into the instructions once per load, since a reflex cannot open a file mid-step. The trace carries the configuration's version.

s1 run --mcp ./bin/env --config config.yaml --skills ./skills --goal "..." --json trace.json
s1 run --mcp ./bin/env --config config.yaml --script "run_right,jump_right,jump_right"   # a probe
s1 bench --mcp ./bin/env --config config.yaml --runs 3 --json-dir traces/               # one at a time, then the report
s1 report --config config.yaml traces/run-*.json                                        # scoreboard and failure groups

A run that ends because the reflex could not decide (no_confident_action, or escalate chosen) carries a handoff on its record: the state it refused on, the questions, its answers with their probabilities, the weakest judgment and the threshold it failed. That is the branch for whoever takes over, a reasoning harness or a person. docs/dual-loop.md describes the outer loop that uses all of this to improve a configuration version by version.

Command line

s1 run    Run one goal against a built-in, process, MCP, or browser environment
s1 tools  Inspect how an MCP server compiles into supported actions
s1 serve  Expose a configured loop as a UHP server
s1 bench  Run the built-in live benchmark

Use s1 <command> --help for every option. Add --json trace.json to run, tools, or bench when you need machine-readable output.

Test

pip install -e . pytest
pytest -q tests

The suite covers action compilation, unsupported inputs, state truncation, confidence gates, every terminal reason, cancellation, continuation, MCP, browser actions, and the UHP server. Recorded model answers keep the default suite deterministic and keyless.

Project status

Version 0.3.1
Models Jev through OpenRouter or TypeSafe directly
UHP core, 40 of 40 checks
Environments Python, stdio, MCP, browser, and real-time loops
Python 3.10 or newer

Next milestones are a systemone base in HarnessRouter, skills as loadable actions, the Chrome side panel as a plain UHP client, and the UHP extended conformance class.

Resources

Goal Resource
Understand the model and architecture Design of record
Configure the browser environment Browser guide
Try the protocol client Chrome extension
Review benchmark evidence Benchmark report
Review protocol evidence UHP conformance report

License

System One Harness is licensed under Apache 2.0.

SystemOneHarness (HarnessRouter/SystemOneHarness)

Searching Database…

这是什么?一个开源的 Python 框架,把 System One 决策模型变成一个智能体循环:它观察环境,把有限的动作空间编译成带类型的问题,用置信度把关每个决策,执行动作并记录完整的运行轨迹。
它和普通那种自己写动作的 LLM 智能体有什么不同?模型从不生成自由文本:它通过回答一组带类型的问题来在环境声明的动作空间中选择,每一步只需一次调用,且每次状态转移都带有概率。自由文本会被直接拒绝。
我该怎么把它跑起来?使用 s1 命令行工具:Quickstart 会在真实模型上运行内置的订单履约环境,s1 --help 列出所有选项,--json trace.json 则输出机器可读的结果。
它驱动的是哪个模型,我需要准备什么?它目前驱动的是 TypeSafe 的 Jev,可以通过 OpenRouter 或直接从 TypeSafe 获取,所以你需要有其中之一的访问权限。框架本身需要 Python 3.10 或更高版本;它的测试套件无需密钥即可基于录制的答案运行。
在真实任务上我能放心依赖它到什么程度?实测的基准只证明了小型的确定性任务——它明确不声称在模糊状态、算术、日期或冗长的无关上下文上也能达到同样效果。
当它拿不准的时候,是什么防止它做出破坏性操作?靠置信度门槛:读取、写入和破坏性动作可以要求不同的概率阈值,而且所需的最低概率必须达到所选动作的阈值。如果这个反射机制无法做出决定,运行会以 noconfidentaction 或 escalate 结束,轨迹中会带有交接记录,交由人工或推理框架处理。
它真的管用吗?基准测试的结果如何?每个场景通过 OpenRouter(typesafe/jev-1.13,2026-09-19)做了五次真实运行,三个订单履约场景全部 5/5 达成目标——步数在 1 到 6 步之间,模型平均延迟约 200 毫秒,每次运行成本大约 $0.00004–$0.00027。
浏览器模式是怎么工作的?浏览器环境使用 Browser Use 把 Chrome 中可见的 DOM 控件转成一个有限的动作空间。文本来自你提供的命名值——模型只按名称挑选值,从不自己写内容——而且 --headless 可以在无窗口模式下运行。
我怎么告诉它要做什么,以及怎样算成功?用一个带版本号的 YAML 文件,也就是扩展后的动作空间文件:包含指令、门槛、编码器、可调参数、可选的显式声明的动作,以及一个定义成功、失败和有序指标的目标。技能(SKILL.md 目录)会在每次加载时编译进指令中。
Size
10.1 MB
Stars
197
Age
1mo
Commits · 90 Days