Skip to content

Host-verified operator authorization for plugin invocations and tool approvals #1541

Open
0 of 1 issue completed
Open

Description

@pixexid

Consolidated scope

This is the parent tracker for host-verified operator authorization available to plugin invocation contexts. #1564 is the concrete consumer: approval bound to an exact destructive tool invocation.

  • Supply a verifiable operator principal and request-bound, expiring authorization evidence with consistent semantics across CLI, RPC, HTTP, and agent-tool invocation.
  • Plugins need a trustworthy human-origin signal for gating destructive agent tools #1564 — Bind a human approval to the interaction, exact tool/arguments/target, and current invocation; reject replay, changed arguments, and self-issued evidence. Transport class alone must not be treated as proof of human approval.
  • Document what the host actually authenticates and the trust boundary; caller-supplied IDs or a local shared secret do not prove operator presence.

#1692 is closed as withdrawn following its author's withdrawal. Its historical observations are retained there; its former consuming project's authority stack is no longer an active dependency. #1564 remains a separate motivating use case. The platform observations below refer to the reported versions and were not reverified by this consolidation.

Problem

Full-trust BB plugins cannot distinguish a verified operator invocation from a local CLI call, plugin-token request, thread-attributed agent action, or unauthenticated execution. Installed BB 0.37.0 exposes request, thread, project, environment, host, provider, plugin, and machine attribution, but no BB-verified operator account subject or host-issued receipt.

Origin/Host checks are a browser boundary; a per-plugin HTTP token proves possession of the plugin secret; thread IDs, senderThreadId, originPluginId, and machine identity are attribution. None proves that the operator authorized a privileged mutation.

The original report cited pixexid/bb-collab#5 as its consumer; that historical motivation is qualified by the withdrawal noted above.

Requested capability

Add one host-issued, read-only operator receipt to plugin invocation contexts. It must be derived from a verified BB app account/session or explicitly authenticated remote session, never from request bodies, thread IDs, Origin, or plugin tokens.

Minimum semantics:

  • stable operator subjectId;
  • unique requestId;
  • issuedAt plus bounded validity;
  • host verification/signature, or an equivalent non-forgeable host attestation;
  • identical meaning across plugin CLI, RPC, HTTP, and native agent-tool invocation;
  • absent for unauthenticated callers;
  • absent for schedules and lifecycle events unless BB explicitly authenticates an operator for that invocation.

The plugin should receive an already-verified claim or a host verification API; it should not receive raw account credentials.

Acceptance

  • A plugin can distinguish a verified operator action from local CLI, plugin-token, thread-attributed, machine-attributed, and unauthenticated execution without trusting caller-supplied fields.
  • Caller-supplied fake receipts cannot become valid.
  • Missing, stale, replayed, wrong-subject, wrong-request, and wrong-host receipts fail closed.
  • CLI, RPC, HTTP, and agent-tool paths share documented semantics rather than separate identity mechanisms.
  • Schedules/services/events do not acquire operator authority implicitly.
  • A full-trust plugin cannot mint a valid operator receipt for itself.

Installed evidence

The BB 0.37.0 plugin contracts inspected through the installed application expose:

  • CLI: argv, optional cwd, threadId, projectId, and abort signal;
  • RPC: parsed input only;
  • HTTP: Hono context with local | token | none route auth;
  • agent tool: threadId, projectId, and abort signal;
  • agent configuration: thread/project/environment/host/provider/origin attribution;
  • services/schedules: abort signal or zero-argument callback;
  • thread events: lifecycle/thread metadata and request attribution.

No inspected surface carries a verified operator account subject. Full read-only probe SHA-256: 625ef301f9f79fa2232cae50925808b4760104986b3b121b65466b63cbd5e689.

Boundaries

This asks BB to extend its existing host/plugin invocation boundary. It does not propose a plugin-owned token file, shared secret, browser-origin heuristic, credential access, second authority service, or background implicit operator.

