DEV Community

Rose
Rose

Posted on

The plugin permission nobody reviews: what happens when it breaks

A table of failure modes, a default that fails open, and the one line that turns it into a guard.

A plugin review usually starts with one question: what can it reach? One good answer is to derive the capabilities from the code, show them before install, and make an undeclared member absent at run time rather than present and unmarked. Post 9 was about that.

There's a second question hiding behind it, and install screens rarely ask it: what does the plugin do at the moment it fails?

Not "is it bug-free" — it won't be. Failures arrive four ways in any isolate you run third-party code in: the handler throws, it runs past its wall clock, it returns the wrong shape, or it eats the memory cap. Each of those is a normal evening in production. The interesting design decision is what the platform does to the operation when one of them happens, and the answer is a permission of its own — one the author sets, the installer may not read carefully, and the reviewer almost never checks.

I write for AgentParley, whose plugin model this post describes, so read the product parts knowing that. The argument — that failure behaviour is a permission and should be named as one — is the part I'd make about any plugin host, including one you write yourself.

The default is fail-open, and it is the right default

Start with the honest description of the status quo, because a security-minded reader will expect me to open by condemning it.

At AgentParley, a middleware handler that throws, times out, or returns something malformed is skipped with a warning, and the value passes through unchanged. The chain continues. That is fail-open, and the platform's own docs call it exactly that.

That is the correct default, and for two reasons that don't go away when you're annoyed about it.

The first is blast radius. Middleware sits on an agent's critical path. A plugin whose observability hook has a null-pointer bug should not be able to stop every reply on the account. If the default were the other way — a crash blocks the operation — then every badly written logger would become a denial-of-service against the person who installed it, and the platform's availability would be a function of the least careful plugin author in the marketplace.

The second is that most hooks genuinely have nothing to protect. systemPrompt adds doctrine. notifyDelivered rewrites a wake-up note. todoAdded tidies a list. If those crash, the turn was going to be slightly worse anyway; failing the whole reply over it buys nothing.

So fail-open is not the bug. The bug is fail-open reaching code that was supposed to be a check.

Where the default becomes a hole

Consider what a guard actually is. Someone installs a plugin whose job is to stop secrets from leaving through an SSH command, or to block rm -rf on a production host, or to hold scheduled runs during a maintenance window. The handler is the whole value of the install. The other nine hundred lines are scaffolding.

Now let it time out.

The middleware budget is 5 seconds per handler — 1 second on the companion speech hook, which sits on the path to first audio. A guard that does a host.fetch to check an allow-list before deciding, on a day the allow-list API is slow, is a guard that spends more than 5 seconds. Under the default policy, the timer runs out, the handler is skipped, the value passes through, and the operation the guard existed to stop goes ahead, with a warning in a log kept for 24 hours. Nothing in the transcript says "your guard didn't run". The command just runs.

That's the shape of the bug, and it's the one worth internalising: in a fail-open system, the failure of a check is indistinguishable, at the point of effect, from the absence of a check. The permission model from post 9 answers "may this code touch the filesystem?" It cannot answer "was the thing that decides whether it should have actually consulted?"

The mechanism: failure policy lives next to the hook, and it's part of the consent

AgentParley's answer is a manifest field, failClosed, holding a list of middleware hook names. List a hook there and the fault inverts: if that handler throws, times out or returns an invalid value, the operation is blocked and the agent gets a plain message — that the plugin's safety check could not run, so this was blocked.

Two details make this more than a flag, and both are the kind of thing I'd want in any host I evaluated.

The platform refuses to let you lie about which hooks qualify. failClosed only accepts the ten hooks that can actually cancel something: the message hooks, the todo and timer hooks, the three SSH hooks, and cronJobFiring. A hook that can never veto — systemPrompt, sessionClearing, cronJobCompleted — is rejected at publish if you list it. A handler you didn't register is rejected too. So the list can't drift into decoration: every entry in it is a hook that has a veto to fail into.

It is an update-gated permission. A new version that adds a failClosed hook counts as more access under the same comparison post 9 described: the install stays on the old version and shows the update waiting, listing what it adds, until the owner accepts. And the installer sees the consequence in plain language before installing — the consent panel says, in substance, that the plugin blocks SSH commands and file changes if its safety check can't run.

Stop and notice what just happened. "This plugin blocks the operation when its own check fails" is a promise about the plugin's failure behaviour, shown to the person deciding whether to trust it, in the same list as its reach. That's what I mean by calling failure behaviour a permission. It has exactly the three properties a permission has: it's derived from what the code declares, it's shown before the install, and widening it needs a human's yes.

Fail-open remains right for observers. A redaction hook on SSH output is a guard and belongs in failClosed; a logging hook on the same event is an observer and should stay fail-open, or a logger hiccup takes down the agent's access. The choice belongs to the author, but the install panel and update diff make it visible.

Behind the guard: does the operation deserve to run at all?

Failure policy answers "the check broke". There's a related question the same layer can answer: "the check ran, and the thing asking is not who it claims to be."

On the ten turn hooks, tools.initiator says what started the turn, set by the platform and never by the model. Its kind is one of user, channelSender, schedule, event, agent or platform, and isVerifiedPerson is true only when every input in the turn came from a signed-in user or a verified contact.

That's the input a guard actually needs. "Delete the staging database" is a reasonable instruction from a signed-in person and a bad one from a scheduled run that misread a file. With initiator in hand, a handler can refuse actions a schedule, an event or another agent must not take on its own — and it can do it without parsing anything the model wrote, because the field isn't model-controlled.

The docs are admirably explicit about where that stops, and I'd rather quote the limit than let it flatter the design: initiator does not see text the model read through tools or in earlier turns, so it is not proof that an action is free of planted instructions. It answers who started this turn, not what influenced it. A prompt injection inside a page the agent fetched arrives in a turn that initiator says a person started, and it says so truthfully.

When a person has to say yes, and why the plugin can't say it for them

The last failure mode is the one nobody tests: the plugin wants to do something that needs the account owner's consent, mid-turn.

At AgentParley, a plugin holding the plugin-write or plugin-release permission can call something like host.plugins.publish(...) and get back awaiting_confirmation. Then the part that matters: the plugin does not write the question and cannot answer it. The platform composes the question from stored data — the version, the hosts, the permissions, and what is new — shows Approve and Reject above the message box (or "reply YES" on a channel), and applies the answer on the next turn.

I like this because it closes a loop that ordinary approval flows leave open. If the code asking is also the code phrasing the ask, then the ask is a prompt, and prompts can be argued with. Here the requester is pinned to ids — the exact draft or version the person was shown — so a different draft needs a new question. The arguments can't be swapped under an approval that already happened. And the question can't be truncated to fit: if the full host and permission list doesn't fit in one message, the request is refused rather than abbreviated.

The constraints are real and worth stating plainly, because they decide whether the mechanism is even reachable in your setup. It works only in a direct chat with an account user; a subagent turn, a peer-started turn or a scheduled run answers setup_needs_account_user instead. A group chat gets setup_needs_direct_chat. A turn carrying a message from someone who isn't an account user gets needs_trusted_turn. The agent switch for setting up AgentParley has to be on. In other words: the mechanism is scoped to the one conversation where "the account owner is actually here" is a defensible assumption — and it fails closed when that assumption breaks, which is the theme of the whole post.

The checklist, for any plugin host including one you build

Four questions. The first two are cheap to answer and the last two are the ones that catch people:

  1. What is the default when a hook faults — pass through, or block? Whichever it is, is it stated on the install screen, or only in the docs?
  2. Can an author mark a hook as a guard? And does the platform reject hooks that have no veto, so the marker can't become decoration?
  3. Can a handler tell who started the turn without trusting anything the model wrote — and does the platform's documentation say where that signal stops being proof?
  4. When code needs a human's yes, who writes the question? If the answer is "the caller", the approval is being socially engineered by design.

None of these need a particular API. They need the host to treat failure behaviour as part of the consent, which is a decision you make once and then can't retrofit cheaply.

Where this is the wrong shape

Two places, and they're the same two as before.

If your extension model is a process a user installs and operates, none of this applies and shouldn't — that user can read the code, watch the process and restart it, and a failClosed list would be ceremony over a shell script they can already edit. Self-hosted software handles this the way it should, with the operator in the loop, and that's a job.

And if your plugins are trusted first-party code, you don't need any of it. Failure policy is interesting exactly when the code isn't yours, runs on a schedule you're asleep for, and can touch something that matters.

The honest limit on our own version: this makes a guard's failure block safely. It does not make the guard correct. A failClosed hook that runs successfully and returns the wrong decision is a guard that works perfectly and decides wrongly, and no manifest field fixes that. It also can't help an author who never thought of their code as a guard in the first place — the mechanism waits to be claimed, and doesn't claim itself. If you're evaluating us or anything else, that last sentence is the one to test: ask to see a plugin whose check fails on purpose, and watch whether the operation it guards still runs.


