ClearRun
# ClearRun
## Get an API key
A signed-in free account with a verified email can create one developer key at [https://api.clearrun.net/account/keys](https://api.clearrun.net/account/keys). The full key is shown once and starts with `crun_`. It calls evaluate, score, and chat, and it returns the free verdict: score, grade, risk, and a summary of 16 words or fewer. `componentSignals` is limited to Evidence support and Reasoning integrity. `confidenceInterval` and `scoringVersion` are omitted. Calls spend the free plan's 30 monthly credits. The default cap is 2 requests a second, 6 a minute, 30 an hour, and 40 a day. Evaluate, score, and chat share that cap. Over the cap, the API returns 429 and `Retry-After`. Signed-in chat and Paste Check on api.clearrun.net do not use the key. Chain verification and audit export need a Pro plan or higher. An unverified account cannot create a key. A free account can hold one active developer key. Revoke it before creating another. A key that is not a free developer key is refused on a free account with 403 and code `API_ACCESS_REQUIRED`. On Pro, Business, and Enterprise, API access is a saved setting. Turning it off returns 403 and code `API_ACCESS_DISABLED`. That switch does not turn a free developer key on or off.
ClearRun does not use your content to train third-party or generation models. Whether your evaluations may help improve ClearRun's own scoring is an account setting: free plans start opted in, paid plans start opted out, and Enterprise stays off.
1. Open [https://api.clearrun.net/account/keys](https://api.clearrun.net/account/keys). Sign in on that page if you need an account. That page is where you create a key.
2. Save the key on your machine:
```bash
npx @clearrun/cli login
```
Or set the `CLEARRUN_API_KEY` environment variable. Do not commit a real key.
`CLEARRUN_API_KEY` is checked first. When it is unset, the SDK, CLI, and MCP server read `~/.config/clearrun/config.json`, which is the file `clearrun login` writes. `XDG_CONFIG_HOME/clearrun/config.json` is used when `XDG_CONFIG_HOME` is set.
ClearRun scores the honesty of an AI answer: whether the confidence it expresses is backed by its reasoning. **It is not a fact-checker.** A high score means the confidence matches the justification. It does not mean the answer is true.
You get a 0 to 100 score, a grade, component signals, a short summary, and a signed verdict you can look up again. The open packages in this repo are the client. The scoring engine runs as a hosted service at `https://api.clearrun.net`. It is not in this repository, and these docs do not describe its formula.
Calibrated for English. Scores on other languages are outside the current validated scope.
## Why use it
Use ClearRun when an answer will be shown to a customer, checked into a review, or used for a decision. It flags answers that sound surer than their reasoning supports, and it leaves a record someone else can verify. It does not block or rewrite the answer.
Three ways to call it:
| Package | Version | Use it when |
| --- | --- | --- |
| [`@clearrun/sdk`](packages/sdk/README.md) | 1.2.0 | Your own app or service should call the API. |
| [`@clearrun/cli`](packages/cli/README.md) | 1.2.0 | You want a terminal command or a CI check. |
| [`@clearrun/mcp`](packages/mcp/README.md) | 1.2.1 | Claude Desktop, Claude Code, Cursor, or VS Code should call the tools. |
`@clearrun/core-types` is 1.2.0. The SDK depends on it. `@clearrun/scoring`, `@clearrun/security`, and `@clearrun/vendors` stay at 0.1.0. One page for all three clients: [docs/developers.md](docs/developers.md).
npm serves 1.2.0 of `@clearrun/sdk`, `@clearrun/cli`, `@clearrun/mcp`, and `@clearrun/core-types`. Breaking change from 0.2.0: `clearrun verify --text` no longer scores. Use `clearrun score`. `clearrun verify <verdictId>` is a lookup and does not need an API key. On npm 0.2.0, `clearrun verify <file>` scores text, the CLI exports a scoring `verify()`, the SDK does not export `createVerifyClient()`, and MCP verify still requires a key. The commands below match this repository. `@clearrun/sdk` and `@clearrun/cli` here are 1.2.0. `@clearrun/mcp` here is 1.2.1.
## Access
The steps are in **Get an API key** above. `createKernelClient()` does not throw when no key is configured. The first `score`, `evaluate`, or `chat` throws `MissingApiKeyError`. The error names the keys page, `npx @clearrun/cli login`, and `CLEARRUN_API_KEY`.
For local development only, pass `{ forceMock: true }` to the SDK. The mock returns schema-valid verdicts and is not a hosted score. The CLI and the MCP server do not offer that mock.
## Install
```bash
npm install @clearrun/sdk
npm install -g @clearrun/cli
npx -y @clearrun/mcp
```
To work from a clone:
```bash
git clone https://github.com/Adepoco/ClearRun.git
cd ClearRun
npm install
```
Node.js 18 or newer. Tag `v0.1.0-oss` is an earlier snapshot. `npm install` from the registry resolves `@clearrun/sdk`, `@clearrun/cli`, `@clearrun/mcp`, and `@clearrun/core-types` to 1.2.0. This clone's `@clearrun/mcp` is 1.2.1. The quickstart below matches this repository. A secret API key belongs on a server or a backend proxy. The hosted API sends no CORS headers.
## Quickstart
SDK:
```ts
import { createKernelClient } from '@clearrun/sdk';
const client = createKernelClient({
hosted: { apiKey: process.env.CLEARRUN_API_KEY },
});
const { verdict } = await client.evaluate({
prompt: 'Where is the Eiffel Tower?',
responseText: 'The Eiffel Tower is in Berlin.',
});
console.log(verdict.score, verdict.grade, verdict.componentSignals);
```
CLI:
```bash
npx @clearrun/cli login
clearrun score --text "The Eiffel Tower is in Berlin."
```
`export CLEARRUN_API_KEY=YOUR_CLEARRUN_API_KEY` works too, and it overrides the saved key.
No API key for local development? Pass `{ forceMock: true }` to the SDK. The mock returns schema-valid verdicts, never real scores. The MCP server never uses the mock.
MCP hosts use the copy-paste blocks in [packages/mcp/README.md](packages/mcp/README.md). Each one runs `npx -y @clearrun/mcp` with `CLEARRUN_API_KEY` in `env`. Cursor's project file is `.cursor/mcp.json`.
## Tools and commands
SDK methods and MCP tools:
| Call | What it does |
| --- | --- |
| `score` / `clearrun_score` | Score text that was already written (`POST /api/score`). |
| `evaluate` / `clearrun_evaluate` | Score an existing answer, with the prompt when you have it (`POST /api/evaluate`). |
| `chat` / `clearrun_chat` | Ask the hosted API to generate an answer and score it (`POST /api/chat`). |
| `verify` / `clearrun_verify` | Look up a verdict id (`GET /api/verify/{id}`). |
The MCP process speaks stdio. It starts and lists these tools with no API key. `clearrun_score`, `clearrun_evaluate`, and `clearrun_chat` return an error on call until `CLEARRUN_API_KEY` is set. `clearrun_verify` does not read the key. Each tool input schema describes its arguments: `responseText` or `message` is required for a new call, and `verdictId` is required for a lookup.
CLI (`score` scores text, `verify` looks up a verdict id):
```bash
clearrun score answer.txt
clearrun score --text "The capital of France is Paris." --json
clearrun score --config ci/clearrun.config.json --threshold 75
clearrun verify VERDICT_ID
```
Short examples for each client are in the package READMEs and in [docs/developers.md](docs/developers.md).
## Credits
Credits are metered per call. On the public pricing page, evaluate and score cost at least 3 credits. Chat costs at most 4 credits per turn. `clearrun verify` and `GET /api/verify/{id}` spend no credits. Current costs and plans: [https://api.clearrun.net/pricing](https://api.clearrun.net/pricing).
## Verify a verdict
A hosted verdict id can be checked again with no account:
```bash
curl https://api.clearrun.net/api/verify/VERDICT_ID
```
The lookup confirms the stored verdict. It does not fact-check the original answer.
## What you get back
A `Verdict` (see `schema/verdict.schema.json` and [docs/CONTRACT.md](docs/CONTRACT.md)): `score` (0 to 100, or null when the API cannot score), `grade`, `risk`, `componentSignals`, `summary`, and an Ed25519 `signature` you can verify locally or with `GET https://api.clearrun.net/api/verify/{verdictId}`. Paid plans receive four signals: Evidence support, Reasoning integrity, Confidence calibration, and Ambiguity handling. Free use, developer API access, and public lookups receive Evidence support and Reasoning integrity.
Grades are `Well supported`, `Generally reliable`, `Verify before use`, `High risk`, `Likely misleading`, and `Not configured`. They are not labels of factual truth.
## Open core
MIT in this repo: the SDK, model adapters (OpenAI, Anthropic, Google), CLI, MCP server, verdict types, and schema. Clone it, embed it, build on it.
The scoring kernel is hosted and closed. It provides honesty scoring and signed attestation. The SDK calls it. The scoring logic is not in this repo by design. The hosted kernel is licensed separately (BSL-1.1). See `LICENSE`.
## Links
- npm SDK: [https://www.npmjs.com/package/@clearrun/sdk](https://www.npmjs.com/package/@clearrun/sdk)
- npm CLI: [https://www.npmjs.com/package/@clearrun/cli](https://www.npmjs.com/package/@clearrun/cli)
- npm MCP: [https://www.npmjs.com/package/@clearrun/mcp](https://www.npmjs.com/package/@clearrun/mcp)
- npm types: [https://www.npmjs.com/package/@clearrun/core-types](https://www.npmjs.com/package/@clearrun/core-types)
- GitHub: [https://github.com/Adepoco/ClearRun](https://github.com/Adepoco/ClearRun)
- Site: [https://clearrun.net](https://clearrun.net)
- Pricing: [https://api.clearrun.net/pricing](https://api.clearrun.net/pricing)
- API keys: [https://api.clearrun.net/account/keys](https://api.clearrun.net/account/keys)
- Developer guide: [docs/developers.md](docs/developers.md)
- Directory checklist: [docs/LISTINGS.md](docs/LISTINGS.md)
ClearRun is made by Adepoco, a California corporation. Contact: [contact@adepoco.com](mailto:contact@adepoco.com).
TDQS
Scored across 4 tools
Each tool targets a distinct input shape: verify takes an id, score takes text only, evaluate takes text plus prompt, and chat generates an answer. The descriptions explicitly cross-reference one another with 'use X when... use Y when...' guidance, leaving almost no room for misselection.
All names follow a strict clearrun_<verb> snake_case pattern: verify, score, evaluate, chat. The verbs are meaningful and consistent in style, with no casing or prefix deviations.
Four tools map cleanly onto the service's apparent endpoints (score, evaluate, chat, verify) with no redundant entries. The set is compact and each tool earns its place for this narrow scoring domain.
The core scoring lifecycle is covered: generate, score with or without prompt, and retrieve a stored verdict. However, there is no way to list past verdicts or check credit/account status, so an agent that loses a verdict id has no recovery path.