v0.2.5Local-first · No account required

Give AI work.
Keep the keys.

Kerna is the runtime trust layer for AI agents. It governs MCP tools, bounds execution, and keeps a receipt for every run.

$npm install -g @premxai/kerna
Get started
Written in Rust Fail-closed by default MIT or Apache-2.0
Prepare my morning briefrun · example
Completed
Tool calls5
GoalPrepare my morning brief

    Select a tool call to inspect its decision. Illustrative data.

    Sits in front of the tools you already use

    How it works

    A model proposes. Kerna decides.

    Kerna sits between a model and the MCP tools that can touch files, services, and external systems. Nothing runs until it passes the boundary.

    01

    Goal

    Ask for a bounded outcome. Relevant local memory is retrieved.

    02

    Scheduler

    Runs the task loop across model calls and tool discovery.

    03

    Policy + budgets

    Explicit grants, approvals, and hard limits. Ungranted means denied.

    04

    Isolated MCP tool

    Plugins run as untrusted child processes over stdio.

    05

    Local receipt

    A structured record lands in SQLite for inspect and replay.

    Capabilities

    Control, by construction.

    A narrow core that owns safety and orchestration, and nothing else. Your models and capabilities stay replaceable.

    Fail-closed permissions

    Tools receive no capability unless it is explicitly granted. Rules are evaluated top to bottom and the first match wins.

    kerna.policy.toml
    version = 1
    default = "ask"
    
    [[rules]]
    id     = "deny-external-actions"
    effect = "deny"
    kind   = "external"
    
    [[rules]]
    id     = "allow-worktree-reads"
    effect = "allow"
    kind   = "file_read"

    Human approvals

    Consequential actions pause for a clear local decision.

    notes.write_noteWaiting

    Create “Standup notes” in your workspace.

    Awaiting your decision…

    Hard budgets

    Limits on calls, runtime, cost, output, and memory writes stop runaway work.

    Tool calls7 / 20
    LLM calls3 / 10
    Runtime42s / 120s
    Costlimit reached · aborted

    MCP isolation

    Plugins are untrusted child processes with sandboxed working directories and watchdog cleanup.

    Kernapolicy · budgets
    receipts
    Pluginstdio child
    sandboxed cwd

    Provider choice

    Swap models without changing the trust boundary.

    BYOK providers OpenAI-compatible Local models Mock · no key

    Local-first

    Runtime, workspace, policies, and receipts live on your machine.

    0accounts required

    Receipts and traces

    Every run becomes a structured, redacted record: decisions, action digests, budgets, and failures. Inspect and replay instead of trusting an opaque “done.”

    terminal · sample output
    $ kerna trace last
    tool.call.requested  notes.write_note
    tool.policy.checked  ask → approval needed
    approval.decided     approved (local)
    budget.checked       tool calls 4/20
    tool.call.started
    tool.call.completed
    Gateway mode

    Govern the clients you already use.

    Put Kerna in front of any client that speaks MCP. Tools routed through it are checked and recorded locally, and fail closed when a rule denies or requires confirmation.

    • Reviewable contract. Generate a deterministic workspace contract first.
    • Never edits your client. Config is printed for you to review and paste.
    • Live dashboard. Watch governed calls stream in on 127.0.0.1.

    Kerna governs tools routed through its MCP server. It does not govern a client’s native editor, terminal, or built-in tools.

    PowerShell
    # 1. Generate a reviewable contract
    kerna contract init --template deployment-assistant `
      --name "Deployment assistant" --output .\kerna-demo
    
    # 2. Print client config (changes nothing)
    kerna client config --client qoder --workspace .\kerna-demo
    
    # 3. Verify a real MCP handshake
    kerna client doctor --client qoder --workspace .\kerna-demo
    
    # 4. Watch governed calls live
    kerna dashboard --workspace .\kerna-demo
    Architecture

    A narrow core. Nothing extra.

    Kerna is not an agent framework and owns no domain logic. Calendar, notes, search, and the rest live in external MCP plugins.

    Scheduler

    Task loop, memory injection, model calls, tool lifecycle.

    scheduler.rs

    Policy engine

    Denies ungranted capabilities. Asks when it matters.

    permissions.rs

    Budget engine

    Aborts any run that exceeds its declared limits.

    budget.rs

    MCP registry

    Spawns and supervises plugins over stdio.

    mcp_registry.rs

    Event store

    Structured SQLite events and local memory.

    events.rs
    Kerna Trust Bench

    Measured as a runtime, not a model.

    A deterministic suite that runs on every pull request. A single failure is a regression to fix, not noise to average out.

    PropertyRequired
    Unsafe-action prevention100%
    Approval ordering100%
    Budget enforcement100%
    Plugin isolation100%
    MCP protocol boundary100%
    Receipt integrity100%

    No inflated scores

    Task success and safety are never blended into one number. External suites such as AgentDojo publish nothing until a matched control run produces verifiable Kerna receipts.

    Every published result lists the version, commit, policy, trial count, and redacted artifacts.

    Read the methodology
    Install

    Up and running in a minute.

    Start with the mock provider. No API key, ideal for learning the control loop.

    npm
    npm install -g @premxai/kerna

    Prebuilt binaries, desktop installers, and SHA-256 checksums are on the latest release.

    Your first governed run

    terminal
    # Fail-closed workspace, no API key
    kerna init --ci --provider mock
    kerna pack install productivity
    kerna doctor
    
    # Run a bounded task, then inspect it
    kerna run "Prepare my morning brief"
    kerna inspect last
    kerna trace last

    Give AI work.
    Keep the keys.

    Open source, local-first, and fail-closed from the first command.