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
- 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.
- 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: truefor 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. - 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.
- 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):
| Call | Credential | Purpose |
|---|---|---|
POST /agents/:id/operations | original requester | {taskId, proposalKey, operation, arguments} → registers (idempotent per artifact) |
GET /agents/:id/operations/:opId | requester or the clicker | Flat view {id, taskId, operation, executorId, version, arguments, digest, expiresAt, state, result} |
POST /agents/:id/operations/:opId/decision | the 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
- Registration runs as the original requester: the Slack user whose
turn produced the artifact (
slack:<team>/<user>). It uses the OAuth federationtask.readbearer for that task. The bridge checks that this identity owns the task and that the artifact on the durable task matches the request exactly. - Review and decision use the clicker’s own federation bearer. The connector exchanges fresh proof for each click, including when a listed operator reviews their own request. The bridge alone decides who is an operator. Locally, the Connector only checks that the click came from the bound workspace, with positive evidence that the clicking user belongs to that workspace, and from the bound channel and card. Before anything is shown or decided, the view must name the same operation id, task, operation and digest as the stored row.
- Approve requires the digest from the modal’s metadata to equal the stored digest and a fresh GET. The decision POST carries that digest, so the bridge refuses the decision if the request changed.
- Status polling uses the original requester’s task-bound read credential.
- Who decided is attributed by the bridge’s audit history. The public card never guesses it.
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:
- registers proposals that are still waiting for their artifact;
- polls each live operation as its requester;
- re-renders stale cards and posts the final notice.
Deployments with operation approvals enabled need this route to run about
every minute. The default vercel.json schedules it as * * * * *.
Setup
| Requirement | Notes |
|---|---|
| Bridge with operations | vicoop-bridge with the #544 operation API, a registered operation (VICOOP_OPERATIONS), operators and an executor. |
MENTIONABLE_OPERATION_APPROVAL_TRUSTED_ORIGINS | Comma-separated bridge origins, e.g. https://bridge.example.com. |
POSTGRES_URL | Durable store. There is no in-memory production fallback. |
| OAuth federation | MENTIONABLE_ADAPTER_SIGNING_KEY_JSON and a public host. Requester and operator identities are both bridge-verifiable federation subjects. |
| Reconcile scheduler | CRON_SECRET, with /api/cron/reconcile-operation-approvals called about once a minute. |
| Slack scopes | The 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
-
Status polling uses the original requester’s task-bound, read-only continuation token. After the A2A task expires, a bridge with operation-origin token exchange can use the persisted origin to issue a fresh bearer restricted to reading that operation’s status. This lets the card keep updating throughout the approval window. Operator clicks use their own authenticated platform events.
-
When the tool-approval reconciler delivers a detached result, it checks for proposals on the matching completed task. It posts a notice through the result delivery ledger so the requester can check for an existing card or ask for a fresh proposal. It cannot verify artifact IDs against the original turn.
-
Background polling stops after eight days without a state change. An executor can still publish a later result on the bridge.
-
Ordinary streaming recovery queues a card when the persisted turn proves the requester and the original output. It can use a final stream checkpoint or a requester-authenticated task read with a matching execution marker. The checkpoint contains artifact IDs, operation names and argument hashes. Registration re-reads the original arguments and verifies their hash. A push callback lacks that turn binding and instead asks for a fresh proposal.
-
The requester cannot cancel from Slack. The bridge exposes
POST …/cancel, and the Connector reflectscancelledonce it happens. -
Card attribution of the deciding operator is left to the bridge audit (
GET …/audit), which the Connector does not render.