Skip to content

feat(app-kit): let an app's manifest fence its own dirs from agent writes - #33589

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
feat/app-seam-agent-readonly-dirs
Nov 13, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
feat/app-seam-agent-readonly-dirs

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An app can list directories under its own data directory in its manifest that agents may read but never write, and Kiro Crew fences them from agent writes in every sandbox mode while the app's own backend keeps writing them.

Today only core can make an app's directory read-only to agents, by naming it in its own tables: apps/meetings/data/notes is a core write-protected row, and Spec Builder keeps its decision record under the data home's trust/ (the SEL trust root) because nothing else fenced it. Core may not name an app, so neither protection can leave core with its app, and a third-party app has no way to stop a prompt-injected agent from rewriting state it must not forge.

Why it matters

Moving built-ins out (#26967) needs the protections they rely on to travel with them; dropping the rows would let any agent rewrite a user's meeting notes or forge and erase Spec Builder's recorded answers. The campaign driver approved this seam on 2026-11-09 under the maintainer's delegation (#26967 (comment), decision 3): generic, tightening only, the app's own data directory only, the same shape and limits as credentialMasks (#32652).

Not a goal

  • Moving Meetings' data/edits core leaf (a read+write HIDDEN leaf, credentialMasks-shaped) or the trust/ row itself, which stays for the SEL key.
  • Sealing installed app trees, or adding app-declared paths to the read+write floor, a mask or any keystone disposition.
  • Hard-link passes over files inside a declared directory: a declared directory gets the protection a core READONLY directory has, no more.
  • Other seams in the campaign.

What changed (motivation → approach → change)

An app declares "agentReadOnlyDirs": ["notes", "trust"], each entry a path relative to apps/<name>/data/. The declaration is read by the credentialMasks engine under its own key: apps/credential_masks.py gains a DeclarationKind that every function takes, defaulting to credentialMasks, so the two seams share one grammar, one name-from-location rule, one source list, one cache and the same retained-record logic (apps/.<name>-agent-readonly-dirs.json, refreshed by the same three lifecycle calls). Its record-name regex became a string check.

Two layers then fence each declared directory, at apps/<name>/data/<entry> and at the lifecycle's move-aside apps/.<name>-data-tmp/<entry>, under both data-home prefixes:

  • File tools: security.paths.sensitive_write_path_refusal matches the declared rows in their own _path_in_home_dirs call after the core write tier, so an agent's file-edit write under one is refused with the same anchoring, KIROCREW_HOME re-anchoring and symlink resolution as a _WRITE_PROTECTED_HOME_PATHS row. write_protected_home_paths() lists them too, so the posture page and Auto-Improvement's harness mask see what they saw for the old row. Reads stay open. security.paths_targets._app_readonly_dir_rows lists the declarations on the mc-pathres threads within the anchor rebuild's budget for every caller, one listing in flight at a time, reused for a second on the event loop; a miss refuses, and later checks refuse at once while it runs.
  • OS sandbox, every mode: sandbox_argv._live_plan_host adds every declared spelling to the crew-home READONLY targets and its parents to the seal parents, so it is a read-only bind on Linux and a file-write*/file-link deny on Seatbelt, with every parent guarded against rename on both. A declared spelling a mask covers stays masked. sandbox_aliases._establish_app_readonly_dirs refuses a spawn when a link sits at a declared directory or between the data home and it, and on Linux creates an absent one (only inside an existing data/, never data/ itself) and hands it to the launcher as a required target with its identity, so the seal is never empty.

The app's own spawned backend gets its exact spellings back through sandbox_tiers.app_declared_readonly_targets (passed as extra_visible_dirs by apps/backend.py, read from the manifest of the code it runs). That lift drops any leaf that is, holds or sits beneath a core leaf of any disposition, and any spelling under another mask or behind a planted link, so it lifts no core fence and cancels no mask.

Meetings declares notes and its core write row goes. Spec Builder declares trust and keeps its decision record at apps/spec-builder/data/trust/spec-builder-decisions.json; the first read that finds it absent moves the old record from the data home's trust/ (a regular file with one name only: copy, then remove) or writes an empty one, so the old location is never read again. APP_SDK_LEVEL becomes 7 on both sides (website/src/app-sdk/sdkLevel.ts) and adoption_pin.py scans the new key at level 7. Sandbox owners: sandbox_argv.py, sandbox_aliases.py, sandbox_tiers.py, forwarded by sandbox.py. Specs: app-kit-platform.md §39, security.md, meetings.md, and the App Kit references.

The two app repositories carry the same declaration: KiroCrewCaptain/kirocrew-app-meetings#4 and KiroCrewCaptain/kirocrew-app-spec-builder#1 (which keeps the record at the old location on a host below the seam's level, where the key is ignored).

Backwards compatibility

Compatible: the field is new and optional; a manifest without it parses, validates and signs as before (signing_payload adds the key only when non-empty). Every agent spawn now also seals apps/meetings/data/notes and apps/spec-builder/data/trust read-only; the two apps write them from the gateway, which no sandbox applies to.

Reader: src/kiro_crew/security/paths.py:sensitive_write_path_refusal -- chat|cron|subagent -- the removed apps/meetings/data/notes row is matched from the Meetings manifest declaration (test_the_built_in_rows_core_used_to_carry_still_fence, Meetings' test_the_tree_is_on_the_write_only_fence_and_stays_readable)
Reader: src/kiro_crew/security/paths.py:write_protected_home_paths -- crew page -- the posture list and the Auto-Improvement harness mask still get the notes rows, now from the declaration
Reader: src/kiro_crew/apps/builtins/spec_builder/backend/decisions.py:_read_decisions -- app -- the record at the data home's trust/ is moved on first read and every answer kept, and with none an empty record is settled so the old location is never read again (test_an_earlier_releases_record_is_moved_and_kept, test_a_record_planted_at_the_old_location_later_is_never_imported, test_a_link_planted_at_the_old_location_never_copies_its_target, test_a_move_that_cannot_write_keeps_the_old_record, test_an_unreadable_old_record_is_an_unusable_store)
Reader: src/kiro_crew/apps/builtins/spec_builder/backend/decisions.py:_save_decisions -- app -- writes the new location; atomic_write creates trust/ (test_the_ledger_parent_is_created_on_first_write)

Outside this repository, the Spec Builder app repository reads the old location below the seam's level and moves the record at or above it (KiroCrewCaptain/kirocrew-app-spec-builder#1). It names that level as 7 (READONLY_DIRS_SDK_LEVEL, KiroCrewCaptain/kirocrew-app-spec-builder#3), because main gave level 5 to ctx.app_token (#35533) and level 6 to the SDK's issue list (#34732); a host at level 6 or below keeps the record where it is. The decision record becomes readable by agents, which the decision's "read but not write" names; it holds no secret. A purge uninstall of Spec Builder now removes the record with the app's data.

Tests

  • test/test_app_agent_readonly_dirs.py (new, 53 cases): manifest round trip, validation (.., absolute, ., backslash, colon, non-list, an entry at or beneath a credentialMasks file) and signature; both built-ins declare exactly notes and trust; the two declarations never read each other; a declaration cannot reach another app's data (../, absolute, impostor name); the tool gate refuses writes under a declared directory, keeps it readable and leaves a sibling alone, and still fences both former core rows at both prefixes; on the event loop the listing runs on another thread and is reused until it expires; on the loop and on a worker thread a wedged listing refuses every write and is never started twice, and once past its deadline it refuses later checks at once; off the loop each check takes its own listing, on the pool; the Linux plan seals exactly the declared directory and its staged spelling in every mode and under a relocated home; Seatbelt denies writes and links under it and no read; every parent is rename-guarded on both backends; a declared core HIDDEN leaf stays masked; the backend lifts only its own spellings, never another app's, another source's, a core leaf, a leaf beneath one or a directory holding one; a symlinked directory or linked component refuses the spawn; an absent directory is created only inside an existing data/, never at or beneath a declared credential mask, and a name planted at the move-aside spelling does not stop it; a spawn after a keep-data uninstall killed past its move-aside creates no data/, so the reinstall restores the held data; install records the declaration and a default uninstall keeps the kept data fenced; and a real Linux namespace spawn in all three modes reads a declared file and gets EROFS writing or creating in the directory while its sibling stays writable, and the app's own backend spawn writes it.
  • spec_builder/tests/test_routes_decision_ledger.py: the record's location is write-fenced and readable, the manifest declares trust, and the one-time move keeps every answer, prefers the new record, never imports a record planted at the old location after the first read, survives a failed copy, reports an unreadable old record as unusable, and never copies the target of a symlink (a junction on Windows) or a second hard link planted at the old location.
  • Updated pins: test_security_gate_liveness.py's package line budget, re-measured for the bounded listing and its facade manifest rows; test_sandbox_protected_name_holds.py records the four new leaf-only directories and why; test_sandbox_refactor_generated_programs.py pins the declarations empty like its other tables; the facade, backend inventory, bridge snapshot, adoption-pin scan and both decoupling lists name the new pieces; MeetingsNote.test.tsx reads the declaration from the manifest.
  • Determinism: the listing class and the new ledger cases passed 20 runs at -n0 and 10 at -n 4 beside both whole files, and both files (91 cases) passed serially in a shuffled order (seed 11033). Forced conditions: with every listing job started 200 ms late, the class passes, where the earlier spelling of the wedged-listing test fails (it counted starts before the held listing ran); with every anchor rebuild 200 ms slower, it passes too, because the tests hold only the listing's own _APP_READONLY_ROWS_BUDGET_SECS. No sleep and no port: the listing's expiry reads _app_readonly_rows_clock, frozen by the tests, a held listing waits on an event the test sets, and every join is bounded.
  • On this head (base 27e9359419): main took App Kit level 5 for ctx.app_token (fix(apps): give an in-process app its app token after the secret left its folder #35533) and level 6 for the SDK's issue list (feat(app-sdk): issue list components (useIssues, IssueList, IssueCard) #34732), so this seam is level 7. The leaf-only counts are main's 336/343/344 plus this PR's twelve (348/355/356) and the security package line budget is main's 35,824 plus this PR's 77 (35,901); main did not move either since. Gates on this head: black (baseline check), subprocess-encoding, isort, flake8, comment-history, brand-name and file-line-cap exit 0, and mypy on src/kiro_crew is clean. The flake-pattern ratchet passes (68), and the PR's test files with the manifest, governance-mask, UI-prefs and worker spawn-gate test files pass (2,743); test_reply_format_once.py, red on the earlier base, passes (88). The frontend tests and semgrep could not run on this host (no usable node_modules, no semgrep); CI runs both. On the same diff at earlier bases: the three creation cases passed 20 runs at -n0, the whole file (53 cases) passed in a shuffled order (seed 35746), and reverting the creation rule fails the absent-data/ case and the interrupted-uninstall case; at e3d358a255 the repository's semgrep rules found 0 on the diff. The full suites are CI's.

Proof: not provable -- other: new feature seam; the real-spawn EROFS cases are the behavioural check

Known residual, deferred to #33612: a Linux sandbox already running when the lifecycle moves an app's data (update, keep-data uninstall, adoption) does not follow the move, so the move-aside spelling and the data moved back are not sealed for it until it respawns, and a Linux spawn made while apps/<name>/data is absent finds a declared directory it does not create (credentialMasks shares the move-aside half). Stated in app-kit-platform.md section 39 and in the manifest reference.

Manual verification

N/A: the real namespace spawn cases above run the launcher on this host and observe the read-only seal from inside the sandbox; the Seatbelt half is checked on the rendered profile.

Related Issues

Part of #26967

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 02:00
@bolichen97
bolichen97 enabled auto-merge (squash) November 9, 2026 02:00
@bolichen97
bolichen97 force-pushed the feat/app-seam-agent-readonly-dirs branch from 55ada67 to 4d60102 Compare November 9, 2026 02:23
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/sandbox.py

  • src/kiro_crew/sandbox_aliases.py

  • src/kiro_crew/sandbox_argv.py

  • src/kiro_crew/sandbox_tiers.py

  • src/kiro_crew/security/paths.py

  • src/kiro_crew/security/paths_lists.py

  • src/kiro_crew/security/paths_targets.py

  • @bolichen97 posted a complete reasoning template for 03e91f4.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 03e91f4136116732608a5289d4d4b20a2e549843 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing to check. This PR changes no user-visible control. The only website changes are an SDK level constant (6 → 7) and a test assertion. The "blind read not performed" result doesn't apply because there was nothing on screen for a reader to see.

[UX-REVIEWED] 03e91f4

Description read

[DESCRIPTION-READ] 83453ccdafd27be75bfac2f372c4f9ad9353cb98634e3ce3eeca2dab38539554

That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 03e91f4136116732608a5289d4d4b20a2e549843 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. The change reuses the credentialMasks engine as its one source, carries the approved seam's limits (tightening only, inside the app's own data directory), and lists the moved Meetings and Spec Builder readers.

Notes

  • If an app's backend leaves a symlink at a declared directory, _establish_app_readonly_dirs refuses every agent spawn on the gateway, not just that app's spawns. credentialMasks already fails closed the same way, but the SandboxCeilingUnsealable text should name the app so an operator can find which one to fix.

[DESIGN-REVIEWED] 03e91f4

Description read

[DESCRIPTION-READ] fe6e12c242bd4945025b1ad5ffd9bb48cd5bde60b03abd4c41cfd4fdc5ee8219

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 03e91f4136116732608a5289d4d4b20a2e549843 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the new key has two real consumers, and it replaces the core table rows that the move-out (#26967) has to delete.

What this change ships

Inventory (8 items) — 8 justified

Intent: let an app protect its own data directories from agent writes without core naming the app, so built-in apps can move out with their protections intact. ADDITION.

  1. Apps can declare agentReadOnlyDirs in their manifest; agent file-edit tools are refused under those directories (2 consumers: Meetings, Spec Builder) — justified
  2. Every sandbox mode seals declared directories read-only, refuses to spawn when a symlink sits on the path, and creates an absent directory — justified
  3. An app's spawned backend keeps write access to its own declared directories — justified
  4. Meetings notes are now fenced through the app's declaration instead of a core row — justified
  5. Spec Builder's decision record moves from the data home's trust/ to the app's data/trust/, migrated on first read — justified
  6. The Spec Builder record becomes readable by agents (declared in Backwards compatibility) — justified
  7. The App SDK level goes from 6 to 7 on both backend and frontend; the adoption-pin scanner checks the new key — justified
  8. The posture page and the Auto-Improvement harness mask list the declared rows — justified

[FIRST-PRINCIPLES-REVIEWED] 03e91f4

Description read

[DESCRIPTION-READ] 546ee5eaab91e8711c92332fd13b3ceee67bf28eb734968368b66cf09a484673

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ human override accepted

@bolichen97 overrode this lane for 03e91f4136116732608a5289d4d4b20a2e549843 via /ai-review override (this commit only).

[SCOPE-REVIEWED] 03e91f4

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 03e91f4136116732608a5289d4d4b20a2e549843 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 03e91f4

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 03e91f4136116732608a5289d4d4b20a2e549843 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 03e91f4136116732608a5289d4d4b20a2e549843 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 03e91f4

Verdict parsed from the review's SHA-scoped output markers for commit 03e91f4136116732608a5289d4d4b20a2e549843.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 03e91f4136116732608a5289d4d4b20a2e549843 false-positive: <reason, 20 to 500 characters>

@bolichen97

bolichen97 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

span=45569118eb57

Legitimate: a Linux sandbox already running when update_app, a keep-data uninstall or adoption moves apps//data does not have the move-aside spelling sealed (absent at its spawn), and after the move back into the new apps/ it reaches the data through a parent its pinned seals are not attached under. credentialMasks' merged move-aside spelling has the same gap.
Not fixable inside the seam: a mount cannot be placed at the lifecycle's staging name without creating it, and dropping the rename pins trades this for an always-available mv-and-replant attack. The fix is the lifecycle updating the app in place or staging under a core-masked root, tracked in #33612 with a real-spawn pin across an update.
New spawns seal what they find; the residual is stated in app-kit-platform.md section 38; before this PR these directories had no OS fence.

@bolichen97
bolichen97 force-pushed the feat/app-seam-agent-readonly-dirs branch from b1a24a5 to 7a1d6db Compare November 9, 2026 02:51
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 9, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

span=45569118eb57

  • Conflicting declarations disable every Linux sandboxed spawn -- fixed in 7a1d6db

AppManifest.validate now refuses an agentReadOnlyDirs entry equal to or beneath a credentialMasks file (agent_readonly_dirs.mask_conflict_errors), and _establish_app_readonly_dirs never creates a directory there for a manifest that skipped validation.
Pinned by test_a_dir_at_or_beneath_a_credential_mask_refuses_the_manifest and test_nothing_is_created_at_or_beneath_a_declared_credential_mask (which runs the alias pass after).

@bolichen97
bolichen97 force-pushed the feat/app-seam-agent-readonly-dirs branch from 7a1d6db to 3d04a9b Compare November 9, 2026 03:05
@bolichen97

Copy link
Copy Markdown
Contributor Author

span=84e76614317b

Legitimate: a Linux sandbox already running when update_app, a keep-data uninstall or adoption moves apps//data does not have the move-aside spelling sealed (absent at its spawn), and after the move back into the new apps/ it reaches the data through a parent its pinned seals are not attached under. credentialMasks' merged move-aside spelling has the same gap.
Not fixable inside the seam: a mount cannot be placed at the lifecycle's staging name without creating it, and dropping the rename pins trades this for an always-available mv-and-replant attack. The fix is the lifecycle updating the app in place or staging under a core-masked root, tracked in #33612 with a real-spawn pin across an update.
New spawns seal what they find; the residual is stated in app-kit-platform.md section 38; before this PR these directories had no OS fence.

@bolichen97
bolichen97 force-pushed the feat/app-seam-agent-readonly-dirs branch from 3d04a9b to c193159 Compare November 9, 2026 04:05
@bolichen97

Copy link
Copy Markdown
Contributor Author

span=84e76614317b

Legitimate: a Linux sandbox already running when update_app, a keep-data uninstall or adoption moves apps//data does not have the move-aside spelling sealed (absent at its spawn), and after the move back into the new apps/ it reaches the data through a parent its pinned seals are not attached under. credentialMasks' merged move-aside spelling has the same gap.
Not fixable inside the seam: a mount cannot be placed at the lifecycle's staging name without creating it, and dropping the rename pins trades this for an always-available mv-and-replant attack. The fix is the lifecycle updating the app in place or staging under a core-masked root, tracked in #33612 with a real-spawn pin across an update.
New spawns seal what they find; the residual is stated in app-kit-platform.md section 38; before this PR these directories had no OS fence.

@bolichen97
bolichen97 force-pushed the feat/app-seam-agent-readonly-dirs branch from c193159 to cd6b2de Compare November 9, 2026 09:00
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: bounded, reused listing of the agentReadOnlyDirs rows for the loop-side write gate

  • span=b0acacfee0bd the file-edit write gate lists apps/ and stats manifests inline on the event loop -- fixed

fixed in cd6b2de: on the event loop security.paths_targets._app_readonly_dir_rows serves a listing at most one second old and takes the next on the mc-pathres threads, waiting at most _PATH_RESOLVE_REBUILD_TIMEOUT_SECS; a miss raises PathResolutionStalled, so the write is refused as any stall is, and the wedged listing stays the one in flight (no thread per call).
Class swept: both loop-side readers of the rows go through it (sensitive_write_path_refusal and _home_targets_tier's label); write_protected_home_paths() too. Off the loop every check lists afresh, as the sandbox does at a spawn.
Pinned by TestTheLoopNeverListsTheDeclarations: the listing runs off the loop thread and is reused until expiry, a wedged listing refuses inside and beside a declared dir and is started once, and off-loop checks see a just-installed declaration.

@bolichen97

Copy link
Copy Markdown
Contributor Author

resolution: deferred #33612 (no narrow fix inside the seam; a security finding, so the lane needs a writer's ruling)

Legitimate, and reconsidered this round for a narrow fix. Refusing a data move while any sandboxed spawn of the home is live blocks every update while a chat session runs, which breaks the campaign's update requirement. Re-sealing a running namespace needs a helper that enters each live sandbox's namespaces, which is new lifecycle machinery. Staging under a core-masked root closes the move-aside half only.
The complete fix is #33612: update an app in place without renaming apps/ or its data, for this seam and the merged credentialMasks seam together, pinned by a real namespace spawn across an update.
Not a regression: before this PR the directories had no OS fence, and a new spawn seals what it finds. Stated in app-kit-platform.md section 38.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 9, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt e9f563f deferred #33612: agent: maintainer-authorized (Bolin Chen, 2026-11-13, PR #33589). Not a regression: before this PR these dirs had no OS fence, and every new spawn seals them. A running sandbox not following a lifecycle data move is fixed in #33612 (due 2026-11-23).

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a deferred release (class deferred) for the gpt AI finding on e9f563f003fe53fd63c17facb86a67e9528f7c40.

agent: maintainer-authorized (Bolin Chen, 2026-11-13, PR #33589). Not a regression: before this PR these dirs had no OS fence, and every new spawn seals them. A running sandbox not following a lifecycle data move is fixed in #33612 (due 2026-11-23).

This decision applies only to this commit. A new push requires a new judgment.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Main red, not this PR: Backend Tests (3.12, 8) (and its paired Coverage Gate) fail only on test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness (34,305 passed, 1 failed; job). The same node id fails on a clean origin/main worktree at 4e4bba3: the harness table has no row for mimocode (#24732). It is tracked in #36279, and #36290 and #36315 fix it. This PR does not touch that test or the harness list. I'm not rerunning it and not overriding it: once the fix lands, I'll rebase onto it.

…ites

An app lists directories under its own data directory in a new
agentReadOnlyDirs manifest field. Agents may read them and never write
them: the file-edit tool gate refuses a write under each one as it
does under a write-protected core row, and every sandbox mode seals
each one read-only like a core READONLY leaf, with its parents guarded
against rename. A link at a declared directory, or between the data
home and it, refuses the spawn; on Linux an absent one is created so
its seal is never empty. Only the app's own backend gets its exact
spellings back, never a core leaf. The declaration is read by the
credentialMasks engine under its own key, so it has the same grammar,
the same name-from-location rule and its own retained record across
update and uninstall. APP_SDK_LEVEL becomes 5.

Meetings declares notes/ and Spec Builder declares trust/, replacing
the core write row for apps/meetings/data/notes and moving the
decision record from the data home's trust/ into
apps/spec-builder/data/trust/, migrated once on first read.

Part of #26967
@bolichen97

Copy link
Copy Markdown
Contributor Author

Red-main rebase: e9f563f -> 03e91f4, base 9b32941 -> 27e9359. This is not a green-age re-sync: it picks up main's fix for #36279 (test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness), the only red on e9f563f (Backend Tests (3.12, 8), Windows (8), macOS (8) and the paired Coverage Gate).

The rebase was clean, with no conflicts. git range-diff shows the commit unchanged. Main is still at App Kit level 6, so this seam stays at level 7 and KiroCrewCaptain/kirocrew-app-spec-builder's READONLY_DIRS_SDK_LEVEL stays at 7. Main did not touch the leaf-only pin (348/355/356) or the security package line budget (35,901).

Verified on this head: black (baseline check), subprocess-encoding, isort, flake8, comment-history, brand-name and file-line-cap exit 0, and mypy is clean. test_reply_format_once.py passes (88). The PR's test files plus the manifest, governance-mask, UI-prefs and worker spawn-gate files pass (2,743), and so does the flake-pattern ratchet (68). The frontend tests and semgrep cannot run on this host; CI runs both.

The superseded macOS run on e9f563f was cancelled.

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97]

Sensitive change review

  • Head commit: 03e91f4
  • What rule changed: An app's manifest can list agentReadOnlyDirs under its own apps/<name>/data/. The file-edit write gate (security.paths.sensitive_write_path_refusal, rows from security.paths_targets._app_readonly_dir_rows) refuses writes there. Every sandbox mode seals each declared directory read-only like a core READONLY leaf (sandbox_argv, sandbox_aliases, sandbox_tiers). The app's own backend spawn gets its exact spellings back. On Linux an absent declared directory is created before a spawn only inside an app data/ that already stands, never data/ itself, so a spawn after an interrupted keep-data uninstall cannot make the held-aside copy look stale to the next install. Meetings' core apps/meetings/data/notes write row moves to the Meetings manifest. Spec Builder's decision record moves from the data home's trust/ to its declared trust dir.
  • Before -> after (what was allowed/blocked, now): Before, apps/meetings/data/notes was refused by the tool gate only, with no OS seal, and Spec Builder's record sat under trust/, tool-gate fenced and OS-writable. After, both declared dirs are tool-gate refused AND sealed read-only in every sandbox mode, and reads stay open. The declarations only tighten: an entry outside the app's data dir, or at or under a credential mask, refuses the manifest, and the backend lift never lifts a core leaf or a mask. A listing of the declarations that misses its deadline refuses the write, and later checks refuse at once while it still runs.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): An agent shell or file tool could no longer write inside an app's declared directory. That is the intended effect, and nothing outside those directories changes. If the listing of declarations stalls, writes are refused (fail closed). Nothing becomes readable or writable that was not before, except that the Spec Builder record is now readable by agents, which the seam decision names; its one-time move reads the old record only as a regular file with one name, so a planted link or directory makes the store unusable instead of copying anything into it.
  • Evidence checked (which sandbox result proves it): test/test_app_agent_readonly_dirs.py::TestARealAgentSpawnCannotWriteTheDir runs a real Linux namespace spawn in all three modes. The spawn reads the declared file and gets EROFS writing or creating in the directory, its sibling stays writable, and the app's own backend spawn writes it. The Seatbelt profile is checked on the rendered profile (deny file-write*/file-link, no read deny).
  • No regression:
    • Tools still work (which tools/commands were run, result): on this head the PR's test files with the manifest, governance-mask, UI-prefs and worker spawn-gate files passed (2,743), and so did the flake-pattern ratchet (68) and test_reply_format_once.py (88). At base cec6f7a the 403 related test files passed (23,188): sandbox, app, manifest, security, path-gate, Meetings and Spec Builder, plus every file naming the seam or the App Kit level. On the same diff at an earlier base, the three creation cases passed 20 runs and the whole file passed shuffled (seed 35746).
    • Backward compatible (old config / old data / old callers still work, how checked): The field is optional, and a manifest without it parses, validates and signs as before. The old Spec Builder record moves on first read with every answer kept (test_an_earlier_releases_record_is_moved_and_kept), is never re-imported afterwards (test_a_record_planted_at_the_old_location_later_is_never_imported), and a link or directory at the old location is never followed (test_a_link_planted_at_the_old_location_never_copies_its_target, test_a_directory_planted_at_the_old_location_leaves_no_descriptor_open). The removed notes row is matched from the manifest (test_the_built_in_rows_core_used_to_carry_still_fence).
    • Existing tests (which suites passed on this head): this is a clean red-main rebase onto main 27e9359, which carries the fix for main red: test_the_table_names_every_selectable_harness has no row for mimocode #36279; git range-diff shows the commit unchanged. Main is still at App Kit level 6, so this seam stays level 7. The leaf-only pin (348/355/356) and the security package line budget (35,901) are unchanged on main and their tests pass. On this head mypy, flake8, isort, the black baseline check, subprocess-encoding, comment-history, brand-name and file-line-cap exit 0. semgrep and the frontend tests cannot run on this host; CI runs both on this head.
  • How to undo: Revert the single commit. Core's apps/meetings/data/notes row and the trust/ record location come back with it. A record already moved stays at apps/spec-builder/data/trust/, and copying it back to trust/spec-builder-decisions.json restores it.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Security Scope Review on 03e91f4 is red only because of the installation API rate limit, not because of a finding.

Rebutted (false positive, no finding): attempt 1 (job) could not read this PR's head, its comments or its prior check-runs. Every read returned API rate limit exceeded for installation, so it published nothing and failed closed.
Attempt 2 (job) ran after the reset. It published Scope-Verdict: PASS for this head (adjudicated: 30 rows classified on macOS, Ubuntu and Windows, 0 newly refused). It then failed only because the per-head floor holds attempt 1's unread-prior failure.
No run of this head confirmed a regression. The floor is holding an infrastructure failure, not a verdict, and pushing an identical tree to clear it is the re-push the CI docs forbid.

GPT 6.1 Review and Opus 5.5 Review hit the same limit on attempt 1 and both passed on rerun. GPT's first run had already computed "no findings" for this head before its publish step was rate-limited.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override scope 03e91f4 false-positive: agent: no finding. Attempt 1 failed closed on the installation API rate limit (no head, comment or prior check-run readable). Attempt 2 published Scope-Verdict PASS for this head (30 rows, 0 newly refused) and is red only because the per-head floor holds that unread failure.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 recorded a false-positive release (class false-positive) for the scope AI finding on 03e91f4136116732608a5289d4d4b20a2e549843.

agent: no finding. Attempt 1 failed closed on the installation API rate limit (no head, comment or prior check-run readable). Attempt 2 published Scope-Verdict PASS for this head (30 rows, 0 newly refused) and is red only because the per-head floor holds that unread failure.

This decision applies only to this commit. A new push requires a new judgment.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at the owner's request. The deep review of this head is still running, and anything it finds will be posted here as a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants