Skip to content

fix(plugin-security, plugin-auth)!: a person-to-permission-set assignment refuses an agent ceiling set at every write door, and so does the self-registration permission set - #30578

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/sec-hardening-r6
Nov 5, 2026

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Clause-②: no (narrowing) — a non-system insert or update of sys_user_permission_set that would store an assignment naming one of the three MCP agent ceiling sets (mcp_agent_data_read, mcp_agent_data_write, mcp_agent_restricted) is refused with 400 VALIDATION_FAILED (invalid_value at permission_set), for every caller, a platform administrator included; and an audience configuration whose selfRegistrationPermissionSet names one is refused ([audience] invalid audience configuration), at construction and through the auth settings; nothing is widened.
Metadata-protocol: none
Skills-docs: none — skills/** teaches neither the assignment door's sets nor the self-registration set. The selfRegistrationPermissionSet description in packages/spec/src/system/auth-config.zod.ts names the admin_full_access refusal, which stays true; it does not list every set the runtime refuses, and this change makes no sentence there false.

维护者速读

  • 改了什么:人员权限集分配表 sys_user_permission_set 的每个写入口(单条新建、更新、createMany、updateMany、两种批量、两种导入)现在拒绝存入三个 MCP 智能体上限权限集,统一返回 400 VALIDATION_FAILED,字段 permission_set、代码 invalid_value;受众配置的自助注册权限集 selfRegistrationPermissionSet 也拒绝这三个集(启动时与认证设置里同样拒绝)。
  • 为什么改:这三个权限集是经 MCP 接入的 AI 助手自己的权限上限,由其用户同意的范围在请求时推导,从不读分配行;分配表的每一行都是给人的授权,所以规则在服务端对每个写入口、每个调用者(平台管理员也不例外)成立;自助注册者也是人,所以给他们的权限集同样不能是智能体上限。
  • 风险与回滚:破坏性收窄,只影响曾经通过分配表给人分配这三个集、或把其中之一配置为自助注册权限集的部署:新写入和对此类旧行的编辑被拒,旧行原样保留、可删除或改名;这样的受众配置在启动时被拒,改成给人的权限集即可;系统写入不受本钩子评判;回滚即 revert 本 PR(一个新钩子模块、一行注册、受众校验里一条拒绝)。
  • 先看:① packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts 的 onUpdate(以写后行判定,覆盖按谓词的多行更新)与它的系统写入说明;② packages/plugins/plugin-auth/src/audience-posture.ts 中 admin_full_access 拒绝旁新增的智能体上限拒绝;③ content/docs/permissions/system-context.mdx 的 23f 行。
  • 两分钟验证:pnpm --filter @objectstack/plugin-security exec vitest run src/agent-ceiling-grant-refusal.test.ts,预期 Tests 14 passed (14)。
  • 需要你做的:无,席位落地。

What changes

  • The rule (ADR-0090 D10). The MCP agent ceiling sets (MCP_AGENT_PERMISSION_SETS, imported from @objectstack/spec/ai, never retyped) are an AI agent's own grants: the door that admits an agent connected over MCP derives the ceiling from the scopes its user consented to and puts it on the agent's request. No assignment row is read for it, and no sys_user row is an agent principal, so every sys_user_permission_set row is a person's grant and never names one.
  • Where it holds. A new module, packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts, registers a beforeInsert and a beforeUpdate engine hook on sys_user_permission_set (priority 35: after the catalog check that the name is a set at all, before the holder's membership is read). Every door that writes the table writes through the engine, so each one is covered: the data API's create and update, createMany, updateMany, the per-object and cross-object batch, and the sync and job import doors.
  • Which rows are judged. An insert judges the row's set. An update judges the set the row holds after the write: the payload's permission_set when it carries one, the stored one when it does not. So an update that keeps an assignment naming a ceiling in force (a new holder, a validity window, an echo of the set) is refused as well as a rename to a ceiling, by id and by predicate.
  • The self-registration set (@objectstack/plugin-auth). A self-registrant is a person, so assertAudienceConfig refuses an agent ceiling set as selfRegistrationPermissionSet, beside its refusal of admin_full_access, with the message that refusal uses ([audience] invalid audience configuration: selfRegistrationPermissionSet must not be '...'). It applies at construction (auth.audience in the stack config stops the boot) and on the auth settings patch (audience_self_registration_permission_set is refused and the standing audience keeps ruling). AudienceConfigSchema in @objectstack/spec is not touched by this PR.
  • What it leaves alone. A delete is never judged. A system write (isSystem) is not judged. Writer by writer: the platform-admin promotion and the organization-admin reconcile name their sets in code, and neither is a ceiling; the self-registration grant writes only the validated selfRegistrationPermissionSet; seed replay and the development-only demo-staff seed write the sets their stack declares, unjudged. Every other permission set stays assignable. An agent principal's ceiling is resolved exactly as before. An organization administrator is still refused the same sets on the organization boundary first (403 PERMISSION_DENIED).
  • The envelope. validationFailure (the constructor both HTTP doors map) with one fields[] entry: field: 'permission_set', code: 'invalid_value' (the ADR-0114 member: the set exists, so it is not reference_not_found), value, and a sentence naming the way through. No new error code (ADR-0112).
  • Registration. security-plugin-start-hooks.ts calls registerAgentCeilingGrantRefusal(ql, ctx.logger) beside the permission-set name hooks. It is idempotent on a re-run of start(), and warns and returns false on an engine with no hook registry.
  • Public surface. Unchanged: none of the new module's symbols is re-exported from the package entry (measured on the built dist/index.d.ts and dist/index.d.mts: 0 hits for each of the five names, positive control SecurityPlugin 24 hits each).
  • Changeset. .changeset/sec-hardening-r6-agent-ceiling-grant.md, patch on @objectstack/plugin-security and @objectstack/plugin-auth with a BREAKING banner, both declaration lines, its ADR-0087 disposition, and the fix for a deployment that holds such an assignment (delete it, or rename it to a set meant for people) or names such a set for self-registrants (declare a set meant for people).
  • System-context register. content/docs/permissions/system-context.mdx gains row 23f. Its Get cell names, writer by writer, what keeps a ceiling out of a system write (the fixed-name writers by construction, the self-registration set by the audience validation); its Lose cell names the seeds, which write what their stack declares. A non-system write that would store an assignment naming an MCP agent ceiling set is refused for every caller. Its generated site register now names agent-ceiling-grant-refusal.ts#onInsert and #onUpdate under that row (regenerated with node scripts/check-system-context-census.mjs --write).

Tests

  • packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.test.ts (new, 14 tests; real ObjectQL engine, SQL driver on in-memory SQLite, the real SecurityPlugin started on it):
    • each of the three ceiling sets is refused on insert by a platform administrator (400, VALIDATION_FAILED, one field entry permission_set / invalid_value / the value), and nothing is stored;
    • a batch insert with one ceiling row among person grants is refused whole;
    • an update by id renaming a grant to a ceiling, and a predicate update renaming several, are refused and leave every row untouched;
    • an update that keeps a stored ceiling assignment in force (new holder, new window, echo of the set, by predicate) is refused;
    • controls: a person's set is assignable; renaming a stored ceiling assignment to a person's set, and deleting one, both land; system inserts and a system update stand down; an agent principal still resolves its ceiling with no assignment row while a person resolves none;
    • registration is idempotent, and an engine with no hook registry gets false and one warning.
  • packages/plugins/plugin-auth/src/audience-posture.test.ts (beside the admin_full_access pin): each of the three ceiling sets is refused as selfRegistrationPermissionSet under open and email_domain, with the message pinned; control: member_default and portal_user stay declarable. audience-posture-setting.test.ts: a ceiling set stored as audience_self_registration_permission_set is refused through the settings channel and the standing invite_only keeps ruling.
  • packages/qa/dogfood/test/grant-table-write-contract.dogfood.test.ts (new top-level block, 5 tests on the booted showcase stack over HTTP, sharing the file's one showcase boot with the existing block; its beforeAll asserts the shipped catalog serves all three ceiling sets, so the catalog check does not answer first):
    • POST of each ceiling set, and a PATCH renaming a person grant to one, answer the full envelope and store nothing;
    • createMany and the cross-object /batch answer the full envelope;
    • updateMany and the per-object batch fail the row in their per-row report with code: 'VALIDATION_FAILED', httpStatus: 400;
    • the sync import and the import job fail the row with code: 'invalid_value' at permission_set.
  • Ablation, plugin-auth. With the new refusal's condition replaced by false (via scripts/ablation-replace.mjs, restored automatically): 4 failed / 75 passed across the two files (the three ceiling pins and the settings-channel pin red, the person-set control and every other pin green); restored, the file's blob equals the committed one and both files pass.
  • Ablation, plugin-security. With the guard line replaced by a no-op (via scripts/ablation-replace.mjs, restored automatically): the unit file goes 7 failed / 7 passed (every refusal pin red, every control green), and the dogfood block, rebuilt and checked with scripts/ablation-dist-preflight.mjs, goes 5 failed / 3 passed (the 3 are the file's existing grant-table pins), and each of the four door pins after the first, run alone so no earlier row feeds a later one, also goes red. Restored and rebuilt, both are green again.

Acceptance notes

  • The per-row report doors carry no fields[]. updateMany and the per-object batch answer 200 with a per-row report whose failed row carries the refusal's code and httpStatus but not its fields[] entry; that is those doors' existing report shape for every validation refusal, not something this change introduces, so it is pinned as it stands.
  • The dogfood file boots the showcase once. Both blocks share one file-level boot and sign up their own users. Measured on a shared agent box: 13.31 s and 13.52 s with two boots; 10.05, 9.64, 9.78, 9.21 and 9.00 s with one. That is at the 10 s line, so it carries no test-budget: header; a CI reading over it would be the case for one.
  • Stored assignments are not migrated. An assignment stored before this release that names a ceiling set is left in place and can no longer be edited; the changeset gives the query to list them and the two ways to clear one.
  • Clause-② spelling. The diff narrows the accept set and widens nothing (no new export reaches the package entry), so the declaration is no (narrowing).

Verification

Head: e1305f7524 (branch claude/sec-hardening-r6, merged with main at 6701c08). The plugin-security ablation readings were taken on 1b9179369a, and that module's code is unchanged since (its note was reworded). The plugin-auth ablation ran on 398fe7f1d6 (the one commit after it changes only the dogfood test file). Both package suites, the battery and the gates ran at e1305f7524.

plugin-auth pins: 79 passed; ablated: 4 failed, 75 passed
pnpm --filter @objectstack/plugin-auth exec vitest run --maxWorkers=2 src/audience-posture.test.ts src/audience-posture-setting.test.ts
  (the new refusal's condition replaced by `false` through scripts/ablation-replace.mjs, restored on exit; on commit 398fe7f1d6)
 Test Files  2 failed (2)
      Tests  4 failed | 75 passed (79)
red:   the three ceiling names under open and email_domain, and the settings-channel pin
green: the person-set control, the admin_full_access pin, every other pin
restore: whole-tree git status --porcelain empty; the file's blob equals the committed blob (3f5e4819f7)
 Test Files  2 passed (2)
      Tests  79 passed (79)
plugin-security unit file: 14 passed; ablated: 7 failed, 7 passed
pnpm --filter @objectstack/plugin-security exec vitest run src/agent-ceiling-grant-refusal.test.ts
  (guard line replaced by a no-op through scripts/ablation-replace.mjs, restored on exit; head 1b9179369a)
 Test Files  1 failed (1)
      Tests  7 failed | 7 passed (14)
red:   the three single inserts, the batch insert, the rename by id, the predicate rename, the update that keeps a stored one in force
green: the spec list, the person-set control, the rename-away and delete control, the system stand-down, the agent principal, idempotent registration, no hook registry
restore: whole-tree git status --porcelain empty; sha256 of the module matches the pre-ablation hash
Dogfood file: 8 passed on one boot; ablated through the built bundle: 5 failed, 3 passed
head 1b9179369a (two boots then)
ablated: pnpm --filter @objectstack/plugin-security build                        exit 0
         node scripts/ablation-dist-preflight.mjs @objectstack/plugin-security 'throw agentCeilingGrantError(name)' --absent
           marker absent from all 6 built files                                   exit 0
         pnpm --filter @objectstack/dogfood exec vitest run test/grant-table-write-contract.dogfood.test.ts
           Tests  5 failed | 3 passed (8)                                         exit 1
         each of PATCH, createMany+/batch, updateMany+per-object batch, both imports run alone with -t:
           Tests  1 failed | 7 skipped (8)                                        exit 1 each
restored: whole-tree git status --porcelain empty; rebuilt; marker present in 2 built files; 8 passed (8)
one boot (final file): 8 passed (8) on each of five runs; file line 10052, 9640, 9778, 9209, 9003 ms
Package suites: plugin-auth 4018 passed, plugin-security 5407 passed; typecheck clean
pnpm --filter @objectstack/plugin-auth test                                       exit 0
 Test Files  224 passed (224)
      Tests  4018 passed | 10 skipped (4028)
pnpm --filter @objectstack/plugin-security test                                   exit 0
 Test Files  246 passed (246)
      Tests  5407 passed | 45 skipped (5452)
pnpm --filter @objectstack/dogfood --filter @objectstack/plugin-auth --filter @objectstack/plugin-security typecheck   exit 0
Full dogfood battery at e1305f7: 420 files passed, 3505 tests passed
pnpm --filter @objectstack/dogfood test   (no OS_TEST_SHARD, full closure built first, under the verify lock)   exit 0
 Test Files  420 passed | 3 skipped (423)
      Tests  3505 passed | 36 skipped (3541)
Derived gates at e1305f7: 93 derived, 93 run, 0 not measured; all exit 0

node scripts/pm/dispatch-gates.mjs --commands derived 93 commands for this change set (nine paths); --ran on the record: 93 run, 0 NOT-MEASURED, 0 UNRUN. Each exit code was captured before any pipe.

exit command
0 node scripts/check-adr-0087-registration.mjs --base origin/main
0 node scripts/check-adr-0087-registration.mjs --self-test
0 node scripts/check-adr-links.mjs
0 node scripts/check-adr-links.mjs --self-test
0 node scripts/check-changeset-no-major.mjs --base origin/main
0 node scripts/check-closing-keyword-parity.mjs
0 node scripts/check-closing-keyword-parity.mjs --self-test
0 node scripts/check-comment-mask-adoption.mjs
0 node scripts/check-comment-mask-adoption.mjs --self-test
0 node scripts/check-comment-mask-corpus.mjs
0 node scripts/check-dev-prereqs.mjs --self-test
0 node scripts/check-doc-route-spelling.mjs --advisory
0 node scripts/check-doc-route-spelling.mjs --self-test
0 node scripts/check-docs-section-name.mjs
0 node scripts/check-docs-section-name.mjs --self-test
0 node scripts/check-dts-emitted.mjs --self-test
0 node scripts/check-empty-changeset.mjs --base origin/main
0 node scripts/check-empty-changeset.mjs --self-test
0 node scripts/check-issue-citations.mjs
0 node scripts/check-plugin-teardown-shape.mjs
0 node scripts/check-plugin-teardown-shape.mjs --self-test
0 node scripts/check-section-landing-index.mjs
0 node scripts/check-section-landing-index.mjs --self-test
0 node scripts/check-tenant-audit-census.mjs
0 node scripts/check-tenant-audit-census.mjs --self-test
0 node scripts/ci/assert-turbo-remote-cache.mjs --self-test
0 node scripts/ci/plan-test-core-shards.mjs --self-test
0 node scripts/ci/prune-turbo-cache.mjs --self-test
0 node scripts/docs-audit/check-affected-docs.mjs
0 node scripts/docs-audit/check-drift-comment.mjs
0 node scripts/pm/release-rehearsal-clone.mjs --self-test
0 node scripts/release-pending-publish.mjs --self-test
0 pnpm --filter @objectstack/lint run check:doc-formula-expressions
0 pnpm --filter @objectstack/lint run check:doc-security-posture
0 pnpm --filter @objectstack/spec run check:docs
0 pnpm --filter @objectstack/spec run check:duration-unit-keys
0 pnpm --filter @objectstack/spec run check:empty-state
0 pnpm --filter @objectstack/spec run check:liveness
0 pnpm --filter @objectstack/spec run check:skill-examples
0 pnpm --filter @objectstack/spec run check:strictness-ledger
0 pnpm --filter @objectstack/spec run check:variant-docs
0 pnpm --filter @objectstack/spec run check:yaml-examples
0 pnpm check:changeset-gate-self-tests
0 pnpm check:ci-filter-parity
0 pnpm check:closed-ceremony-text
0 pnpm check:corpus-claim-drift
0 pnpm check:cross-package-test-inputs
0 pnpm check:dispatcher-error-vocabulary
0 pnpm check:doc-anchors
0 pnpm check:doc-authoring
0 pnpm check:doc-frontmatter
0 pnpm check:docs-audit-scope
0 pnpm check:docs-redirects
0 pnpm check:docs-single-h1
0 pnpm check:docs-spec-enumerations
0 pnpm check:docs-transcript-drift
0 pnpm check:driver-memory-census
0 pnpm check:dts-closure
0 pnpm check:dual-build-cjs-loads
0 pnpm check:engine-double-contract
0 pnpm check:gitlink-declared
0 pnpm check:i18n
0 pnpm check:i18n-stale-fill
0 pnpm check:issue-citations
0 pnpm check:keyed-text-bounds
0 pnpm check:lean-entry-closure
0 pnpm check:logger-receiver-detach
0 pnpm check:merge-driver
0 pnpm check:nul-bytes
0 pnpm check:objectql-double-limit
0 pnpm check:org-identifier
0 pnpm check:page-declaration-shape
0 pnpm check:platform-object-tenancy-census
0 pnpm check:published-files
0 pnpm check:published-readme-links
0 pnpm check:query-options-erasure
0 pnpm check:react-page-adapter-contract
0 pnpm check:refd-timer-probe
0 pnpm check:registry-log-declared
0 pnpm check:rest-log-spy-declared
0 pnpm check:role-word
0 pnpm check:skill-identifier-liveness
0 pnpm check:slot-lookup
0 pnpm check:sourcemap-no-sources-content
0 pnpm check:system-context-census
0 pnpm check:test-source-alias
0 pnpm check:tier-file-adoption
0 pnpm check:type-check-coverage
0 pnpm check:type-check-debt
0 pnpm check:undeclared-dep-imports
0 pnpm check:vendor-version-stamps
0 pnpm check:watch-hint-literal
0 pnpm check:where-matcher

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg

…its pins, not yet registered

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
…in it at the grant table's HTTP write doors

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
…an agent ceiling set at every write door

Pin each grant-table write door in its own answer shape: createMany and
the cross-object batch answer the whole 400 VALIDATION_FAILED envelope
with invalid_value at permission_set; updateMany and the per-object
batch fail the row in their per-row report with the same code and
status. Add the changeset (Clause-②: no (narrowing), Metadata-protocol:
none).

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/plugin-auth, @objectstack/plugin-security, touching 23 documentable anchor(s).

36 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 14c67d446e577926460f3ed893e44cc32cbecb12.

⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 63 of 221 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 29 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 14c67d446e577926460f3ed893e44cc32cbecb12 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from ca97d8c8e18c197f5e3808c03473710c0c035ce2 — the merge of head e1305f7524b9172978bdc542dfc538bf153ee479 into base 14c67d446e577926460f3ed893e44cc32cbecb12, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ca97d8c8e18c197f5e3808c03473710c0c035ce2 && git checkout ca97d8c8e18c197f5e3808c03473710c0c035ce2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 14c67d446e577926460f3ed893e44cc32cbecb12 e1305f7524b9172978bdc542dfc538bf153ee479 && git checkout -B drift-repro 14c67d446e577926460f3ed893e44cc32cbecb12 && git merge --no-ff e1305f7524b9172978bdc542dfc538bf153ee479

node scripts/docs-audit/affected-docs.mjs --json 14c67d446e577926460f3ed893e44cc32cbecb12

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 14c67d446e577926460f3ed893e44cc32cbecb12 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…m-context skips

Row 23f: a system writer of sys_user_permission_set is not judged by the
agent ceiling grant check; a non-system write that would store an
assignment naming an MCP agent ceiling set is refused for every caller.
The site register is regenerated with
`node scripts/check-system-context-census.mjs --write`.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d85dbe45f9f23db6758ffbb86fc1b031939f2724
Local-runs: none
Scope: packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts, packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.test.ts, packages/plugins/plugin-security/src/security-plugin-start-hooks.ts, packages/qa/dogfood/test/grant-table-write-contract.dogfood.test.ts + packages/plugins/plugin-security/src/grant-permission-set-name.ts, packages/plugins/plugin-security/src/grant-holder-membership-refusal.ts, packages/plugins/plugin-security/src/delegated-admin-gate.ts, packages/plugins/plugin-security/src/security-plugin.ts (destroy), packages/plugins/plugin-security/src/security-plugin-permission-sets.ts, packages/plugins/plugin-security/src/bootstrap-platform-admin.ts, packages/plugins/plugin-security/src/auto-org-admin-grant.ts, packages/plugins/plugin-security/src/flow-system-identity-write-refusal.ts, packages/objectql/src/engine.ts (insert and update hook dispatch), packages/objectql/src/engine-hook-dispatch.ts, packages/objectql/src/engine-insert.ts, packages/objectql/src/registry.ts (getItem), packages/core/src/security/assemble-execution-context.ts, packages/core/src/security/resolve-authz-context.ts, packages/core/src/security/security-catalog.ts, packages/spec/src/ai/mcp.zod.ts, packages/spec/src/identity/position.zod.ts, packages/spec/src/identity/identity-assignment-body-writes.ts, packages/rest/src/batch-routes.ts, packages/rest/src/data-action-routes.ts, packages/plugins/plugin-auth/src/admin-user-endpoints.ts, packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts, packages/plugins/plugin-auth/src/audience-posture.ts, packages/plugins/plugin-auth/src/demo-staff.ts, docs/adr/0090-permission-model-v2-concept-convergence.md (D10, D12 note). Prose faces (.changeset/sec-hardening-r6-agent-ceiling-grant.md, content/docs/permissions/system-context.mdx) are the lane seat's ACCEPT at TIER_DEFAULT; row 23f was read sentence by sentence here because the module header carries the same sentences.

Face: the paths decide no face (no published schema, no governed path); the committed changeset's line-initial Clause-②: no (narrowing) is the closed-pair spelling AGENTS.md step 3 names, so the face is narrowing and the tier is CONTRACT_REVIEW_TIER with ④. Rule under review: a person-to-permission-set assignment (sys_user_permission_set) refuses an MCP agent ceiling set at every write door, for every non-system writer. Full review (no prior at-tier record on any head; no Contract-review-claim: or hold on the PR).

① Derived judgments

  1. Accept set narrowed, correctly stated. A non-system insert or update of sys_user_permission_set whose resulting row's permission_set is one of MCP_AGENT_PERMISSION_SETS (imported from @objectstack/spec/ai, never retyped) is refused. Insert judges the row as sent through the shared by-name reader grantSetNameOf (exact, trimmed); update judges the payload's permission_set when the key is present, else the stored row's. Held: agent-ceiling-grant-refusal.ts lines 141-160. Correct.
  2. Write doors into the table, enumerated independently. The engine has three row-writing verbs (insert, update, delete; no upsert, restore or replace verb) and every direct driver.* write inside them runs after the before-hook chain (engine.ts insert: per-row beforeInsert precedes driver.bulkCreate / driver.create; update by id binds hookContext.previous at line 8669 before driver.update; predicate update dispatches beforeUpdate once per matched row with previous through dispatchPerRowBeforeHooks; the ADR-0142 precondition path updateByIdExpecting is reached from update() after its hooks). HTTP doors all reach those two verbs: POST /data/:object, PATCH /data/:object/:id, createMany, updateMany, POST /data/:object/batch, POST /batch, POST /data/:object/import, POST /data/:object/import/jobs, POST /data/:object/:id/clone (engine insert) and POST /data/import/jobs/:id/undo (updateData under the caller's own context). Eight are pinned at HTTP in the dogfood block; clone and undo ride the same engine verbs and are covered by construction. The admin create-user grant (admin-user-endpoints.ts line 884) inserts under the calling administrator's context, so it is judged. Flow run-as-system and hook-action-body writes to both assignment tables are refused upstream (flow-system-identity-write-refusal.ts, IDENTITY_ASSIGNMENT_WRITE_OBJECTS), so no non-system caller reaches a system write of this table through automation. Covered: every non-system door. Not judged, by the rule's own terms: delete, and every isSystem write. Correct for the rule as stated.
  3. isSystem stand-down. The stand-down takes the shape of the siblings on this table (23c catalog name, 23d holder membership) and of the security middleware; its shape and priority are right. The module header's stand-down paragraph (lines 46-50) and row 23f's Get cell justify it with a property of the named system writers ("none of which names one") that the PR holds by construction for some of them but neither pins nor backs with a refusal for all of them. A claim is kept as narrow as its enforcement (AGENTS.md Prime Directive 10). must-fix, see ④. Detail is in the reviewer's local note, not here.
  4. Delete not judged. Removal stays open to whoever the delegated-administration gate lets remove; pinned (unit "renamed to a person set, and can be deleted"). Correct.
  5. Envelope. validationFailure(message, [entry]) from @objectstack/types, the constructor both HTTP doors map to 400 VALIDATION_FAILED; one fields[] entry field: 'permission_set', code: 'invalid_value' typed to the closed FieldErrorCode catalog (ADR-0114; reference_not_found is the catalog sibling's member, the set exists here), value, label, a constraint. No new code (ADR-0112). Every refusal pin asserts status, code and fields[0] (field, code, value) through resolveThrownHttpError in the unit file and off the wire in the dogfood block; the two per-row-report doors assert code and httpStatus of the failed row; the two import doors assert code and field of the row report. Correct.
  6. Update keep-in-force semantic. Judging the resulting row (payload set when present, stored set otherwise) is the right predicate: a new holder, a validity window or an echo on a stored ceiling assignment is refused; a rename away to a person set lands; a rename to a ceiling is refused by id and by predicate. Pinned per patch and by predicate. Correct, and stricter than the catalog sibling's echo rule for a reason the header states.
  7. Agent principal still gets its ceiling. assemble-execution-context.ts lines 320-343 replace a user's resolved permissions with agent.scopePermissions for an OAuth client principal, and security-plugin-permission-sets.ts line 165 floors an agent at mcp_agent_restricted with no additive baseline; no assignment row is read for either. Pinned (unit "an agent principal holds its ceiling from its own context"). Unchanged by the diff. Correct.
  8. Hook ordering and registration. Priority 35 sits between the catalog refusal (30, so an unknown name answers reference_not_found first) and the holder-membership refusal (40). The catalog lookup is an exact-name map (registry.ts getItem, collection.get(name)), so a case variant of a ceiling name never resolves to a set and is refused by the sibling, which is why the exact-match predicate is sufficient. Registration is idempotent through unregisterHooksByPackage before re-binding, warns and returns false on an engine with no hook registry; registerStartHooks calls it after the middleware, so the delegated-administration gate still refuses an organization administrator the same three sets on the boundary first (delegated-admin-gate.ts ORGANIZATION_BOUNDARY_DENYLIST). Correct. SecurityPlugin.destroy() unbinds only the catalog-name hooks (as it already did for the holder-membership sibling); a nit, not a finding.
  9. Tests are rule tests. Unit: real ObjectQL over driver-sql on in-memory SQLite with the real SecurityPlugin started on it; 14 cases, every refusal identified by envelope and every store read back. Dogfood: a second top-level describe in the table's shared harness file (ruling 6583487846 shape), 8 cases on the booted showcase over HTTP, beforeAll asserting the catalog serves all three sets so the catalog sibling cannot answer first. Ablation in the body: guard replaced by a no-op through scripts/ablation-replace.mjs, unit 7 failed / 7 passed with the red set being exactly the refusal pins; dogfood rebuilt and preflighted with scripts/ablation-dist-preflight.mjs, 5 failed / 3 passed, each door pin after the first also red alone; restored and green. Read-only here (Local-runs: none); the reading is the dev's, named to head 1b9179369a for the ablation and d85dbe45f9 for the reruns, and the code under test is identical between the two (the later commits are a merge of main and the docs row).
  10. Public surface. No new symbol reaches the package entry (body: 0 hits on dist/index.d.ts and dist/index.d.mts for the five names, positive control SecurityPlugin 24 each); check:api-surface is spec-only, so this is the right reading for a plugin. No widening; no (narrowing) is the correct arm.

② Semver level

Changeset .changeset/sec-hardening-r6-agent-ceiling-grant.md: @objectstack/plugin-security: patch, title with !, a BREAKING banner, line-initial Clause-②: no (narrowing) and Metadata-protocol: none, one ADR-0087 marker (not-required (no-migration-prescription)), and the operator's fix (list query, delete or rename). AGENTS.md step 3: a non-protocol narrowing ships patch and keeps its BREAKING banner and disposition; check-changeset-no-major reads this exact pair as none-clean. The PR body carries the same two declaration lines at line start. Touched packages: @objectstack/plugin-security (published, changeset present), @objectstack/dogfood (private: true, none owed); content/docs is not a package. Consistent.

③ Boundary flags

  • Author: objectstack-fleet[bot] (relay); no other login to name. PR is draft, base main, head repo equals base repo, auto_merge null (nothing to disarm on this FAIL), no governed path in the file list.
  • Closing keywords: none in the body, correct for a security-seat PR with no card; the body's [#26571] sits only in the dogfood file's pre-existing header.
  • Acceptance notes, each answered: (1) the per-row report doors (updateMany, per-object batch) carry code and httpStatus without fields[] — their existing report shape for every validation refusal, pinned as it stands, accepted; (2) stored assignments are not migrated — the changeset names the list query and both remedies, and the ADR-0087 marker is consistent with nothing authored changing, accepted; (3) no (narrowing) is the AGENTS.md closed-pair spelling and is what puts this PR on the narrowing face, accepted.
  • Skills-docs: none is present and its reasoning holds: skills/objectstack-data/rules/security.md "Assigning a permission set to a user" names the two existing value refusals and the authority rule, and no sentence there turns false. Should (not blocking): the section now lacks the third value refusal; a one-line follow-up docs card (skills/** is Tier H) would keep the skill complete.
  • ADR-0090: the D12 note's own sentence "an agent ceiling is not a person's set" is what the diff implements for every writer; the same note's "assigns any set to anyone" for the tenant-level administrator now reads as any person's set. Should (not blocking, docs-only, Tier H): an amendment status line on ADR-0090 recording that reading.
  • Test-budget: the touched dogfood file declares no test-budget: line and none is owed unless the timing window reads it above 10 s; it now boots the showcase twice (one per top-level block, a shape two other files already take). Question for the lane: if the window lists it, none of the three budget classes fits, so the remedy would be one shared boot, not a budget line.
  • Dogfood battery: the body pins the full battery to d85dbe45f9 (420 files, 3501 tests, no shard) and the earlier timeout to an unrelated file rerun green; the head's check-runs carry Dogfood Regression Gate success as well.
  • CI at head d85dbe45f9: 54 check-runs, 40 success, 14 skipped (UI matrix and opt-in lanes), 0 failed, 0 in progress; all ten required contexts present with success (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI); the late Check Changeset rerun (job 127443493276) concluded success.
  • Row 23f, sentence by sentence against the code: "a system writer is not judged" — held (ctx.session.isSystem === true returns on both hooks); "seed replay and the platform's own grant writers (the platform-admin promotion, the organization-admin reconcile, self-registration)" — those writers exist and write as the system; "none of which names one" — not backed for every named writer (see ① item 3 and ④); "nothing an agent relies on: an agent principal receives its ceiling from its consented scopes, never from a row" — held; "a non-system insert, or a non-system update whose resulting row names one, is refused 400 VALIDATION_FAILED / invalid_value at permission_set, for every caller, a platform administrator included" — held and pinned; "a delete is not judged" — held. The generated register rows name #onInsert and #onUpdate and check:system-context-census is green at head.

④ Design judgment

On the narrowing face, the narrowing is judged against the published spec on main. packages/spec/src/ai/mcp.zod.ts declares the three sets as the agent's scope-derived ceiling ("pure capability ceilings"; scopesToAgentPermissionSets is the only producer), ADR-0090 D10 fixes that an agent principal's permissions are that ceiling (held in assemble-execution-context.ts, which replaces the user's resolved sets for an agent), and the D12 note states that an agent ceiling is not a person's set and already denylists the three for organization-level administrators (delegated-admin-gate.ts). The diff therefore takes no declared capability away at any consumer — the agent's ceiling path is untouched and pinned, removal stays open, every other set stays assignable — and makes the spec's own declaration real at the one table that could place a ceiling on a person. The envelope reuses the existing constructor and an ADR-0114 member; the hook shape, priority and idempotent binding match the two siblings on the same table; judging the resulting row on update is the right predicate for an assignment that must not be kept in force, and the engine binds previous on both update legs so the predicate is decidable per row. The design holds.

One must-fix, in the file under review:

  • must-fix — packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts lines 46-50 (the stand-down paragraph) and its prose twin, content/docs/permissions/system-context.mdx row 23f Get cell: the sentence "none of which names an agent ceiling set" is asserted of every named system writer and is not backed for each of them. Keep the claim as narrow as the enforcement (Prime Directive 10): either back the sentence for each named writer with a pin (and a refusal where the property is not fixed by construction), or restate the stand-down as the siblings 23c and 23d state theirs, with the Lose cell saying what the trust costs, and drop the clause from both places. Which remedy, and where it lands, is the seat's call under security-findings section 9.

Not blocking, recorded for the seat and the lane: the shoulds and the question in ③; SecurityPlugin.destroy() not unbinding this package (precedent: the holder-membership sibling); the new module carries no scripts/adr-anchors/ entry (precedent: the catalog-name sibling has one, the holder-membership sibling does not). Other surfaces that distribute a permission set to a person were enumerated for the seat in the local note; they are outside this PR's stated rule and are not judged by this record.

Implemented-by: claude/sec-hardening-r6
Reviewed-by: session_01L6bhgVfjk2i8T2D4RmxsKg

VERDICT: FAIL

…ent ceiling set

A self-registrant is a person, and an agent ceiling is not a person's set
(ADR-0090 D10): the audience validation refuses `selfRegistrationPermissionSet`
naming one of the MCP agent ceiling sets, beside its refusal of
`admin_full_access`, at construction and through the auth settings. Pins:
each ceiling name refused under both self-registration postures and through
the settings channel; a person's set still declarable.

The agent ceiling grant refusal's stand-down note and row 23f of the
system-context page now state, writer by writer, what keeps a ceiling out of
a system write. The changeset adds `@objectstack/plugin-auth: patch`.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
… once

Both blocks share one file-level boot and sign up their own users, so the
file pays for a single showcase boot: measured 13.31 s and 13.52 s with two
boots, 9.00 s to 10.05 s over five runs with one, on a shared agent box.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVfjk2i8T2D4RmxsKg
@objectstack-fleet objectstack-fleet Bot changed the title fix(plugin-security)!: a person-to-permission-set assignment refuses an agent ceiling set at every write door fix(plugin-security, plugin-auth)!: a person-to-permission-set assignment refuses an agent ceiling set at every write door, and so does the self-registration permission set Nov 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: e1305f7524b9172978bdc542dfc538bf153ee479
Local-runs: none
Scope: packages/plugins/plugin-auth/src/audience-posture.ts, packages/plugins/plugin-auth/src/audience-posture.test.ts, packages/plugins/plugin-auth/src/audience-posture-setting.test.ts, packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts, packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.test.ts, packages/plugins/plugin-security/src/security-plugin-start-hooks.ts, packages/qa/dogfood/test/grant-table-write-contract.dogfood.test.ts + packages/plugins/plugin-auth/src/auth-manager.ts (constructor door, applyConfigPatch door, getAudience), packages/plugins/plugin-auth/src/auth-manager-membership-admission.ts (the self-registration grant writer and its set source), packages/plugins/plugin-auth/src/auth-plugin.ts (the settings patch), packages/plugins/plugin-auth/src/demo-staff.ts, packages/plugins/plugin-security/src/bootstrap-platform-admin.ts, packages/plugins/plugin-security/src/auto-org-admin-grant.ts, packages/spec/src/system/auth-config.zod.ts (AudienceConfigSchema), packages/spec/src/ai/mcp.zod.ts, .github/workflows/ci.yml (the ui paths filter). Prose faces (.changeset/sec-hardening-r6-agent-ceiling-grant.md, content/docs/permissions/system-context.mdx) are the lane seat's ACCEPT at TIER_DEFAULT; row 23f was read sentence by sentence here because the record of d85dbe45f9 made it the must-fix's prose twin.

This is a DELTA record by the same reviewer, on the commits that land the findings of the record on d85dbe45f9 (comment 6666128952): 64dc053c17 (merge of main, which brings nothing into the PR's own diff; the diff against main is the same files plus three in plugin-auth), 398fe7f1d6 (the plugin-auth refusal, the reworded stand-down, row 23f, the changeset) and e1305f7524 (the dogfood file on one boot). The plugin-security module's code is byte-for-byte what d85dbe45f9 carried; only its header comment moved, so items 1, 2 and 4 to 10 of ① on that record stand unchanged and are not re-argued here. The face is unchanged: no published schema and no governed path in the file list; the committed changeset's line-initial Clause-②: no (narrowing) decides the narrowing face, CONTRACT_REVIEW_TIER with ④.

① Derived judgments

  1. The must-fix of d85dbe45f9 (① item 3 and ④ there): RESOLVED, by backing the claim. The seat chose the first remedy. assertAudienceConfig (packages/plugins/plugin-auth/src/audience-posture.ts lines 315-323) now refuses a selfRegistrationPermissionSet in MCP_AGENT_PERMISSION_SETS (imported from @objectstack/spec/ai, never retyped), beside its admin_full_access refusal and through the same fail(), so the envelope is the one that refusal answers: an Error whose message is [audience] invalid audience configuration: selfRegistrationPermissionSet must not be '...' followed by the reason and the remedy ("Declare a permission set meant for people"). Both config doors call that validator on the whole declaration: the constructor (auth-manager.ts line 1654, so a stack config naming one stops the boot) and applyConfigPatch on the MERGED next (line 2132, so a settings patch that names one, alone or with its posture, is refused and the standing audience keeps ruling; auth-plugin.ts logs it at error with the validator's sentence). Under invite_only the key itself is refused as inert (lines 343-348), so no value is stored there either. The self-registration grant writer reads only the standing audience (auth-manager-membership-admission.ts line 201 reads audience.selfRegistrationPermissionSet off getAudience(), which resolves this.config.audience, written only through those two doors), so "writes only the validated set" is held by construction. The narrowed stand-down paragraph (agent-ceiling-grant-refusal.ts lines 46-56) now says, writer by writer, what holds: fixed names in code for the promotion and the reconcile (held: bootstrap-platform-admin.ts writes admin_full_access; auto-org-admin-grant.ts writes an organization-admin set), the validated set for self-registration (held, above), and seeds "write the sets their stack declares, and nothing judges those against this rule" (held: demo-staff.ts lines 368-375 and seed replay write as the system; this is the deployment's own declaration, stated as unjudged rather than claimed safe). The claim is now exactly as wide as the enforcement.
  2. Row 23f at e1305f7524, sentence by sentence. "a system writer is not judged" — held. "The platform-admin promotion and the organization-admin reconcile name their sets in code, and neither is a ceiling" — held. "the self-registration grant writes the configured audience.selfRegistrationPermissionSet, which the audience validation (assertAudienceConfig, plugin-auth) refuses when it names an agent ceiling set" — held and pinned. "Lose: seed replay and the development-only demo-staff seed write the sets their stack declares, unjudged, so a seed that names an agent ceiling set stores it" — held; it is the register's purpose to say what the skip costs, and this cell now does. "A non-system insert, or a non-system update whose resulting row names one, is refused 400 VALIDATION_FAILED / invalid_value at permission_set, for every caller, a platform administrator included; a delete is not judged (ADR-0090 D10)" — held and pinned, unchanged. The register rows for #onInsert / #onUpdate stand and check:system-context-census is green at head.
  3. The new pins are rule tests. audience-posture.test.ts: it.each(MCP_AGENT_PERMISSION_SETS) under both self-registration postures, the throw matched by a regex anchored on the exact prefix [audience] invalid audience configuration: selfRegistrationPermissionSet must not be '...' — it is the permission ceiling of an AI assistant connected over MCP (the dots standing for the refused name), so a different refusal firing first cannot green it; control: member_default and portal_user stay declarable. audience-posture-setting.test.ts: the settings channel with audience_posture: open and the write ceiling as audience_self_registration_permission_set; asserts the standing invite_only keeps ruling, that the error log carries the REFUSED banner and the validator's own sentence naming the value. Ablation in the body: the new condition replaced by false through scripts/ablation-replace.mjs on 398fe7f1d6, 4 failed / 75 passed across the two files (the three names and the settings pin red; the person-set control and the admin_full_access pin green); restored, the file's blob equals the committed one (3f5e4819f7, which is the blob at e1305f7524 as well; the one commit after 398fe7f1d6 changes only the dogfood file, confirmed by git diff --stat). Read-only here; the reading is the dev's, named to its commit.
  4. The dogfood file on one boot (the ③ question of the prior record): RESOLVED. One file-level beforeAll boots the showcase and signs in; each top-level block signs up its own users in its own beforeAll; one afterAll stops the stack. The eight pins are the same assertions as before (three existing, five new), the second block still asserts the catalog serves all three sets before any door is tried, and every refusal still asserts [status, code] and fields[0] off the wire, the per-row doors code and httpStatus, the import doors code and field, with the store read back. The guard ablation (5 failed / 3 passed through the built bundle, each door pin red alone) was taken on the two-boot file; the restructure moves fixtures only, so that reading carries. Timing in the body: 13.3 s and 13.5 s with two boots, 10.05 / 9.64 / 9.78 / 9.21 / 9.00 s with one, on a shared box. No test-budget: line, correctly: none of the three budget classes fits this file, so a CI reading over the 10 s line is the lane's card to split, as the acceptance note says, never a budget to declare.
  5. The spec-layer parity question (AudienceConfigSchema, packages/spec/src/system/auth-config.zod.ts): not a must-fix for this PR; a follow-up on the schema face. The schema's superRefine carries the posture rules and the admin_full_access refusal; the PR leaves it untouched and says so in the body and in the validator's own header ("refuses one value the schema does not"). What the PR's rule needs is held: every path to the system write passes the runtime validator at one of its two doors, and a declaration the schema admits is refused loudly at the next door with the remedy in the message, so no sentence the schema ships turns false (its describe says admin_full_access is refused, which stays true; it does not claim to list every refusal). Mirroring the three names in the schema's superRefine is the right follow-up, and it is its own change: it moves a published schema (schema face, CONTRACT_REVIEW_TIER), regenerates check:docs, and declares Metadata-protocol: narrowed on @objectstack/spec at minor. It is an ordinary card, not a security item: the runtime refuses at both doors.

② Semver level

Changeset at head: @objectstack/plugin-security: patch and @objectstack/plugin-auth: patch, the ! title naming both packages, a BREAKING banner that now also names an audience declaring one of the sets, line-initial Clause-②: no (narrowing) (extended to the audience refusal) and Metadata-protocol: none, one ADR-0087 marker extended for the audience case, and the operator's fix for both (the list query and the two remedies for a stored assignment; a person's set for the audience). Metadata-protocol: none is right for this diff: no spec schema moves, so the metadata-protocol baseline does not move; the follow-up in ① item 5 is where narrowed belongs. Touched published packages: @objectstack/plugin-security and @objectstack/plugin-auth, both in the changeset; @objectstack/dogfood is private; content/docs is not a package. check-changeset-no-major reads the pair as none-clean (patch, BREAKING carriers kept); Check Changeset is green at head. Consistent.

③ Boundary flags

  • Author objectstack-fleet[bot]; draft; base main; head repo equals base repo; auto_merge null; no governed path in the file list (.changeset, content/docs, packages/**). No closing keywords in the body (a security-seat PR with no card). No Contract-review-claim:, hold or handoff line on the PR for e1305f7524, and no comment after the record on d85dbe45f9; posting this record is the seat's act.
  • Prior record's items, each disposed: ① item 3 must-fix — resolved (① item 1 here). ③ question on two boots — resolved (① item 4). ③ should on Skills-docs — the line now reads none with a reason; checked: skills/** carries no mention of selfRegistrationPermissionSet, the audience posture or a self-registrant, and skills/objectstack-data/rules/security.md teaches the assignment door without listing which sets it takes, so "teaches neither the assignment door's sets nor the self-registration set" holds and the line is present and truthful under review-checklist; the spec describe it cites stays true (it names one refusal and does not claim the whole list). The should stands as a should: a one-line follow-up to the skill's refusal list (skills/** is Tier H, a docs card). ③ should on an ADR-0090 amendment line — unchanged, a docs-only Tier H follow-up. Nits (SecurityPlugin.destroy() not unbinding the new package; no scripts/adr-anchors/ entry for the new module) — unchanged, nits.
  • Acceptance notes at head, each answered: per-row report doors without fields[] — accepted as before; one boot at the 10 s line with no budget header — accepted (① item 4); stored assignments not migrated — accepted as before; no (narrowing) — accepted as before.
  • Dogfood battery pinned to e1305f7524 in the body (420 files, 3505 tests, no shard); package suites for plugin-auth (4018) and plugin-security (5407) and typecheck for the three packages at e1305f7524; derived gates 93 derived / 93 run / 0 not measured at e1305f7524. The dev's readings, named to head.
  • CI at head e1305f7524: 54 check-runs, 40 success, 14 skipped, 0 failed, 0 in progress; Check Changeset, Test Core, Dogfood Regression Gate success. Of the ten required contexts, seven conclude success (Lint & Repo Gates, TypeScript Type Check, Test Core, Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI) and three conclude skipped (Lint UI, Type Check UI, Build & E2E UI) by the filter job's ui/** paths filter (ci.yml lines 529-536), the designed outcome for a diff with no ui/ path, and the same three were skipped on d85dbe45f9. Correction to the record on d85dbe45f9: its CI line said all ten were present with success; the true reading on that head was seven success and these three skipped by design. No red on either head.

④ Design judgment

The design judgment of the record on d85dbe45f9 stands for the grant-table rule (the module's code is unchanged). The addition is judged on the narrowing face against the published spec on main: packages/spec/src/ai/mcp.zod.ts declares the three sets as an agent's scope-derived ceiling, and AudienceConfigSchema declares selfRegistrationPermissionSet as "the permission set granted to each self-registrant" — a person's set by its own description — and already refuses one set by name, so refusing the three ceilings at the same runtime validator takes no declared capability away at any consumer and makes the spec's own declaration real at the one configured writer the stand-down trusts. The refusal sits where the sibling refusal sits, speaks through the same constructor and sentence shape, holds at both doors the validator guards and leaves the standing configuration ruling on a refused patch; the stand-down paragraph and row 23f now state exactly what is held and what is trusted, with the trusted part in the Lose cell. The one asymmetry the diff leaves — the schema's refusal list one shorter than the runtime's — is disclosed in the code and the body and is a follow-up of its own (① item 5), not a defect of this rule. No must-fix.

Implemented-by: claude/sec-hardening-r6
Reviewed-by: session_01L6bhgVfjk2i8T2D4RmxsKg

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-sales · session_01L6bhgVfjk2i8T2D4RmxsKg

维护者速读

  • 改了什么: 给“人”分配权限集时,不能再分配 MCP 智能体的上限权限集(三个 mcp_agent_* 集),所有写入口一律拒收(400 VALIDATION_FAILED),平台管理员也不例外;自注册默认权限集的配置同样拒收这三个集。删除不受限。
  • 为什么改: 这三个集是智能体按授权范围拿到的上限,不是人的权限集;智能体的上限来自其授权范围,从不读分配行。
  • 风险与回滚: 已存在的此类分配行不迁移,改不动但可删除;changeset 给出查询与两种清理办法(BREAKING)。回滚即撤本 PR。
  • 先看: packages/plugins/plugin-security/src/agent-ceiling-grant-refusal.ts,再看 packages/plugins/plugin-auth/src/audience-posture.ts 的新拒收。
  • 两分钟验证: pnpm --filter @objectstack/dogfood exec vitest run test/grant-table-write-contract.dogfood.test.ts,预期 8/8。
  • 需要您做的: 无,席位经合并队列落地(非受管面,765 行)。另有两项记在安全席待决清单上:spec 层的自注册配置 schema 尚未同步这条拒收(启动时会被拒,不是绕过),以及 ADR-0090 D12 可补一句修订(Tier H)。
  • 席位意见: ACCEPT。完整达档复审 FAIL(6666128952),补丁轮已改;同一复审者增量复审 PASS(6669372947)。

席位核对 — ACCEPT · security#1 · head e1305f7524b9172978bdc542dfc538bf153ee479

  • 形态: draft, author objectstack-fleet[bot], no assignee, no review request, no closing keyword (no-card security order); 9 files, +752 −13; check-governed-merges --pr 30578 on the final file list: NOT governed; mergeable clean.
  • 契约复审: CONTRACT_REVIEW_TIER, narrowing face. Full review FAIL 6666128952 on d85dbe45 (must-fix: the stand-down justification was wider than its enforcement). Delta PASS 6669372947 on e1305f75 by the same reviewer: the claim is now backed writer by writer, and the new configuration refusal is reviewed in full, with public text at rule level.
  • Declarations (seat read): Clause-②: no (narrowing) and Metadata-protocol: none in the body and the changeset; patch for plugin-security and plugin-auth (the published packages the diff moves; dogfood is private); ! title, BREAKING banner, one ADR-0087 marker; Skills-docs: none with its reason, which holds (the spec description stays true). Changeset sentences checked against the diff: the rule, delete not judged, the audience refusal, who moves, the list query and the two clean-ups.
  • Prose faces: row 23f of content/docs/permissions/system-context.mdx was read sentence by sentence against the code (Get: fixed-name writers by construction, and the self-registration set by the audience validation; Lose: seed replay and the development-only demo seed unjudged). check:system-context-census is green at head.
  • Dev readings (e1305f75): dispatch-gates 93 derived, 93 run, 0 NOT-MEASURED; plugin-auth 224 files / 4018 passed; plugin-security 246 / 5407; ablations red then restored blob-equal (plugin-security guard 7 red of 14 unit, 5 red of 8 dogfood; audience refusal 4 red of 79). dogfood_battery at this head, full: 420 files passed, 3505 tests passed, 0 failed.
  • 门禁 check-runs: 54 runs, 40 success, 14 skipped, 0 failed.
  • 范围外去向: the spec-layer schema parity and the ADR-0090 D12 amendment go on this seat's maintainer list; the reviewer's nits (destroy unbinding, adr-anchor entry) stay notes.
  • 落地条款: No closing keyword; on MERGED the seat closes the advisory through the relay and records it on seat post [PM seat] security@os-mickey — ⏳ vacant #29740. Ordinary queue landing by this seat: pr_ready + automerge_enable on this head.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 21:02
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 6dd2ca5 Nov 5, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/sec-hardening-r6 branch November 5, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant