Skip to content

System Overview

Functional Architecture

At the conceptual level, AKA is a policy checkpoint between an agent harness and the model: every prompt, tool call, and response passes through it — before the model sees it (prompts, tool inputs) or after it responds (tool outputs) — and each one resolves to an outcome: Monitor, Warn, Redact, Block, or a manually-granted Exception.

Related reference

See How it works for the traffic-flow diagram.

Concept model
Plugin Hooks that intercept harness sessions captures Event Prompt, response, or code change scanned against Rule Pack Rules + fixtures, by category produces Finding A rule match against an event resolved by Policy Maps a rule or category to an action results in Action Monitor, Warn, Redact, Block, or Exception

Logical Architecture

At the logical level, those concepts map onto a TypeScript-strict pnpm monorepo, split so each concept has one owning package. The three harness-facing apps never talk to each other — they share behavior only through the runtime layer underneath them:

flowchart TD
    subgraph adapters["Coding-agent plugins"]
        plugin["plugins/claude-code<br/><small>Hooks + mod for Claude Code / Claude Desktop</small>"]
        codex["plugins/codex<br/><small>Hooks + skills for Codex CLI</small>"]
        antigravity["plugins/antigravity<br/><small>Hooks + skills for the agy CLI</small>"]
        copilot["plugins/copilot<br/><small>Hooks for Copilot CLI / VS Code</small>"]
    end

    browser["plugins/browser-extension<br/><small>Chrome MV3 + native host — ChatGPT / Claude.ai</small>"]

    subgraph apps["Local apps"]
        cli["cli<br/><small>The aka CLI</small>"]
        webui["web-ui<br/><small>OSS Next.js dashboard</small>"]
    end

    subgraph runtime["Shared runtime"]
        scanner["packages/scanner<br/><small>Working-tree scan behind /aka:scan</small>"]
        wizard["packages/setup-wizard<br/><small>Harness-agnostic /aka:setup core</small>"]
        pluginRuntime["packages/plugin-runtime<br/><small>Standalone + attached DataGateway</small>"]
        sdk["packages/plugin-sdk<br/><small>Adapter interface, runtime, bundled packs</small>"]
        localOps["packages/local-ops<br/><small>Updates, fs scan, Data Shares forward</small>"]
        remote["packages/remote<br/><small>Control-plane transport — the only socket</small>"]
        detections["packages/detections<br/><small>Pure detection engine — scan + redact</small>"]
        persistence["packages/persistence<br/><small>Local SQLite store adapter</small>"]
        schema["packages/schema<br/><small>Zod contracts — single source of truth</small>"]
    end

    subgraph ui["Dashboard UI"]
        dashboardUi["packages/dashboard-ui<br/><small>Shared React views</small>"]
        uiKit["packages/ui-kit<br/><small>UI primitives</small>"]
    end

    rules["rules/<br/><small>Detection rule packs</small>"]

    adapters --> scanner
    adapters --> wizard
    adapters --> pluginRuntime
    browser --> pluginRuntime
    scanner --> pluginRuntime
    scanner --> sdk
    wizard --> sdk
    pluginRuntime --> sdk
    pluginRuntime --> remote
    pluginRuntime --> persistence
    sdk --> detections
    sdk --> persistence
    rules -.->|bundled at build time| sdk
    cli --> pluginRuntime
    cli --> localOps
    webui --> localOps
    webui --> remote
    webui --> dashboardUi
    localOps --> sdk
    dashboardUi --> uiKit
    detections --> schema
    persistence --> schema
    remote --> schema

Every package also depends on packages/schema; only the edges that carry behaviour are drawn. detections uses packages/extract (CSV) for tabular scanning, and cli bundles the browser extension and web-ui into its published package.

cli and web-ui read/write packages/persistence directly; the harness plugins go through packages/plugin-runtime and packages/plugin-sdk, since that's the layer that also owns the hook lifecycle. That's what makes a new harness an adapter rather than a fork: Claude Code, Codex, Antigravity, and the browser extension differ only in how their host delivers events and what its hook output can express. packages/detections is pure (no I/O), so the same scan/redact logic runs identically whether it's invoked from the plugin or the enterprise backend. packages/plugin-sdk is what lets a new harness adapter reuse the same runtime instead of reimplementing storage/detection — see Data Flow for how a request actually moves through these packages.


Where things live

Path What
~/.aka/settings/settings.json Your preferences (run mode, redaction policy)
~/.aka/data/aka.db The local SQLite store (events, findings, policies)
~/.npmrc GitHub Packages scope + auth (pre-release only)

Everything is local. To start over, remove ~/.aka and run aka init again.