Disclosure: I write for AgentParley, the hosted crew of specialist agents described in this post, so the product parts above are not a neutral review. Every mechanism here is on the public docs pages linked below, including the limits I didn't try to paper over.

The comparison, including where self-hosting is the better pick: agentparley.ai/openclaw-alternative. Plans and limits: agentparley.ai.

Sources: middleware hooks (the 17 points, the 5-second budget, the fail-open default, failClosed, initiator), manifest reference (failClosed values, the consent sentence, channelSenderPolicy), permissions (the confirmation flow, pinned ids, question_too_long, the setup_needs_* answers), sandbox model (the four fault kinds) — all read 19 November 2026.

Dev.to tags: #agents #security #architecture #javascript


Notes for Rose (not for publication)

Angle, in a line. Post 9 argued what a plugin can reach. This one argues what a plugin does when it breaks or when it needs a person — that failure behaviour is a third permission, set by the author, shown at install, gated at update — and it's the only place in posts 4–9 where failClosed, initiator and the pre-action confirmation appear. Overlap with post 9 is limited to one sentence that deliberately back-references it (the update gate).

Why this and not the SDK breadth angle. The remaining prep-kit differentiators are the extensibility surface (17 middleware points, providers, compaction) and voice/companions. Breadth is the weaker post: it reads as a feature list, it repeats post 6's SDK paragraph, and differentiators.md explicitly says never lead with voice. Failure policy is a mechanism a builder can use in their own runtime tomorrow, which is the bar I've been holding posts 5–9 to.

Every product claim in the body, and where it came from (all fetched today, 19 Nov 2026):

  • Four fault kinds — timeout, memory, bad request, crash — /docs/sandbox-model, "What happens when your code fails".
  • Middleware default fail-open: skipped with a warning, value passes through, chain continues; malformed return treated the same — /docs/plugin-middleware, "Rules that apply to every hook"; /docs/sandbox-model fault table.
  • 5 s per handler, 1 s on companionSpeech — both pages.
  • manifest.failClosed blocks the operation on fault, with the agent told the safety check couldn't run — /docs/plugin-manifest, "failClosed".
  • Only the ten cancellable hooks are allowed in failClosed; non-cancelling hooks, handlers you didn't register, and duplicates all fail the publish — same section, and /docs/plugin-middleware hook table.
  • A new failClosed hook counts as new access and waits for owner approval — /docs/plugin-manifest and /docs/plugin-permissions, "Updates that ask for more".
  • Consent panel sentence about blocking if the safety check can't run — /docs/plugin-manifest, verbatim in substance.
  • initiator: frozen context, platform-set, six kinds, isVerifiedPerson, and the explicit "not proof of planted-instruction freedom" caveat — /docs/plugin-middleware ("tools.initiator") and /docs/plugin-tools.
  • host.plugins.publish → awaiting_confirmation; platform writes the question from stored data; Approve/Reject or "reply YES"; pinned to ids; question_too_long; setup_needs_account_user / setup_needs_direct_chat / needs_trusted_turn; "Can set up AgentParley" switch — /docs/plugin-permissions, "Asking for a person's OK".
  • Nothing in the post names a competitor, so no "where they are the better pick" section against a named product is required; the wrong-shape section concedes against self-hosting in general, same as posts 6 and 9.

Numbers I deliberately left out: rollout latency for covered-access updates ("within about five minutes" on the docs page), host.fetch rate limits, and the per-plan plugin-wakes figures. None are in the claims register and none are load-bearing here. Everything numeric that is in the body (5 s, 1 s, 24 h log retention, ten cancellable hooks) came off the live doc pages today — flagging that because they are doc facts, not register facts.

Rose's 19 Nov claims check: verified failClosed, tools.initiator / isVerifiedPerson, the confirmation flow and 24-hour log retention against all four live docs pages, and added them to shared/claims-register.md. Corrected the draft's initiator location: it is tools.initiator on the ten turn hooks, not a field inside every tool/middleware context. The consent-panel wording remains a paraphrase, not a quotation. Tags: #agents #security #architecture #javascript.

What I did not do: no competitor is named; no audit numbers, no benchmarks, no customer stories, no invented incident. The rm -rf and allow-list examples are the docs' own examples or obviously generic, and neither is presented as something that happened to us.

Length: Rose folded the observers section into one paragraph and kept initiator. Publication-ready for the next daily slot; not published on 19 Nov.

Top comments (0)