Kenshiki Labs

Reasoning API

Kadai

The Kadai Inference Engine is our reasoning model, a domain-specific foundation model at the heart of our AI control plane.

Kadai is the Propose+Prove API — the bounded synthesis runtime that takes a governed question, runs it through the full execution pipeline, and emits a signed governed response. The Compiler rewrites the request into a CFPO-ordered (Content-Format-Policy-Output) prompt contract through a five-pass deterministic rewrite, matching known model attention behavior instead of appending retrieval chunks as an undifferentiated block. Authority weighting per evidence chunk uses Kura provenance metadata to decide which CFPO zone each piece of evidence belongs in. The model reasons inside the boundary, not around it — generation receives bounded context, not raw corpus access. The Ledger decomposes each response into atomic claims and evaluates them across multiple layers: L1 confidence signals from token logprobs, L2 source entailment via embedding similarity and NLI, L3 stability via multi-draw regeneration and semantic clustering, and L4 hidden-state probes for internal volatility (Refinery and Clean Room only). The differentiator is contrastive causal attribution — measuring whether evidence actually caused a claim, not just whether it appeared nearby. The Gate reads the Ledger evaluation record and assigns one of five output states deterministically: AUTHORIZED, PARTIAL, REQUIRES_SPEC, NARRATIVE_ONLY, or BLOCKED. ARBV (Adversarial Resilience and Boundary Verification) runs formal authorization invariants, adversarial tests for semantic and retrieval pressure, and emits signed Boundary Evidence Records that auditors and partners can independently replay without trusting the operator. Without Kadai, a user prompts a model directly and the model answers from training data, tool calls, context window, and improvisation — with no evidence boundary, no claim checking, no auditable provenance.

Without bounded synthesis: a user prompts a model directly. The model answers from training data, tool calls, its context window, and improvisation. There is no evidence boundary, no claim checking, no inspectable our auditable provenance. The burden of trust falls on the reader.

How Kadai turns bounded evidence into a governed response

Read this left to right from the Kura handoff. Bounded evidence enters, the runtime compiles a controlled prompt contract, the model drafts a proposal, the system verifies the claims, and only then is a governed response returned. Kadai orchestrates this runtime. It does not define evidence on its own, and it does not replace Ledger or Gate.

Kadai Governed Response Lifecycle
Kadai does not invent authority. It compiles a governed request, synthesizes only from bounded evidence, verifies the claims it emits, assigns an output state, and returns an auditable response.
Step 1 of 6Receive
Step 2 of 6Compile
Step 3 of 6Generate
Step 4 of 6Verify
Step 5 of 6Decide
Step 6 of 6Return

What Kadai does

Kadai is the single entry point for governed synthesis. An authenticated request envelope enters with bounded evidence. Compiler rewrites it. Kura retrieval supplies in-scope evidence. Generation produces a proposal. Ledger evaluates it. Gate assigns a state. Kadai returns the governed response.

  • One API call for the full bounded-synthesis pipeline
  • Same contract across Workshop, Refinery, and Clean Room
  • Returns governed response text + output state + claim-level audit trail

What Kadai does not do

Kadai does not generate authority. The generation layer drafts language. Kura defines evidence. Ledger records support. Gate decides what may be emitted. Kadai orchestrates and returns the governed response.

  • Does not replace the generation layer — orchestrates it
  • Does not define evidence — Kura does
  • Does not make gate decisions — the Ledger and Gate do

What the caller receives

Not raw model text. A structured response with an explicit output state, claim-level backing, and a record of what evidence was in scope.

  • Output state (AUTHORIZED, PARTIAL, REQUIRES_SPEC, NARRATIVE_ONLY, BLOCKED)
  • Per-claim attribution to governed evidence
  • Telemetry headers for audit and observability

How to use Kadai

One endpoint, same contract, every tier. POST /v2/chat with your API key. The response includes verified status, evidence references, confidence, attestation, and output state. Your calling code does not change between Workshop, Refinery, and Clean Room — only the base URL and API key change.

  • Workshop: sign up at portal.kenshikilabs.com, generate an API key, call POST /v2/chat. Under five minutes to first governed response.
  • Refinery: same POST /v2/chat, but the base URL points at your private deployment. API key issued during onboarding.
  • Clean Room: same POST /v2/chat, but the base URL points at the local instance inside the air gap.
  • Response shape is identical across tiers: id, content, verified, confidence, evidence[], attestation, access_decision
  • Streaming: set stream: true — events are token, done, error. Only the done event is authoritative.
  • Verification: check verified: true before trusting output. Use GET /v2/signing/keys for offline Ed25519 verification.
  • Full API reference: /articles/governed-intelligence-api

Compiler

Before the model sees the request, the Compiler rewrites it into a versioned, governance-enforceable prompt contract. Kura-bounded evidence enters and gets sorted into CFPO structure (Content–Format–Policy–Output). The model receives ordered context that turns evidence into a controlled generation surface.

  • Five-pass deterministic rewrite — runs automatically on every request
  • CFPO ordering matches model attention behavior, not append order
  • Authority weighting per evidence chunk based on Kura provenance
  • Versioned — same input always produces the same contract

Ledger

Every model proposal is decomposed into atomic claims, and each claim is checked against the evidence that was in scope. The Ledger records what was supported, what wasn't, and why — not as a confidence score but as a per-claim audit trail. One backed claim cannot hide three fabricated ones.

  • L1 confidence signals from token logprobs (all tiers)
  • L2 source entailment via embedding similarity and NLI (all tiers)
  • L3 stability via multi-draw regeneration (all tiers)
  • L4 hidden-state probes for internal volatility (Refinery and Clean Room)
  • Every claim links to the evidence it was checked against

Gate

The Gate reads the Ledger evaluation record and makes a single deterministic decision about the entire response. Five possible output states. The model's confidence does not decide; what the evidence supports does.

  • AUTHORIZED — claims sufficiently supported
  • PARTIAL — evidence exists but coverage is incomplete
  • REQUIRES_SPEC — question needs tighter scope
  • NARRATIVE_ONLY — descriptive but not decision-grade
  • BLOCKED — policy or evidence conditions not met

ARBV

Adversarial Resilience and Boundary Verification turns governance from written policy into an evidence-generating system. Formal checks validate the boundary, semantic adversaries attack it, and signed Boundary Evidence Records preserve what happened — replayable by auditors and partners without trusting the operator.

  • Formal authorization invariants for allowed and forbidden states
  • Adversarial tests for semantic, retrieval, model, and policy pressure
  • Release-blocking severity classes for dangerous authorization flips
  • Signed records — any selected result can be independently replayed

Who this is for

Application developers

integrate Kadai as the answer API. One API call replaces direct model access and returns governed, classified responses.

The end user

receives a response already evaluated and assigned an explicit state — not raw model text that still has to be defended by hand.

Kadai — the governed inference engine — is the reasoning API. It orchestrates Compiler — the prompt compiler —, bounded retrieval, generation, Ledger — the integrity-protected inference audit trail —, and Gate — the emission policy boundary — before anything reaches the caller. Every claim is checked against governed evidence before it is emitted. Kadai synthesizes — it does not act as authority.