Plugins
A plugin is an MCP-stdio subprocess the bridge spawns inside a bubblewrap sandbox. Installing grants nothing: every scope is a separate operator grant, and enabling is CLI-only policy. V1 plugins have no network egress; network-capable connectors stay first-party (http_get, github.*).
Manifest v1
Section titled “Manifest v1”manifest.toml at the archive root, strict TOML (unknown keys are errors):
[plugin]id = "probe" # [a-z0-9-]+version = "0.1.0"api = 1kind = "tool" # tool | connector | skill-packdescription = "what it does"entry = { type = "mcp-stdio", command = "/plugin/bin/probe", args = [] }
[requires]secrets = ["probe.token"] # resolved from the secret storenetwork = [] # must be empty in v1
[[tools]]name = "probe.sandbox" # must start with "<id>."effect = "read" # read | local_write | external_writescopes = [] # granted separately by the operatorEffects are read | local_write | external_write; exec and irreversible are not loadable in v1.
The sandbox (per tool call)
Section titled “The sandbox (per tool call)”One call = one bwrap-wrapped subprocess: spawn, MCP handshake, call, kill. Nothing survives.
- No network (
--unshare-net): anyconnect()fails. - Read-only system: only
/usr, the plugin root at/plugin(read-only), a private/tmptmpfs and/tmp/home./etc, your home and the daemon’s data are absent. - Secrets: only names in
requires.secrets, injected per convention (probe.token→PROBE_TOKEN). Undeclared secrets, the bot token and provider keys are never in the environment. - Limits: 30s wall clock (watchdog kill), 64 KiB output cap, at most 64 concurrent plugin connections.
Bubblewrap needs unprivileged user namespaces. On Ubuntu 23.10+ an unprivileged operator must relax the AppArmor restriction (kernel.apparmor_restrict_unprivileged_userns=0) or ship a profile granting userns to /usr/bin/bwrap; the bridge reports the exact failure otherwise. Plugins are Linux-only: on macOS and Windows, install and enable refuse with plugins need Linux (doctor says the same), and network-free connectors stay first-party. Plugin tool calls ride the daemon’s approval profile: a plugin whose manifest reads as read-only gets the Read effect (auto-allowed), any other plugin tool is ExternalWrite and asks.
Signing and TOFU
Section titled “Signing and TOFU”ka-agent plugin keygenkeeps one ed25519 keypair per instance; the public line goes to vendors.ka-agent plugin pack <dir> --out <archive>tars deterministically and signs the exact bytes (.signext to the archive).ka-agent plugin install <archive>verifies the signature, checks the TOFU pin (the key that signed an id’s first install is the only key allowed to sign its updates), unpacks, and records the tree digest. Install never enables.- Tampering with installed files is detected at bridge load: the recomputed digest must match, or the plugin is disabled with a visible reason and its tools vanish.
Lifecycle
Section titled “Lifecycle”ka-agent plugin keygenka-agent plugin pack ./my-plugin --out ./my-plugin-0.1.0.kplugka-agent plugin install ./my-plugin-0.1.0.kplugka-agent plugin enable my-pluginka-agent plugin listka-agent plugin disable my-pluginka-agent plugin rm my-plugin # refuses while enabledPolicy at call time
Section titled “Policy at call time”Plugin tools reach engines as kagent__<tool> through the single bridge. For each call the bridge checks declared scopes against the grants store (refusals name the exact ka-agent grant add line), records intents for local_write/external_write (the same audit trail as first-party writes), spawns the sandbox, forwards the call, and settles the intent. The reference plugin is examples/plugins/probe; the full contract is docs/contract/plugins.md.