Skip to main content
Version: MVP

Runner adapter contract

7 min readReferenceUpdated 2026-05-19

What you'll find here

The runner-agnostic contract between Craik core and concrete agent environments. Adapters receive Craik state and return normalized Craik state without leaking provider-specific details into core contracts.

Adapters translate, they don't grant authority.

Side effects still require explicit capability grants. Adapter metadata describes what a runner can do; policy decides what it may do.

Contracts

Contract
Role
Fields
craik.runner_metadata
identity
Runner id & display name · adapter id & version · execution mode (fixture / prompt-handoff / live) · capability names · structured adapter metadata.
craik.runner_adapter_request
input
Task id · runner metadata · task request id · case file id · policy envelope id · capability grant ids · expected output schemas · bounded context prepared by Craik.
craik.runner_adapter_result
output
Status (completed / blocked / failed / partial) · summary · structured outputs · receipt ids · optional handoff id · memory proposal ids · artifacts · diagnostics · runner metadata.
craik.runner_step_request
step input
Run id · task id · phase (plan / act / observe / evaluate / continue / stop) · runner metadata · policy envelope id · optional intent lock id · capability grant ids · expected output schemas · input prompt · bounded context · redaction requirement.
craik.runner_step_result
step output
Request id · run id · task id · phase · runner metadata · status · summary · observed output · diagnostics · receipt ids · memory proposal ids · artifacts · redaction state.
craik.runner_capability_matrix
capability profile
Runner metadata · trust level & boundary · default grant posture · whether receipts and redaction are required · normalized capability entries · policy notes.

Capability support levels

Support
Behavior
When to use
unsupported
block
The runner should not be asked to perform the action.
prompt-handoff
review
The runner can reason about or propose the action, but Craik routes side effects through review.
supported
grant-gated
The runner can perform the action when policy grants allow it.

Side-effect capabilities default to grant_required: true. Read-only context and structured-result capabilities may be marked grant-free when the runner profile can consume them without widening authority.

Adapter interface

Python adapters implement the RunnerAdapter protocol.

from craik.runtime.runners import RunnerAdapter


def run_task(adapter: RunnerAdapter, request):
return adapter.run(request)

Validate · preserve · normalize.

Adapters validate the request they receive, preserve runner metadata, and return a craik.runner_adapter_result payload. Fixture adapters can use FixtureRunnerAdapter for deterministic contract tests without live runner credentials.

Shipped preview adapters

Codex

Codex-compatible prompt handoff and deterministic fixture runs.

Claude

Claude-compatible prompt handoff and deterministic fixture runs.

Gemini

Gemini-compatible read/review-oriented prompt handoff and deterministic fixture runs.

Capability matrix

craik runners matrix
craik runners matrix --runner codex

The v0.1.0 runner profiles are conservative.

Runner
Trust
Posture
codex
medium
Live local runner. Side effects require explicit grants and receipts.
claude
medium
Prompt-handoff runner. Side effects return through Craik review and receipt workflows.
gemini
low
Prompt-handoff runner. Low trust until adapter tests justify broader authority.
fixture
deterministic
Test runner with no external side effects.

Future prompt compilation and policy decisions consume craik.runner_capability_matrix rather than inferring authority from a runner name or free-form metadata. The prompt compiler uses these matrices to include runner-specific capability notes and policy boundaries in deterministic prompts.

Boundaries

Craik core owns

  • Task requests
  • Case files
  • Policy envelopes
  • Capability grants
  • Receipts
  • Handoffs
  • Memory proposals
  • Contract validation

Adapters own

  • Runner invocation or prompt handoff
  • Runner-specific session details
  • Runner-specific diagnostics
  • Mapping runner output back into Craik contracts

Runner-specific details stay inside the metadata, outputs, or diagnostics fields unless they become stable cross-runner contract fields. Adapter-produced receipts and handoff inputs include the stable runner metadata snapshot.

Provider-backed MVP runner

The MVP provider-backed runner is implemented in craik.runtime.provider_runner. It uses the normal case-file and prompt compiler flow, then runs deterministic provider-normalized steps through the governed loop.

Provider-backed runs must persist:

Compiled prompt

Task run

Normalized run outputs

Per executed step.

Provider receipts

Per model step.

Side-effect / denial receipts

Emitted by the loop.

Handoff

For completion · block · failure · interruption.

OpenAI and Anthropic parity is covered by deterministic tests for provider_openai and provider_anthropic. The MVP runner path does not perform live API calls by default.

Additional live runner adapters are post-MVP.

Preview adapters may remain useful for prompt handoff, local fixtures, and contract validation, but they should not be documented as operational live execution paths until they meet the same certification, budget, retry, redaction, receipt, and side-effect requirements as the MVP OpenAI and Anthropic provider paths. See Post-MVP Scope.

What's next