mentionable.dev

Slack Operation Approvals

Audience: operators of the Slack Connector (examples/slack-connector) and bridge operators who want an agent to propose a registered operation (for example a GitOps merge or a chain-node volume replacement), an authorized person to approve it from Slack, and a separate executor to run it, without the agent ever holding the execution credentials.

Status: implementation guide for the Slack side of planetarium/vicoop-bridge#544. It is off by default. The bridge owns the registry, policy, digest, executor and audit. This page covers only how the Connector carries a proposal to the bridge and reflects the bridge’s decisions back into Slack.

On turns with a verified local requester, the connector requests the optional operation approval v1 extension when the Agent Card advertises it for the same trusted endpoint the turn will call. Follow-ups omit this extension if the card cannot be refreshed or its endpoint changed. Registration and decision credentials remain independently verified. The Slack client speaks A2A 0.3. For a trusted bridge card advertising /agents/<id>/v1, it selects the bridge’s unversioned 0.3 endpoint only when the card’s OAuth federation resource explicitly identifies that exact agent and origin. Dispatch, token exchange and task reads use the selected endpoint.

This is separate from slack-tool-approvals, which resumes a paused native tool call. An operation approval never resumes the agent. The approved request is run by the bridge’s executor.

What the user sees

  1. The agent ends its turn with a structured proposal artifact. The reply text appears as usual, and a public card appears in the same thread. It shows the agent, the registered operation name, who requested it, the expiry time, and the current status. It never shows the arguments.
  2. Members of the originating conversation can press Review operation. Only people the bridge authorizes to read that operation (the requester or an operator) see its private details. A private channel or DM reaches only its participants. Use a channel with an authorized operator, or decide through the bridge. A fresh bridge GET must report canDecide: true for the clicker before Slack displays decision buttons or accepts a click. A missing capability gives the reader a read-only view. A requester listed as an operator can approve or deny their own request. The review modal shows the stored arguments, executor, version and digest. Anyone without read access gets “not authorized” and sees no arguments.
  3. After a decision, the card follows the bridge state: approved, executing, then succeeded or failed. An unresolved execution shows as unknown while the connector continues polling. It can also end as denied, cancelled, or expired. When a final state is reached, the outcome is posted once in the thread, together with the executor’s result string if there is one.
  4. If the proposal cannot be reviewed from Slack, the thread gets a notice without arguments that says nothing will run from that message. This happens when the feature is off, the requester can’t be proven (agent-relay turns, Slackbot, Slack Connect users from another org), the bridge isn’t trusted, or the proposal is malformed.

Chat text never approves anything. Typing “approve” in the thread, and the model saying it is approved, have no effect.

Wire contract

Proposal (agent → Connector). A completed (or input-required) task artifact containing exactly one DataPart. The artifact id is the proposal’s identity (proposalKey, at most 200 characters):

{
  "artifactId": "proposal-7",
  "extensions": [
    "https://github.com/planetarium/vicoop-bridge/blob/main/docs/operation-approvals.md#v1"
  ],
  "parts": [
    {
      "kind": "data",
      "data": {
        "type": "vicoop.operation-proposal.v1",
        "operation": "merge-pr",
        "arguments": { "repo": "org/repo", "pull": 42 }
      }
    }
  ]
}

@mentionable/connector-kit decodes it into operationProposals on successful callA2A results and on streamA2A final frames. Proposals are kept out of parts, so arguments never reach a public renderer or the thread history. Status messages, Message results, a reused task’s seed artifacts, and failed or still-working tasks never count. On a single-shot follow-up, the connector reads the previous task’s artifact IDs before dispatch. If the receiver reuses that task, only new artifact IDs qualify. If the connector cannot verify the baseline, the thread gets a notice. A fresh task in the same context needs no baseline. Only a turn that requested the extension can register new work. Recovery requires the same activation recorded before dispatch.

Bridge API. The URLs are derived from the agent’s A2A endpoint https://<bridge>/agents/<agentId> (an optional /v1 suffix is stripped):

