Octomind AI Agent Plugins: Write, Install
skillWrite, install and debug an Octomind AI agent plugin: the config entry, transports, events, effects, time limits and signed install. For your own plugins.
agents that use this skill
instructions
Overview
An Octomind plugin is a separate program. Octomind sends it an event at fixed points of the agent loop and applies the effects the plugin answers with. Use it to write a plugin, add an entry to plugins, or find out why one does nothing. Besydr, the plugin a new configuration lists, is covered by octomind-supervisor; do not repeat it here.
The word "plugin" names two things in Octomind. This skill covers the program in the plugins list of config.toml. The other is an Agent Plugin package (a folder with plugin.json, skills and an optional mcp.json); see "Tap packages" below. A tap ships the package, not an event plugin program.
Mental model
Octomind runs the loop, the plugin only answers. It never starts a request. Every event is one JSON-RPC 2.0 request: the method is the event name, params is the event, result is the answer, and each field of the answer is one effect. Effects only add: a note, a context block, a refusal of a tool call, a replaced tool result, a continued turn. A plugin cannot edit or remove a message a model request already carried. It runs with the user's rights and no sandbox, and sees every message, tool argument and result.
Rules
The plugins entry
Unknown keys are rejected. Names are unique. Put an inline plugins = [...] above the first [table] header, or put [[plugins]] blocks last, because keys after the header belong to that entry. Restart Octomind after a code change: a stdio plugin starts once per process.
| Field | Type, default | Meaning |
|---|---|---|
name | string, required | Shown in notices and logs; names the install directory |
type | stdio, socket or http, required | Transport |
command, args | string; list, [] | Program to start. Required for stdio |
path | string | Unix socket path. Required for socket |
url, headers | string; table, {} | Required for http; must start with http:// or https:// |
enabled | bool, true | false keeps the entry and starts nothing |
roles | list, [] | Empty means all. An entry matches the agent tag exactly or its namespace (developer covers developer:acme) |
timeout_seconds | integer 1-3600, none | Time for initialize; can only lower the limit of other events |
install_manifest, install_key | strings | Both or neither; signed install, stdio and socket only |
{{ENV:KEY}} works in command, args and header values. An unset or empty variable stops the plugin from starting and shows a notice.
Transports
stdio: Octomind startscommandin its own process group and talks over standard input and output, one JSON object per line. Standard error goes to the debug log asPlugin 'name' stderr: .... A line on standard output that is not a JSON-RPC response or aprogressnotification is ignored.socket: Octomind connects topath. Only when nothing answers andcommandis set does it start the program detached and retry for 5 seconds. That program may outlive Octomind and serve other processes.http: each message is one POST tourl, the answer is the response body, a non-2xx status is a failure. Notifications get 10 seconds. There is noprogress. All session data leaves the machine, so usehttps://.
A request has an id and needs a response with the same id. A message without id is a notification: do not answer it. One connection per plugin serves every session in the process, so two sessions can send requests at once.
Lifecycle
- At session start, for each enabled plugin whose
rolesmatch, Octomind sendsinitializewithprotocol: 1,hostandevents(each event with the effects it applies). - The plugin answers with
protocol: 1,plugin(name,version) andsubscribe. Optional:options,status_fields,commands,timeouts. Another protocol number, an error, no answer in time or an unreadable answer switches the plugin off for the session with one notice; the next session tries again. Unknown names insubscribeare ignored. - Octomind sends only subscribed events, plugins one after another in list order.
session.endis the last event. A closed connection is reopened before the next event,initializerepeats and the next event carries the full message list withmessages_reset.
options (all optional): min_output_tokens, result_chars, returned_chars, diff_chars, read_max_files (at most 200), read_max_file_bytes (at most 65536). Without them Octomind sends the plain default.
Events and effects
Every event carries session_id, role, workdir, project, messages (new ones since the last answer) and messages_reset, and often model, status, plan, tools, files. Common effects, allowed on every event that is answered except where noted: context, pin, usage, report, read, notice, register, history, plan, note.
| Event | Sent when | Extra effects, winner |
|---|---|---|
session.start | system prompt final; source is startup, resume or compact | none |
prompt.submit | user prompt, before the model; prompt | replace_prompt, block; first block wins |
request.before | before each model request; phase | none |
tool.before | before a round of tools; calls | deny, lift; first deny wins |
tool.after | results ready, model has not seen them; calls with result | replace, result_note, stop; first stop wins |
turn.end | model answered with no tool call; answers, changes | continue, verified; first continue wins |
compact.before | before a compaction; forced | none |
subagent.start | before a subagent; prompt | inherit (a note is dropped) |
command | user ran a slash command the plugin declared | output; no note, no plan |
status | /info asks | rows; no note, no plan |
judge | Octomind asks for a judgement; purpose is skills, capabilities, taps or compression | judgements; only usage, report, notice besides |
session.end | session ends; reason | only usage, report, notice |
compact.after and subagent.end are notifications: no answer, no effects. An effect an event does not allow is dropped and only the debug log says so; the rest of the answer counts.
Effect shapes: context and pin are lists of {name, text} (no text clears the block); notice, note, result_note are lists of strings; deny is [{call_id, reason}]; lift is [{call_id, rules}] for rules the same plugin registered; replace is [{call_id, text, keep_original}] and {original_path} in text becomes the saved original's path; stop and continue are strings (continue becomes the next input, at most 5 per user turn); plan is {action: start|advance|revise|finish, ...}; read is a list of paths or globs, whose texts arrive in files with the next event.
register
register is {rules, skill_dirs}. rules is TOML text in the format of .agents/guardrails.toml (the pipe, guard, hook and validator sections); each rule needs an id and a mode of apply or observe, and a rule without them is skipped. skill_dirs is a list of {id, path, mode}, where path is a directory holding one SKILL.md. Sending register again replaces what the plugin registered before; invalid TOML is only logged. Rule format: see octomind-guardrails.
Time limits and failures
initialize:timeout_seconds, else 30 seconds;progressdoes not extend it.- Other events: the seconds the plugin declares in
timeoutsfor that event, else 30;timeout_secondsonly lowers it. Range 1-3600. Aprogressnotification{"id": n}restarts the wait, but nothing waits longer than 3600 seconds in total. session.endgets at most 5 seconds.- Failure (timeout, closed connection,
error, unreadable answer): the agent goes on without that answer and Octomind sendscancelwith the requestid. A notice saysplugin 'name' did not answer EVENT: reason. - After 3 failures in a row the plugin is paused 30 seconds, then one trial event; each failed trial doubles the pause up to 600 seconds. One answered event ends it with
plugin 'name' answers again. - Notices print to standard error only on a terminal and not with
--format jsonl. The paused and failed-handshake notices are also reported as errors.
Signed install
With install_manifest and install_key (base64 of a 32-byte Ed25519 public key), Octomind downloads a missing command on first connect. Lookup order: a command with a path separator is used as given and never downloaded; then PATH; then plugins/<name>/ in the data directory; then the download. The manifest is {"version": "...", "targets": {"<target>": {"url": "...", "sha256": "..."}}}, fetched with its signature at the same URL plus .sig. Octomind checks the signature over the exact bytes, then the archive hash, and extracts one entry named like command (.tar.gz, or .zip on Windows). Targets: x86_64-unknown-linux-musl, aarch64-unknown-linux-musl, aarch64-apple-darwin, x86_64-pc-windows-msvc, aarch64-pc-windows-msvc. The manifest is at most 64 KiB, the archive 200 MiB, the program 1 GiB; connecting with a download may take 300 seconds. An installed program is never updated.
Seeing what a plugin did
- Set
log_level = "debug"or run/loglevel debug: the log shows the handshake, stderr lines, failures, ignored effects and unknown events. /infoshows the plugin'susageandstatusrows./planis built in and shows the plan a plugin set withplan. A plugin adds slash commands by declaringcommands(name,hint,description); a plugin command wins over a built-in of the same name. Besydr's/learningis one.
Tap packages
A tap's plugins/<name>/ holds an Agent Plugin package: plugin.json (with the $schema URL and a lowercase name of 1-64 characters), skills/<skill>/SKILL.md and an optional mcp.json. Octomind also scans <workdir>/.agents/plugins/ and ~/.config/agents/plugins/; the first source wins on a name. Its skills join the skill pool and its servers load when one of its skills activates. It does not start a program and adds no plugins entry. To ship an event plugin, publish the program with a signed manifest and give the user the plugins entry.
Common mistakes
- Printing logs to standard output. Use standard error.
- Answering a notification, or not answering a request.
- Missing
protocol: 1orsubscribein theinitializeanswer. - Declaring no
timeoutsfor a slow event and expectingtimeout_seconds = 300to raise the 30-second limit. - Sending an effect on the wrong event, for example
denyontool.after. - A rule in
register.ruleswithoutidormode. install_manifestwithoutinstall_key, or withtype = "http".
Examples
Entry for a program written in Python:
plugins = [
{ name = "tutorial", type = "stdio", command = "python3", args = ["/abs/path/plugin.py"], roles = ["developer"], timeout_seconds = 10 },
]Handshake answer, then one tool.before request and reply that refuses a call:
{"jsonrpc":"2.0","id":1,"result":{"protocol":1,"plugin":{"name":"tutorial","version":"0.1.0"},"subscribe":["tool.before"],"timeouts":{"tool.before":5}}}
{"jsonrpc":"2.0","id":2,"method":"tool.before","params":{"session_id":"s1","role":"developer","calls":[{"id":"c1","tool":"shell","arguments":{"command":"rm -rf /"}}]}}
{"jsonrpc":"2.0","id":2,"result":{"deny":[{"call_id":"c1","reason":"not allowed here"}]}}Bad: log with print("ready") and answer tool.before with replace. Good: log to standard error and answer deny.
Checklist
- The user means a program in
plugins, not an Agent Plugin package? - The entry has the fields its
typeneeds, andinstall_manifesthasinstall_key? - The
initializeanswer hasprotocol: 1,pluginandsubscribe? - Each effect is allowed on the event that carries it?
- Declared
timeoutscover the slow events? - Debug log checked for ignored effects, failures and stderr lines?
References
octomind-configfor the config file layout,octomind-guardrailsfor the rule format,octomind-supervisorfor Besydr.- Octomind docs:
doc/integration/05-plugins.md(wire types, five-step tutorial in Python, security notes) anddoc/integration/04-tap-system.md; the same pages are served at https://octomind.run/docs/.