Version: 0.1.0
Status: Draft
This specification defines the normative requirements for Kernels, a deterministic control plane for AI systems.
This specification covers:
- Core types and their semantics
- State machine definition and transitions
- Jurisdiction policy evaluation
- Audit ledger structure and verification
- Kernel API surface
- Invariant definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
A conforming implementation MUST satisfy all of the following invariants:
The kernel MUST be in exactly one defined state at any time. The defined states are: BOOTING, IDLE, VALIDATING, ARBITRATING, EXECUTING, AUDITING, HALTED.
State transitions MUST occur only through defined transition functions. Implementations MUST NOT allow implicit state changes.
Every request MUST pass jurisdiction checks before execution. Requests that fail jurisdiction MUST be denied.
Every state transition MUST produce an append-only audit entry before the transition completes.
Audit entries MUST be hash-chained. Each entry MUST include the hash of the previous entry.
Ambiguous, malformed, or unhandled requests MUST result in DENY or HALT. The kernel MUST NOT proceed under uncertainty.
Given identical inputs and initial state, the kernel MUST produce identical outputs and final state.
The kernel MUST support immediate halt from any non-terminal state. Halt MUST be irrevocable within a session.
All decisions MUST be exportable as an evidence bundle with verifiable hash chain.
The absence of a DENY is not an ALLOW. Explicit ALLOW decisions MUST be required for execution.
An enumeration of valid kernel states.
| Value | Description |
|---|---|
| BOOTING | Kernel initializing |
| IDLE | Ready to accept requests |
| VALIDATING | Checking request structure |
| ARBITRATING | Evaluating jurisdiction |
| EXECUTING | Dispatching tool call |
| AUDITING | Writing audit entry |
| HALTED | Terminal state |
An enumeration of possible decisions.
| Value | Description |
|---|---|
| ALLOW | Request is permitted; execution may proceed |
| DENY | Request is rejected; no execution occurs |
| HALT | Kernel enters terminal state |
An enumeration of receipt statuses.
| Value | Description |
|---|---|
| ACCEPTED | Request was processed successfully |
| REJECTED | Request was denied by policy or validation |
| FAILED | Request processing encountered an error |
A request submitted to the kernel.
| Field | Type | Required | Description |
|---|---|---|---|
| request_id | string | Yes | Unique request identifier |
| ts_ms | integer | Yes | Timestamp in milliseconds |
| actor | string | Yes | Actor submitting request |
| intent | string | Yes | Intent description |
| tool_call | ToolCall | No | Tool to invoke |
| params | dict | No | Additional parameters |
| evidence | string | No | Supporting evidence |
A receipt returned after processing.
| Field | Type | Required | Description |
|---|---|---|---|
| request_id | string | Yes | Request identifier |
| status | ReceiptStatus | Yes | Processing status |
| state_from | KernelState | Yes | State before processing |
| state_to | KernelState | Yes | State after processing |
| ts_ms | integer | Yes | Timestamp in milliseconds |
| decision | Decision | Yes | Decision made |
| error | string | No | Error message if any |
| evidence_hash | string | No | Hash of audit entry |
| tool_result | any | No | Tool execution result |
A specification of a tool invocation.
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Tool name |
| params | dict | No | Tool parameters |
A single entry in the audit ledger.
| Field | Type | Required | Description |
|---|---|---|---|
| prev_hash | string | Yes | Hash of previous entry |
| entry_hash | string | Yes | Hash of this entry |
| ts_ms | integer | Yes | Timestamp in milliseconds |
| request_id | string | Yes | Request identifier |
| actor | string | Yes | Actor who submitted |
| intent | string | Yes | Intent of request |
| decision | Decision | Yes | Decision made |
| state_from | KernelState | Yes | State before transition |
| state_to | KernelState | Yes | State after transition |
| tool_name | string | No | Tool invoked |
| params_hash | string | No | Hash of parameters |
| evidence_hash | string | No | Hash of evidence |
| error | string | No | Error message |
An exportable evidence bundle.
| Field | Type | Required | Description |
|---|---|---|---|
| ledger_entries | list[AuditEntry] | Yes | All audit entries |
| root_hash | string | Yes | Hash of last entry |
| exported_at_ms | integer | Yes | Export timestamp |
| kernel_id | string | Yes | Kernel identifier |
| variant | string | Yes | Kernel variant |
A conforming kernel implementation MUST provide the following methods:
boot(config: KernelConfig) -> None
Initialize the kernel with configuration. MUST transition from BOOTING to IDLE. MUST raise BootError if boot fails.
get_state() -> KernelState
Return the current kernel state. MUST NOT modify state.
submit(request: KernelRequest) -> KernelReceipt
Submit a request for processing. MUST validate request, evaluate jurisdiction, execute if allowed, and produce audit entry. MUST return receipt with decision.
step() -> KernelReceipt | None
Advance the kernel by one step. MUST return receipt if step was taken, None if idle.
halt(reason: str) -> KernelReceipt
Halt the kernel. MUST transition to HALTED from any non-terminal state. MUST produce audit entry.
export_evidence() -> EvidenceBundle
Export the audit ledger as evidence. MUST include all entries and root hash.
A conforming implementation MUST process requests in the following sequence:
- Receive request via
submit() - Transition to VALIDATING
- Validate request structure
- Check ambiguity heuristics
- Transition to ARBITRATING
- Evaluate jurisdiction policy
- Check variant requirements
- Make decision
- If ALLOW and tool_call present, transition to EXECUTING
- Execute tool call
- Transition to AUDITING
- Create audit entry
- Transition to IDLE
- Return receipt
On any failure during processing:
- MUST NOT proceed with execution
- MUST produce audit entry with error
- MUST return receipt with appropriate status
- MUST return to IDLE or HALTED state
To verify an audit ledger:
- Initialize prev_hash to genesis hash (64 zeros)
- For each entry in sequence: a. Verify entry.prev_hash equals prev_hash b. Recompute entry hash from fields c. Verify computed hash equals entry.entry_hash d. Set prev_hash to entry.entry_hash
- Verify final prev_hash equals root_hash
To verify an evidence bundle:
- Perform replay verification on ledger_entries
- Verify computed root hash equals bundle.root_hash