AGENT GENERATED

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    plugins
    security
    on Aug 18, 2026
  2. changed the title [-]Expose a host-issued operator receipt to plugin invocation contexts[/-] [+]Host-verified operator authorization for plugin invocations and tool approvals[/+] on Sep 9, 2026
  3. skillet07 commented on Nov 6, 2026

    @skillet07

    Another concrete consumer, observed on BB 0.48.1 / plugin SDK 0.5.29.

    Use case. A full-trust plugin whose page (desktop window and remote web/mobile window) performs owner-only writes over plugin RPC: closing tasks, editing records, changing statuses. Agents running in the same BB must not be able to call those writes – they should go through the plugin's own review flow instead. Read-only RPC methods stay open to agents.

    What we see.

    • The RPC handler receives experimental_caller, but a call from the BB window and bb plugin rpc call from an agent thread both arrive as { kind: "client" }.
    • The host already knows the surface (x-bb-app-surface: desktop / web / mobile / api), but it is not passed into experimental_caller.
    • Input validation runs before the handler, so a probe with an invalid input gets 400/422 and cannot tell "method open" from "method closed".

    Our interim workaround. A per-process random key that the page fetches over a bb.http.route(..., { auth: "local" }) endpoint and attaches to write calls. As this issue already says, this is not proof of operator presence: a local process can fetch the key by sending a matching Origin header. It only closes the default CLI path.

    Smallest change that would solve our case (a subset of the receipt requested here):

    1. Pass the invocation surface into experimental_caller for RPC, e.g. { kind: "client", surface: "desktop" | "web" | "mobile" | "cli" | "api" }, set by the host and never taken from request headers a local client can choose.
    2. Or a per-method option at registration, e.g. callers: ["app-window"], so the host rejects CLI/agent calls before validation with a 403.

    Either would let us replace the workaround with one host-verified check. A full operator receipt as described above would also work.

  4. JonniK commented on Nov 8, 2026

    @JonniK

    Another concrete consumer: the message.dispatch hook's experimental_submission (set through composer.submit({ experimental_data })). Reproduced on bb 0.49.0 (desktop app, macOS); code checked at main 55135d1.

    Use case. A plugin lets the user run a shell command from the composer: a send-menu item and a Mod+Shift+Enter command call composer.submit({ experimental_data: { … } }). The plugin's dispatch hook holds the message, runs the text in the thread's environment (outside the agent's permission mode), and sends the command and its output to the agent. An agent must not be able to trigger it. The SDK docs say the data reaches hooks "with the calling plugin's id", so the gate is ctx.experimental_submission.pluginId === bb.pluginId, plus initiator === "user", senderThreadId === null and originPluginId === null.

    What we see. pluginSubmission is a plain, caller-supplied field of the public send request. The composer handle fills it in on the client, and the server passes it to hooks unchanged:

    Repro, with no token, cookie or Origin:

    curl -s -X POST "$BB_SERVER_URL/api/v1/threads/<thread-id>/send" \
      -H 'content-type: application/json' \
      -d '{"input":[{"type":"text","text":"echo forged","mentions":[]}],
           "mode":"queue-if-active",
           "pluginSubmission":{"pluginId":"bang-shell","data":{"bangShell":1}}}'

    Result: HTTP 200. The hook sees experimental_submission: { pluginId: "bang-shell", … } with initiator: "user", senderThreadId: null and originPluginId: null, which is exactly what a composer submission looks like, so the command runs. An agent's shell has BB_SERVER_URL, so a prompt-injected agent can do this with one request. bb thread tell cannot set the field, and bb.sdk.threads.send stamps originPluginId, which the plugin refuses. The gate therefore closes only those two paths.

    I understand that access by local processes is out of scope under SECURITY.md and is tracked in #3708. This comment is about what a plugin can rely on, like the other consumers in this tracker.

    Smallest change that would solve this case (a subset of this tracker):

    1. Host-attested provenance on the dispatch context, for example experimental_submission.surface: "app" | "api" or verified: boolean. The server would set it only for submissions from an authenticated app session, such as the per-install secret proposed in Require local authentication on /api/v1 and the realtime socket #3708, and never from a request field or header. Or:
    2. Accept pluginSubmission only from app surfaces, and strip or reject it on CLI and raw API sends.

    In both cases, until it ships, the JSDoc of ComposerSubmitOptions.experimental_data and MessageDispatchHookContext.experimental_submission should say that the plugin id is caller-supplied, not verified.

    Either change would let a plugin gate a user-only action on a single host-verified check. Until then the plugin's README states that the gate is not a boundary against local processes: https://github.com/jonnik-bb-plugins/bb-plugin-bang-shell (v0.2.0).

    AGENT GENERATED

  5. robert-j-evc commented on Nov 28, 2026

    @robert-j-evc

    Additional consumer: scoped mapping writes and thread-ledger reads

    We have another plugin consumer for #1541. In the inspected bb-app 0.50.1 and @get-bb/plugin-sdk 0.6.157 packages, plugin RPC dispatch passes caller and cancellation context; caller.kind === "client" does not establish an authenticated human identity or permission. This observation is limited to those pinned packages.

    Two operations remain disabled in our integration pending a supported host contract:

    1. Save an organization/connection-to-host mapping under a fresh write permission.
    2. Read a delivery ledger in the UI only for a thread the authenticated person may read.

    The required boundary is:

    • The host supplies an opaque, request-bound invocation derived from a real authenticated human identity. It cannot be minted from JSON, a caller-selected header, pluginMetadata, a transport label, or a plugin-held token. It becomes invalid after logout, disposal, reload/reconnect, or relevant permission changes.
    • For a mapping write, the host freshly checks the applicable permission (keep.mapping.write or a supported equivalent). The plugin supplies the current server-resolved orgId / connectionId / revision / hostId; authorization and revision comparison must cover the actual commit, including changes across an await. Stale or changed scope must leave the mapping unchanged.
    • Before reading the ledger, host authority checks thread.read or its supported equivalent for that person and thread. The plugin then enforces organization, connection, revision, host and request scope. A thread ID selected in the UI grants no authority by itself.
    • Missing, forged, expired, replayed, wrong-request or wrong-thread invocations fail closed. Raw API/CLI calls and other programmatic callers cannot acquire human authority by changing payload fields.

    A shared installation token or a new caller-kind enum alone would not satisfy this boundary. This is separate from credential storage; it requests no account credentials. The host and its full-trust plugins remain part of the trusted computing base.

    Could a maintainer confirm whether a supported API already provides this, or which extension is accepted? To integrate it, we need a named implementation owner, an issue/PR for delivery, exact compatible host and SDK versions plus their release/artifact path, and runnable conformance tests on an isolated host.

    Acceptance needs a real authenticated-human positive control and denials for forged app/CLI/metadata input, wrong thread/request, logout, role/scope changes, reconnect, and stale revisions. Each authorization guard should have a bypass mutation that makes its behavioral test fail, followed by the restored positive control, with no skipped cases.

    If no supported path is planned, an explicit answer and the intended trust boundary would also let us make the correct product decision.

    — Robert, Entire VC

  6. matthiasvongrundherr commented on Nov 30, 2026

    @matthiasvongrundherr
    Contributor

    Another use case is model selection in the first message of a new conversation. On desktop 0.50.1 we observed a composer request with source: "spawn" and its matching turn/input/accepted. A plugin processing the accepted request later can correlate the two but cannot verify from the persisted events that the authenticated operator submitted it in the app. Thread provisioning in desktop 0.50.1.

    Could the supported host contract also let a plugin verify that historical attribution for one specific first request after acceptance and restart? An opaque host-verifiable reference bound to the thread, request, and submitted input would cover our use case. This is attribution for the original selection only. It should confer no authority for a subsequent action or a different request. Legacy entries with unknown provenance can remain unknown.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginssecurity

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions