Repository navigation
docs: write down trust boundaries, security review scope, and startup-path gates - #4679
Conversation
Each removed line is already owned elsewhere: the AGENTS.md task router, another agent doc, code comments, type declarations, tests, or CONTRIBUTING.md. This makes room for security guidance within the agent-docs byte budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gger Write down who is trusted for which filesystem decision, the rules for a file written at a path another party chooses, and the destination classes. Add a design-review trigger and a scope rule to the review guide, and the startup-path and wire checks to the gates guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Group the walk into labeled rules, move the path-shape examples into one case table with owning tests, and list the rejected alternatives. Record that the local file is exactly 0600 while the remote client requests 0600 under the umask, and that resolveUserPath folds relative and ~/ spellings before the walk. Point #4649 and #4620 at their issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Split security.md into what ADR 0016 implements today and the rules for new or migrated write sites, with destination classes marked as the #4669 proposal. Add publication-ID binding, privileged-writer authority, link ownership in sticky directories, and the before-commit limit on keeping the previous file. Restore the npm onboarding rule for every new public package, the node_modules and regression-proof routes in test-experiments, snapshot cache and Apple runner routing, the selector guide's scope and key ownership, the ts-expect-error retention rule, and the audit route to authoring criteria. Give the gates commands their context. Tighten wording across agent docs to stay within the byte budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
State that the sticky exception lets others add names, that the remote mode is subject to the umask, when the local file reaches exact 0600, and what a refusal after creation can leave. Rewrite the case table from the tests as they are, describe remote coverage by what it asserts, and narrow the ACL and mount limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Restore every agent doc that the wording pass changed to its text on main, keeping only the pure duplicate deletions. Pay for the restored text by shrinking security.md, the review trigger, and the gates note. State that the current walk judges against the writing process's uid, and keep caller-scoped authorization for new write sites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Name the subdirectory a walk may create in a sticky directory, the requested 0600 on the remote and generic routes, and the conditions under which remote confirmation notices a mount. Reduce the case table to the accepted and refused invariants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Say where a new write site stages, when to verify a descriptor, and when to overwrite. Restore the isolated-experiments route in the gates guide and the command-family metadata rule in the CLI flag guide. Shorten the security guide to stay within the agent-docs budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing private subdirectory under a trusted sticky directory is created; a script entry directly in a shared parent is refused. Mark the world-writable cases as non-sticky and list both effects of the accepted sticky case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lure rules Commit inside the judged parent, not only stage there. Apply the caller's uid only when an elevated process writes for a caller, and state that authentication grants no filesystem authority. Separate a first-publication replace, which needs --force, from later revisions, and keep the action result on any delivery failure. Reduce the gates note to one pointer sentence to make room. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refuse a direct entry only in a shared sticky parent, and qualify the world_writable rows by mode and by this user's or root's ownership. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ADR 0027 and the wire ledger README now carry the commands that the gates guide points to. The security guide states first publication in terms of the caller's overwrite grant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ownership is checked before the sticky bit, then world and group write. Name the owner conditions for shared_parent and planted_link, and the reason each appeared-level shape returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
|
This review covers 99f4f28; 2630f13 landed while it ran and gets its own delta review. I found one problem to fix in 99f4f28: the new write rules in
Would a smaller change do the same job? The corrected ADR 0016 section traces to code and fixes real inaccuracies, so I would keep it. The trust-boundary summary could be a short section at the top of ADR 0016, or one bullet in Not blocking, take or leave: the ADR 0016 case-table row for a remote destination replaced during download gives The validation claims (check:agent-guidance, check:adr-citations, check:doc-prose and the rest) come from the PR body. A sentence-by-sentence comparison of all 13 files with the base, which |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…docs Split security.md into what applies today and the rules proposed in #4669, keep only rules with a source, and name the write sites that do not follow them yet. The elevated-writer, descriptor, and path-dialect rules move to #4669 for approval. Restore every unrelated agent doc to its text on main except the minimum duplicate deletions the byte budget needs, and point the gates guide to ADR 0027 and the wire README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A refusal from the confirming walk is script_ancestor_untrusted, and a changed dev:ino alone is script_ancestry_replaced. Describe the group-write case by its mode bits and keep the subsection below main's size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Capture delivery can still take a path from the daemon response, which is open in #4518. Attribute staging and byte caps to ADR 0016 as migration candidates, and scope name validation to peer-named entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The client's staging directory is requested at 0700 and the umask can narrow it. Describe the refused home as one configured as 0775. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base comparison against origin/main
code-ownership.md, device-foldable.md, device-verification.md, pull-requests.md, test-experiments.md, testing.md and triage-labels.md have no diff against origin/main. Host checks on macOS: a |
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
docs/agents/security.md:15 |
🆕 security.md routes unapproved #4669 rules as if binding, contradicting AGENTS.md approval rule |
Reviewed with this repository's own Sentinel configuration (1c6e81cba89b).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 5968f41. The verdict and the full list are in the summary comment.
|
This PR is ready at 5968f41. I read the docs against the code and found nothing that needs a change, and there are no conflicts. CI is still running: all nine jobs are in progress and none has failed, and the diff is markdown only, so Repo Guards & Compatibility is the one job that could fail, through a byte budget or prose rule (AGENTS.md has 1 byte of headroom, docs/agents has 5). Not blocking, and you can take or leave these: the sentence at https://github.com/callstack/agent-device/blob/5968f41/docs/agents/security.md#L19 about ADR 0016's staging and byte-cap rules sits under "Proposed in #4669", but the #4669 body does not name them, so it could say that the #4669 comment proposes them, or be dropped; in https://github.com/callstack/agent-device/blob/5968f41/docs/agents/web-backend.md#L13 "A shell would reintroduce hazards from argument quoting" now has no antecedent, and adding "because the shim needs a shell on Windows" would fix that if the byte budget allows; and the PR body says AGENTS.md was tightened in "six places" while the diff edits eleven sentences. The check results and the macOS and Linux permission statements come from the PR and the posted base comparison. Nothing else from this review stands in the way of merging. |
Summary
#4584 took many review rounds because three things were not written down: who is trusted for which filesystem decision, where a security PR's scope ends, and which gates fire on import shape. This PR writes them down. It is docs only and touches 13 files.
docs/agents/security.md, routed from AGENTS.md. It states trust boundaries (script publication takes no path from the daemon; capture delivery still can, open in Verify and enforce client-owned destinations for remote capture stop and report #4518), what applies today (ADR 0016 judges caller-named script destinations on POSIX against the writing process's uid; both script publishers stage and commit inside the judged directory; remote script delivery caps bytes), and the rules proposed in Private writes for credentials and client state #4669, which apply once approved: the ADR 0016 walk for caller output and name validation for peer-named entries, with ADR 0016 staging and byte caps as migration candidates. It names the write sites that do not follow them yet.review.md: a design-review trigger for a new trust boundary, plus a scope rule.gates.md: one pointer sentence to ADR 0027 andtest/wire-compat/README.md, which now carry the commands.Why a separate guide, not a section in ADR 0016: ADR 0016 decides script publication only. The guide routes any task that writes at a path another party chooses, including the sites #4669 still has to decide, so its home is the agent-doc router.
Removed agent-doc lines (the minimum the 40,000-byte budget needs) and where each rule still lives
Every other unrelated agent doc is identical to main.
projectConfig/recordedmeanings and requirementflag-types.tstypes and JSDoccommand-schema.tsandcommand-overrides.ts.cmdand CVE detail; Windows npm setup detailagent-browser-tool.tsandagent-browser-install.tscomments--state-dir, first-run flowAGENTS.md keeps every rule; its wording is tightened in six places to fit the new row.
ADR 0016 migration ledger
lstat, hop limitrealpathandstatare under Rejectedmkdirand refusing concurrent directories are under Rejecteddev:ino,openatopenatis under Rejectedatomic-file-ancestry.test.ts,atomic-file-parent.test.ts,atomic-file-decisions.test.ts, anddaemon-artifacts-script-ancestry.test.ts(#4671 trims the last)Validation
Head
8d14fe0196.pnpm check:agent-guidance(5 pass),pnpm check:adr-citations(2 pass), andpnpm check:doc-prose(clean) pass, andpnpm formatgives no diff. docs/agents is at 39,961 of 40,000 bytes and AGENTS.md at 3,999 of 4,000. The ADR 0016 subsection is 11,164 bytes from its heading to the next heading (11,214 on main). Runtime tests do not apply because no code changed. The base comparison and host checks are posted as a PR comment.🤖 Generated with Claude Code