Skip to content

Commit 25d3c18

Browse files
committed
docs(adr): ADR-0011 and ADR-0151 notes record who confirms a declared-gated action on an AI door
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kZuoX9F5S7p84Dwue
1 parent 1e65a38 commit 25d3c18

2 files changed

Lines changed: 62 additions & 0 deletions

File tree

‎docs/adr/0011-actions-as-ai-tools.md‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
**Status**: Accepted — implemented (2026-06-04)
44
**Authors**: HotCRM (objectstack-ai/hotcrm) — surfaced the requirement; design finalised in framework
55
**Consumers**: `@objectstack/service-ai` (the bridge), `@objectstack/spec` (ui.action, contracts.ai-service), every app that ships actions
6+
**Amended** (2026-11-15, [#33689](https://github.com/objectstack-ai/objectstack/issues/33689)): a dated note under [Confirmation](#confirmation-hitl-approval-queue) records who confirms a declared-gated action on an AI door. The status line above is left as it is.
67

78
---
89

@@ -234,6 +235,44 @@ asking; an action the user can't invoke simply isn't offered.
234235
| `ai.requiresConfirmation: false` on a destructive action | exposed & direct-run — **author asserts safe** (bridge logs a warning) |
235236
| not destructive | direct-run |
236237

238+
> **Amendment note (2026-11-15, [#33689](https://github.com/objectstack-ai/objectstack/issues/33689) — PR #33725, `1e65a389`): who confirms a declared-gated action on an AI door.**
239+
> Ruled by the account owner on objectstack-ai/cloud#3826 (「3826 照建议(征询版)」, phase 1, card 1 of its
240+
> item-6 chain) and amended on #33689 (「我开始重新接受你说的主流方案,就是推送到客户的手机端」,
241+
> 「比如最简单的我可以先推送到邮件」). The contract is the docblock of
242+
> `packages/spec/src/contracts/ai-service.ts#AI_ACTION_CONFIRMATION_CAPABILITY`; it is the record, and this note
243+
> points at it without restating every case.
244+
>
245+
> - **Why.** On the MCP doors the confirmation of an action declaring `ai.requiresConfirmation: true` was the
246+
> caller's own `confirm: true`, which nothing could check. Measured on published 18.4.0, an agent sent it itself on
247+
> an irreversible action in 2 of 6 runs. The gate made forgetting loud; it did not prove a person.
248+
> - **Which calls.** An action whose author declared `ai.requiresConfirmation: true` (the declared flag, not the
249+
> destructive heuristic of the table above), called through the MCP `run_action` tool, or through `resume_run` for
250+
> the candidate action it would run, by any caller acting for a person, on an OAuth token or an API key.
251+
> - **How the person is asked, in order, after every admission gate and before anything runs.** (1) **Elicit**: one
252+
> MCP `elicitation/create` in form mode, when the client advertised `elicitation` at `initialize` and the door can
253+
> carry the request. (2) **Hand off**, otherwise: the call goes to the host's pending-confirmation service
254+
> (`packages/spec/src/contracts/ai-service.ts#IActionConfirmationService`, registered under
255+
> `packages/spec/src/contracts/ai-service.ts#ACTION_CONFIRMATION_SERVICE`) and the caller is answered
256+
> `status: 'pending_confirmation'` with a pending id. Only the person the call ran as approves or rejects it in the
257+
> app; an approved action runs as that person with every gate and permission re-checked, and a handed-off
258+
> `resume_run` resumes its parked run rather than starting one. The approve and reject doors take a person's
259+
> signed-in session to the app and nothing else. (3) **Refuse** only when the host registers no such service:
260+
> `428 ACTION_CONFIRMATION_REQUIRED` with `details.reason: 'no_confirmation_service'`.
261+
> - **The caller's `confirm` never counts** on such a call, in any of the three steps.
262+
> - **What an answer proves.** An elicited `accept` proves that the client answered, and an approved hand-off that a
263+
> signed-in session to the app answered. Neither proves a human; each is as strong as what it takes to give it.
264+
> - **Bounds.** The MCP `delete_record` and `delete_records` gates keep reading `confirm: true` until a decision moves
265+
> them, and REST `/actions` stays outside the gate for a person. **The in-app assistant door is OPEN**: the
266+
> bridge and approval queue this ADR describes in [Invocation flow](#4-invocation-flow) and the table above are not
267+
> named by the contract, which is silent on them until the maintainer decides (question 1 on #33689).
268+
> - **When it binds.** The contract ships in `@objectstack/spec/contracts` from the release that carries `1e65a389`.
269+
> The doors implement it in the next card of the chain. Until that change ships, every door gates on the member as
270+
> before (`packages/runtime/src/action-execution.ts#actionConfirmationRefusal`), and the addendum's sentence below
271+
> that a C action is refused "until the call carries `confirm: true`" stays the description of the running code.
272+
> - **Unchanged.** The opt-in and its default-off exposure; the addendum's H, C and E buckets and its rule that a C
273+
> action's confirmation is never relaxed (what changes is who confirms it, not whether it is asked); and the AI
274+
> service account's refusal, ADR-0151 D3 rule 3, which its own note of the same date records.
275+
237276
---
238277

239278
## Migration Path

‎docs/adr/0151-ai-service-account-a-headless-agent-is-a-registered-principal-of-its-own.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- **Leaves unchanged**: the 2026-09-16 note (a person's API key is that person's credential, never an agent); rule 5 and its credential-kind × target-door table; ADR-0118 D1, D2, D5 and D6; the meaning of `ExecutionContext.performedBy` (the OAuth client that acted for a person) and the room it reserves; the OAuth agent path end to end; ADR-0073's automation principal, which stays a separate identity.
99
- **Consumers**: `@objectstack/platform-objects` (two `sys_user` columns), `@objectstack/plugin-auth` (the registration, key and lifecycle doors; the session and credential refusal), `@objectstack/core` (key admission carries the kind; the shared assembler stamps the principal), `@objectstack/plugin-security` (the agent ceiling at evaluation and at assignment), `@objectstack/plugin-audit` and `@objectstack/spec` (the hook surface, O4), and in `objectstack-ai/cloud` the licence layer and the console (cloud ADR-0116 D7, cloud#3886, cloud#3820).
1010
- **Amended** (2026-11-10, [#32060](https://github.com/objectstack-ai/objectstack/issues/32060)): a dated note under [What builds on this](#what-builds-on-this) records what O3 and O4 shipped. The status line above is left as it is.
11+
- **Amended** (2026-11-15, [#33689](https://github.com/objectstack-ai/objectstack/issues/33689)): a dated note under [D3](#d3--its-authority-its-own-grants-under-the-agent-ceiling) records that rule 3 holds unchanged under the amended action-confirmation contract. The status line above is left as it is.
1112

1213
---
1314

@@ -75,6 +76,28 @@ ADR-0118 refused a seeded "system" pseudo-user for two reasons: seeding writes t
7576
- **Rule 5 needs nothing new.** An account's `api` action forward carries the account's own key, and that key already *is* the agent, so no forward credential is minted. Its cells in the table are the `api_key` row as it stands: the identity door refuses by name, the MCP and platform doors accept.
7677
- **MCP.** On the HTTP endpoint and over stdio (ADR-0101, `OS_MCP_STDIO_API_KEY`), an account's key admits the account through the same shared chain. The OAuth tool families are a person's consent and do not apply; the account's grants bound what its tools reach.
7778

79+
> **Amendment note (2026-11-15, [#33689](https://github.com/objectstack-ai/objectstack/issues/33689) — PR #33725, `1e65a389`): rule 3 under the amended confirmation contract.**
80+
> [ADR-0011](./0011-actions-as-ai-tools.md)'s note of the same date records the new contract
81+
> (`packages/spec/src/contracts/ai-service.ts#AI_ACTION_CONFIRMATION_CAPABILITY`): a person confirms a declared-gated
82+
> action on an AI door, elicited in the MCP client or handed off to the host's pending-confirmation service, and the
83+
> caller's own `confirm: true` never counts. Rule 3 is unchanged by it:
84+
>
85+
> - **An account acting for itself is refused whatever it sends.** It is neither elicited, since no person stands
86+
> behind the account and its own client could answer, nor handed off. From the change that implements the
87+
> contract, the refusal carries `details.reason: 'service_account'`
88+
> (`packages/spec/src/contracts/ai-service.ts#ACTION_CONFIRMATION_REFUSAL_REASONS`) on every door that runs an
89+
> action, REST `/actions` and host doors included, because the one admitted sequence asks this rule at each of them.
90+
> - **The pending-confirmation service is not the hold door rule 3 waits on.** It hands a person's own call back to
91+
> that same person (`packages/spec/src/contracts/ai-service.ts#IActionConfirmationService`), and an account has no
92+
> person behind it. Its approve and reject doors take a person's signed-in session and refuse an agent principal,
93+
> with or without `onBehalfOf`. A hold that routes an account's run to its owner or an administrator remains O6's,
94+
> through the approvals engine, and is a separate decision.
95+
> - **An agent acting for a person** (`principalKind: 'agent'` with `onBehalfOf`, the OAuth path) is not an account:
96+
> the contract asks the person it acts for.
97+
> - **Until the implementing change ships**, the gate is `packages/runtime/src/action-execution.ts#actionConfirmationRefusal`
98+
> as before, and it refuses an account through
99+
> `packages/runtime/src/action-execution.ts#isAiServiceAccountCaller` whatever the call sends.
100+
78101
### D4 — Its credentials: dedicated API keys, minted by a person
79102

80103
- **API keys, one or many.** Each key row carries `user_id` = the account and `active_organization_id` = the account's organization. An account may hold several keys (rotation, one per deployment); they remain one identity.

0 commit comments

Comments
 (0)