CallCredentialPurpose
POST /agents/:id/operationsoriginal requester{taskId, proposalKey, operation, arguments} → registers (idempotent per artifact)
GET /agents/:id/operations/:opIdrequester or the clickerFlat view {id, taskId, operation, executorId, version, arguments, digest, expiresAt, state, result}
POST /agents/:id/operations/:opId/decisionthe clicker (operator){decision: "approve" | "deny", digest}

States: pending, approved, denied, cancelled, expired, executing, succeeded, failed, and unknown. A 409 that says the proposal artifact is unavailable or the task is not ready means registration must wait. The Connector retries this from the reconciler for up to 30 minutes, then marks an unresolved registration unconfirmed. Any other 409 or 400, and any 403 or 404, also counts as a refusal. A continued source task can replace an older artifact. If a new proposal is needed after that refusal, ask the agent to issue a fresh one. For an unconfirmed registration, check the bridge first to avoid duplicating an operation that already exists.

Authority model

Endpoint pinning and rendering

MENTIONABLE_OPERATION_APPROVAL_TRUSTED_ORIGINS lists the bridge origins the operator trusts (https://host[:port], comma-separated, with the same rules as tool approvals: https only, and private hosts only with MENTIONABLE_ALLOW_PRIVATE_ADDRESSES=1). The A2A endpoint must be exactly /agents/<id> or /agents/<id>/v1 on a trusted origin. Encoded separators, dot segments, queries and credentials are refused. The endpoint is checked again against the current trust list on every use. Redirects are refused and response bodies are size-limited.

Agent- and bridge-controlled strings are rendered only as plain_text or rich_text_preformatted. Arguments appear only in the private modal. They never appear in public messages, logs, button values, modal metadata, or the database row. Arguments too large to show in full in one modal cannot be approved from Slack.

Durability

The table slack_operation_approvals (Postgres, created on first use) has one row per (bridge origin, bridge agent, task id, artifact id). The first writer wins, so a proposal delivered several times (stream final, snapshot, reconciliation) maps to one row, one bridge registration and one card. The row stores the opaque button key, the thread binding, the bridge operation id, the digest, the expiry, the state and the result. It does not store arguments: a registration retry re-reads the proposal from the durable task by its artifact id.

Every transition is a conditional UPDATE … RETURNING. Card and notice posts are claimed by a single winner first. A post that Slack neither clearly accepted nor clearly refused stays uncertain, and is resolved only by finding its marked message in the thread (conversations.replies with metadata, authored by this bot). It is never re-posted. The Slack-write guarantees and their gaps are the same as described in slack-tool-approvals. After an interrupted card update, the reconciler checks the marked Slack message. After 15 minutes without another write, a matching readback settles the display. A later writer invalidates stale confirmations. If a decision loses its response and the requester’s poll is unavailable, an operator can use Review again after the one-minute decision lock expires. The connector checks the current bridge state using that operator’s own credential.

The reconciler (/api/cron/reconcile-operation-approvals, plus a short round of polling right after a decision) does the following:

Deployments with operation approvals enabled need this route to run about every minute. The default vercel.json schedules it as * * * * *.

Setup

RequirementNotes
Bridge with operationsvicoop-bridge with the #544 operation API, a registered operation (VICOOP_OPERATIONS), operators and an executor.
MENTIONABLE_OPERATION_APPROVAL_TRUSTED_ORIGINSComma-separated bridge origins, e.g. https://bridge.example.com.
POSTGRES_URLDurable store. There is no in-memory production fallback.
OAuth federationMENTIONABLE_ADAPTER_SIGNING_KEY_JSON and a public host. Requester and operator identities are both bridge-verifiable federation subjects.
Reconcile schedulerCRON_SECRET, with /api/cron/reconcile-operation-approvals called about once a minute.
Slack scopesThe defaults (channels:history, groups:history) let retries find already-posted cards and notices.

If a Slack update times out, the worker compares the bot-authored card’s operation key and state with the bridge state. A matching card needs no rewrite. Later checks can repair a delayed stale update. Registration retries after an unreadable bridge response reuse the original artifact ID.

Limits and follow-ups