Shards-Kernel is a deterministic control plane for AI systems. It provides a state machine that governs AI agent execution through explicit jurisdiction, append-only audit, and fail-closed semantics.
AI systems without deterministic control planes exhibit failure modes including ambiguity propagation, non-deterministic state, unbounded execution, audit gaps, and authority diffusion. Shards-Kernel addresses these by enforcing explicit boundaries and producing immutable audit records.
No. Shards-Kernel is a control plane, not an AI framework. It does not implement AI capabilities. It governs systems that may include AI components.
No. Shards-Kernel does not call language models. It validates and arbitrates requests from systems that may use language models.
Explicit state machines provide deterministic behavior, enable audit, and prevent implicit state changes that could lead to undefined behavior.
Hash chaining provides tamper detection. If any entry is modified, the chain breaks and verification fails.
Different use cases require different enforcement postures. Variants allow operators to choose the appropriate level of strictness for their context.
Yes. Implement the Kernel protocol and extend BaseKernel. Custom variants must satisfy all core invariants.
Register the tool with the ToolRegistry:
from shards_kernel.execution.tools import ToolRegistry
registry = ToolRegistry()
registry.register(
name="my_tool",
handler=my_function,
description="Description of my tool",
param_schema={"param1": str, "param2": int},
)
Create a JurisdictionPolicy and set it on the kernel:
from shards_kernel.jurisdiction.policy import JurisdictionPolicy
policy = JurisdictionPolicy(
allowed_actors=frozenset({"alice", "bob"}),
allowed_tools=frozenset({"echo", "add"}),
)
kernel.set_policy(policy)
Use the replay verification functions:
from shards_kernel.audit.replay import replay_and_verify
entries = ledger.to_list()
is_valid, errors = replay_and_verify(entries)
In fail-closed mode (default), ambiguous requests are denied. The kernel returns a receipt with Decision.DENY and an error message describing the ambiguity.
No. HALTED is a terminal state. To continue operations, create a new kernel instance.
The ten core invariants are:
Invariant violations indicate bugs in the kernel implementation. They should be reported as security issues.
Invariant changes require a major version bump, documented consensus, and a migration guide. They are exceptional events.
No. Shards-Kernel uses only the Python 3.11+ standard library.
The current implementation is synchronous. Async support may be added in future versions.
kernel.submit()Yes. Each kernel instance is independent. They do not share state.
Check the receipt’s error field for details. Common causes:
Hash chain failures indicate tampering or corruption. Verify that:
Tool execution requires:
tool_call field present in requestCheck the receipt for specific errors.