Repository navigation
docs: a system-elevated hook or action body is refused identity-assignment writes - #26501
Merged
Merged
Conversation
…signment writes The hooks runAs table and the actions authorization section said elevation is full-access / bypasses every check. Writes to sys_user_position, sys_user_permission_set, sys_invitation and sys_member from app-authored system automation are refused at run time, and a sandboxed body naming one is refused at save. State the refusal and the remedy it names, and link system-context row 1b. Claude-Session: https://claude.ai/code/session_01ADHkmQoXzgoMtkwN9diP2g Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · devx seat 2 · 2026-10-27T05:47ZSeat
Landing: ready + auto-merge once CI on this head is green. The card closes on |
This was referenced Oct 27, 2026
9 tasks done
This was referenced Oct 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #26466
Clause-②: no
Metadata-protocol: none
Skills-docs: follow-up owed — skills/objectstack-automation/SKILL.md (the
runAs: 'system'guidance at L164-191 never says these four writes are refused; it also owes an eval prompt per the package's convention;domain:skills, Tier H, triage 6434140653)维护者速读
hooks.mdx的runAs: 'system'行和actions.mdx的「动作内授权」段,写明系统提权的钩子/动作对岗位持有、权限集授予、邀请、成员四个对象的写入会被拒,并给出拒绝信息里点名的补救办法,链到system-context.mdx的 1b 行;删掉「full-access」这种过宽的说法。content/docs/automation/hooks.mdx('system'表格行)、content/docs/ui/actions.mdx(Authorization inside an action 段首)。pnpm check:doc-anchors,预期 exit 0(两条新链接#1-authorization-and-scoping都能解析)。What changes
content/docs/automation/hooks.mdx, therunAstable's'system'row: drops "full-access" and adds one sentence. Elevation stops at identity assignment. An insert, update, delete, transfer, restore or purge ofsys_user_position,sys_user_permission_set,sys_invitationorsys_memberfrom an app-authored hook's system context (runAs: 'system', an inherited system context, orctx.api.sudo()) is refused withPERMISSION_DENIED. ArunAs: 'system'hook whoselanguage: 'js'body writes one of them by name is refused at save. The sentence gives the remedies the refusal names:runAs: 'user'for positions and permission sets, so the delegated-administration gate judges the user; the organization endpoints for invitations and memberships. It linkssystem-context.mdxrow 1b.content/docs/ui/actions.mdx, "Authorization inside an action": the same sentence for an action body and a registered handler. Atype: 'script'action whose body names such a write is refused at save. The assignment remedy is the one the action refusal names: a flow whoserunAsis'user', run by an action oftype: 'flow'. The next sentence now reads "The other consequence is…" so the caller-specific-rule guidance still follows.The pages describe the refusal and its remedy only. They name no way around it.
Why
Both pages told authors that system elevation bypasses every check. Since #25653 the data middleware refuses these four writes from app-authored system automation. Since #26430 (merged 2026-10-27T04:43Z)
HookSchemaandActionSchemaalso refuse a body that names one at save.system-context.mdxrow 1b already states the rule. These two pages contradicted it and left out the remedy.Tests
Docs only: no behaviour changed, so no test and no ablation.
Acceptance notes
Wording was read against
origin/main00a4593a:packages/plugins/plugin-security/src/flow-system-identity-write-refusal.ts(SUBJECT,ASSIGNMENT_PRESCRIPTION,MEMBERSHIP_PRESCRIPTION).packages/runtime/src/action-execution.ts#buildActionExecutionContextserves every handler an action door dispatches, a host code handler included. That is why the actions sentence says "either".packages/spec/src/identity/identity-assignment-body-writes.ts,hook.zod.ts#refuseElevatedIdentityAssignmentBodyWrite(onlyrunAs: 'system'+language: 'js') andaction.zod.ts#refuseIdentityAssignmentBodyWrite(onlytype: 'script'+language: 'js'). The pages claim save-time refusal only for those shapes.Not done here, by the claim:
skills/objectstack-automation/SKILL.md: see theSkills-docs:line.FlowSchemahas no save-time twin of the body check, and the four-object set and prescription text are duplicated between the spec leaf and plugin-security. Both are reported to the seat as out-of-scope findings and are not built here.Verification
Readings are at head
a5d2534c.Derived gate families
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 43 commands derived for the 2 changed paths (16 changed lines).check:skill-examplesexited 3 (PREREQUISITE NOT MET: the client-react dist was missing). Afterpnpm --filter '@objectstack/client-react...' buildunderos-verify-lock(VERDICT command-exit 0), it exited 0: "265 prose examples type-check across 3 surface(s)".dispatch-gates --ranwith every exit code recorded: "43 derived, 43 run, 0 NOT-MEASURED, 0 UNRUN" (a DERIVED zero).Card acceptance
pnpm check:doc-authoring: exit 0 (in the derived set).pnpm check:docs-audit-scopeandpnpm check:docs-transcript-drift: exit 0 (in the derived set).pnpm check:doc-anchors: exit 0. Negative control: after theactions.mdxlink fragment was changed to#1-authorization-and-scopingX, it exited 1 and namedcontent/docs/ui/actions.mdx:455("renders no heading with id"). The file was restored withgit checkout HEAD --, andgit diff HEADis empty. The lychee lane (check-links.yml) is CI's run.Human Minimum
packages/specholds no runtime logic. (No schema touched.)pnpm lintpasses. (No code touched; the repo-wide run is CI's.)main, one pull request.skip-changeset.)packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmQoXzgoMtkwN9diP2g
Generated by Claude Code