How to use ClearRun mock mode for local development (forceMock)
Create the client with createKernelClient({ forceMock: true }). It returns local test verdicts on your computer with no key and no network. Mock verdicts are not real evaluations and are never signed.
Last updated
Steps
Turn on mock mode
import { createKernelClient } from '@clearrun/sdk'; const client = createKernelClient({ forceMock: true });Use it like the real client
const { verdict } = await client.score({ responseText: 'Our API never stores customer data.' }); console.log(verdict.verdictId, verdict.score, verdict.signature);Switch to hosted for real scores
Remove
forceMockand setCLEARRUN_API_KEY.
How to tell a mock verdict
verdictIdstarts withmock_.scoringVersionismock-1.0.0.signature,signatureKeyIdandsignatureAlgarenull.- The summary says "Mock verdict for local/standalone use; not a real evaluation."
Good for
Building before you have a key, and unit tests. Hosted scores work differently: a later run of the same text can score differently.
Only the SDK has it
The CLI and MCP server always call ClearRun.