Skip to content
Merged
24 changes: 24 additions & 0 deletions .changeset/34209-retire-mcp-action-confirm-member.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@objectstack/mcp': patch
'@objectstack/spec': patch
'@object-ui/console': patch
---

feat(mcp,spec)!: `run_action` and `resume_run` refuse the `confirm` member — confirmation happens in the app, by the person

Clause-②: yes (narrowing)
Metadata-protocol: none (the retired member belongs to an MCP tool's input, not to a key a metadata author writes; `ai.requiresConfirmation` keeps its meaning. The dev confirms against the diff.)

<!-- adr-0087: not-required (already-registered action-requires-confirmation-elicited) The semantic entry for the amended confirmation contract already covers what a caller sends to run_action and resume_run; this change rewrites its wording so the same switch names the refusal of the confirm member. No authorable key is added, removed or re-shaped. -->

**BREAKING** for an MCP client, an agent or a script that sends `confirm` to the `run_action` or `resume_run` tool. Ruled by the maintainer: the member is retired, so a stale client is refused loudly instead of silently ignored. Since the hand-off to the person in the app, the caller's `confirm: true` confirmed nothing on these two tools; now a call that carries the member at all is refused.

- `run_action` and `resume_run` no longer declare `confirm`. A call that carries it, `true` or `false`, is refused by the tool's closed input, the same refusal any undeclared argument gets. This applies on every action, whether or not it declares `ai.requiresConfirmation`. The refusal names the member and says that confirmation happens in the app, by the person, or in the client when it supports elicitation and the connection can carry the question. Nothing is resolved or run.
- Unchanged: a call without the member on a declared-gated action is confirmed by the person. A client that advertised `elicitation` on a connection that can carry the question (stdio) has the person asked in the client, and `accept` runs the call. Otherwise the call is handed to the person (`status: 'pending_confirmation'`), or refused `428 ACTION_CONFIRMATION_REQUIRED` with `details.reason: 'no_confirmation_service'` on a host with no pending-confirmation service. The MCP `delete_record` and `delete_records` tools still require `confirm: true`. A host's own door (`dispatchAction`) under the `ai` posture still reads `confirm`.
- The served MCP skill (and the console's downloadable copy of it), the `tool.requiresConfirmation` retirement guidance in `@objectstack/spec`, and the contract prose in `@objectstack/spec/contracts` stop teaching `confirm: true` on these two tools. The upgrade-guide entry `action-requires-confirmation-elicited` now keys its switch on the hand-off rather than on elicitation, and names the refusal of the member.

What changes for a caller:

- FROM `run_action({ actionName, recordId, confirm: true })` (accepted, not read) TO `run_action({ actionName, recordId })`. Relay a `pending_confirmation` answer to the person and let them approve it in the app (or let them answer the question in their client, where it is asked there); do not retry.
- FROM `resume_run({ runId, values, confirm: true })` TO `resume_run({ runId, values })`.
- To fix a client: stop sending `confirm` to `run_action` and `resume_run`. Keep sending it to `delete_record` and `delete_records`.
20 changes: 17 additions & 3 deletions content/docs/ai/actions-as-tools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ through the API. Destructive actions (`confirmText`, `mode: 'delete'`,
`requiresConfirmation: true` so the client can ask the human before calling. To
assert that a destructive-looking action is safe for autonomous execution, set
`ai.requiresConfirmation: false`.
An action whose author declared `ai.requiresConfirmation: true` runs on an
agent's `run_action` call only once the person the agent acts for confirms it:
in the client, when the client supports elicitation and the connection can carry
the question (accept runs the call once; decline, dismissal or no answer in time
refuses it `ACTION_CONFIRMATION_REQUIRED`), and in the app otherwise: the call
does not run, it is handed to the person, who approves or rejects it there
(`status: "pending_confirmation"`), or it is refused `428`
`ACTION_CONFIRMATION_REQUIRED` on a server with no pending-confirmation service. The agent cannot confirm for the person: `run_action`
and `resume_run` refuse a call that carries `confirm`, on every action.
An AI service account does not confirm an action for itself: an action declaring
`ai.requiresConfirmation: true` refuses it at every door, REST `/actions` included,
whatever the request carries, and a person runs that action.
Expand Down Expand Up @@ -205,9 +214,14 @@ on the same record for this caller:
answer the same `404`, so a run id says nothing about runs you did not start.
- **The same gates as `run_action`.** A flow action exposed to AI
(`ai.exposed`) must target the run's flow on the run's object, and the caller
must pass its `requiredPermissions` and its activation switch. An action
flagged `ai.requiresConfirmation` needs `confirm: true` on the resume as well,
because the flow's writes happen after the screen.
must pass its `requiredPermissions` and its activation switch. When the
action's author declared `ai.requiresConfirmation: true`, the resume needs
the person as well, because the flow's writes happen after the screen: they
are asked in the client when it supports elicitation and the connection can
carry the question (accept continues the run; any other answer refuses the
call and the run stays paused), and otherwise the run stays paused until they
approve it in the app. `resume_run`
takes no `confirm`; a call that carries it is refused.
- **The record is read again as you.** A subject record you can no longer read
is refused `RECORD_NOT_FOUND` (`404`), as `run_action` refuses it.
- **Screens only.** A run waiting on anything other than a screen (a timer
Expand Down
31 changes: 27 additions & 4 deletions content/docs/ai/connect-mcp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,11 @@ can reach is the **default exposure policy (v1)**:
an organization, re-enabling an OAuth application) are exposed. Destructive
lifecycle acts (banning a user, revoking a session or an API key, removing a
member, deleting a team, leaving an organization) are exposed with
`ai.requiresConfirmation: true`, so `run_action` refuses them until the call
carries `confirm: true`. Acts that mint a credential or a session, change
`ai.requiresConfirmation: true`, so `run_action` runs them only once the
person confirms: in the client when it supports elicitation and the
connection can carry the question, and otherwise it hands each one to the
person in the app, or refuses it (`428`) on a server with no
pending-confirmation service. Acts that mint a credential or a session, change
ownership or a sign-in factor, or destroy an account or an organization
(impersonating a user, setting a password, creating an API key, transferring
ownership, deleting an organization) declare nothing and are not listed. The
Expand All @@ -430,7 +433,10 @@ can reach is the **default exposure policy (v1)**:
- **An approver's decisions are exposed to the approver's agent.** The four
decisions on an approval request (`sys_approval_request`): approve, reject,
reassign and send back, are exposed with `ai.requiresConfirmation: true`, so
`run_action` decides only once the call carries `confirm: true`. Each forwards
`run_action` decides only once the approver confirms: in the client when it
supports elicitation and the connection can carry the question, and
otherwise in the app, or the call is refused (`428`) on a server with no
pending-confirmation service. Once confirmed, each forwards
to its approvals route as the caller, and the approval service admits the
same people the console's buttons admit: a current approver of the request,
and, for approve, reject and reassign, the administrator who may override it.
Expand Down Expand Up @@ -597,7 +603,24 @@ drive this MCP server. Same word, different layer.
gate and `requiredPermissions` are checked at *invoke* time). Treat writing
an action as a code-review-worthy act — that's the real security boundary.
- An action can also declare `ai.requiresConfirmation`; destructive-looking
actions (`confirmText`, danger variants) default to requiring it.
actions (`confirmText`, danger variants) are listed with
`requiresConfirmation: true` by default, so a client asks its human first.
- **A person confirms a declared-gated action, in the client or in the app.**
When the author declared `ai.requiresConfirmation: true`, the agent's call
on `run_action` or `resume_run` runs only once the person the agent acts for
confirms it. When the client supports elicitation and the connection can
carry the question (a stdio connection, today), the person is asked in the
client: accept runs the call once; decline, dismissal or no answer in time
refuses it (`ACTION_CONFIRMATION_REQUIRED`, `details.reason` `declined`,
`cancelled` or `timed_out`). Otherwise the tools do not run the action on
the call: they hand it to the person and answer
`status: "pending_confirmation"` with a `pendingId`, and the person approves
or rejects it in the app. A server with no
pending-confirmation service refuses the call (`428`
`ACTION_CONFIRMATION_REQUIRED`, `details.reason: "no_confirmation_service"`),
and the person performs the action in the app. Neither tool takes `confirm`:
a call that carries it is refused, on every action, and the agent resends
without it.
- **An AI service account does not confirm an action for itself.** An action
declaring `ai.requiresConfirmation: true` refuses an AI service account's key
(`428` `ACTION_CONFIRMATION_REQUIRED`) at `run_action`, `resume_run` and REST
Expand Down
36 changes: 23 additions & 13 deletions examples/app-todo/test/mcp-actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,19 +241,29 @@ describe('app-todo business actions over MCP (CE runtime, no service-ai)', () =>

const gatedId = await seedTask('Needs a human');

// 7a/7b — [#33690] WITH the member and WITHOUT it alike: this app registers
// no pending-confirmation service, so the call is refused with the
// declared code and `details.reason: 'no_confirmation_service'`, and
// NOTHING ran. Before the amended contract 7b (with `confirm: true`) ran
// the handler; the member now travels the whole path and confers nothing.
for (const [id, extra] of [[12, {}], [13, { confirm: true }]] as const) {
const refused = await callMcp(confirmBridge, toolsCall(id, 'run_action', { actionName: 'todo_complete_task', recordId: gatedId, ...extra }));
expect(refused.result?.isError).toBe(true);
const refusedEnvelope = JSON.parse(refused.result?.content?.[0]?.text ?? '{}');
expect(refusedEnvelope?.error?.code).toBe('ACTION_CONFIRMATION_REQUIRED');
expect(refusedEnvelope?.error?.status).toBe(428);
expect(refusedEnvelope?.error?.details?.actionName).toBe('todo_complete_task');
expect(refusedEnvelope?.error?.details?.reason).toBe('no_confirmation_service');
// 7a — [#33690] Without the member: this app registers no
// pending-confirmation service, so the call is refused with the declared
// code and `details.reason: 'no_confirmation_service'`, and NOTHING ran.
const refused = await callMcp(confirmBridge, toolsCall(12, 'run_action', { actionName: 'todo_complete_task', recordId: gatedId }));
expect(refused.result?.isError).toBe(true);
const refusedEnvelope = JSON.parse(refused.result?.content?.[0]?.text ?? '{}');
expect(refusedEnvelope?.error?.code).toBe('ACTION_CONFIRMATION_REQUIRED');
expect(refusedEnvelope?.error?.status).toBe(428);
expect(refusedEnvelope?.error?.details?.actionName).toBe('todo_complete_task');
expect(refusedEnvelope?.error?.details?.reason).toBe('no_confirmation_service');
expect(await statusOf(gatedId)).toBe('not_started');

// 7b — [#34209] WITH the member: the member is retired, so the tool's
// closed input refuses the call before the runtime is reached — on the
// gated action and on an ungated one alike — and NOTHING ran. Before the
// amended contract this call ran the handler; under #33690 it reached the
// gate and conferred nothing; now it never gets past the input.
for (const [id, actionName] of [[13, 'todo_complete_task'], [15, 'todo_delete_completed']] as const) {
const withMember = await callMcp(confirmBridge, toolsCall(id, 'run_action', { actionName, recordId: gatedId, confirm: true }));
expect(withMember.result?.isError, actionName).toBe(true);
const text = withMember.result?.content?.[0]?.text ?? '';
expect(text, actionName).toContain('`confirm`');
expect(text, actionName).not.toContain('"ACTION_CONFIRMATION_REQUIRED"');
expect(await statusOf(gatedId)).toBe('not_started');
}

Expand Down
Loading
Loading