Skip to content

feat(harness-ops): audit-mod-posture checks unasked Claude-written mods, tool MCP calls and noun overrides - #18258

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-17892-45076628004-1
Nov 22, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-17892-45076628004-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17892

Summary

Opened by the work-resolve-issue lane. The run's own summary, updated for the review round:

mod-posture.sh now prints a # claude-written mods: footer. Following the recorded decision, it reads load-unasked when the effective permissions.defaultMode is auto or bypassPermissions and managed disableSideloadFlags is not true. It reads the mode from managed settings, else user settings, the only two files those auto and bypass values take effect from per the settings reference. A lower mode set in project or local settings (local over project), such as plan or dontAsk, still overrides the user's mode, so the script reads defaultMode from those files too. It reads disableSideloadFlags from managed settings only, since that is the key's scope. The script also gains a nouns column built from validate's adds to $:, withholds from $: and replaces on $: lines. The checklist adds M6 (that footer: WARN on load-unasked or unknown), M7 ($.tool.call/$.mcp.call: info, matching M4's treatment of calls that skip checks) and M8 (nouns: info for add, WARN for withhold or replace, since per the mods reference only the prepend/append tiers may withhold a namespace). Design choices made on that evidence: nouns is the last column so existing field numbers stay put; M6 to M8 come after M5 so existing criterion numbers stay put; and calls: nothing on $, which validate prints for a mod with no calls, now reads - where before it printed redacted.

Not verified

  • mod-posture.test.sh was not run: this lane's shell runs only the named wrappers, and check-changed-skills skips script tests (CHECK_SKILL_SKIP_SCRIPT_TESTS=1). The assertions were traced by hand and by the review subagent. Left to the PR's CI.
  • Tidy skipped: the change is 304 changed lines (270 tracked plus 34 in two new files), over the 300-line tidy cutoff.
  • The reviewer suggested also reading managed permissions.disableBypassPermissionsMode and permissions.disableAutoMode, since a managed lock on bypass or auto could make M6 warn when the mode cannot take effect. Not built: the recorded decision names defaultMode and disableSideloadFlags as check 1's…
  • The changelog row's claim that Claude-written mods load unasked even under managed strict-sandbox settings stays unconfirmed: no docs page read in this run mentions strict-sandbox settings. The audit does not rely on it.
  • check-affected skipped comment-hygiene and size-check, which could not run in this lane (network fetch denied, script absent), and markdownlint was skipped by check-changed-skills. All left to the PR's CI.
  • The checkout root holds untracked runner files this run did not create (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc). Left untouched; they are not part of this change.

Fix

  • plugins/harness-ops/skills/audit-mod-posture/scripts/mod-posture.sh: reads managed, user, project and local permissions.defaultMode and managed disableSideloadFlags as fixed words, and prints the # claude-written mods: footer plus a not-read footer for the one-session overrides. A project or local mode other than auto or bypassPermissions overrides the user's mode; an unparsable file that decides the mode reads unknown and names its scope. Adds the nouns column.
  • plugins/harness-ops/skills/audit-mod-posture/scripts/mod-posture.test.sh: adds a nouns fixture mod in the validate output shape from the host probe, a hostile noun, and 14 footer cases, among them a project plan overriding user bypassPermissions, local outranking project, and unparsable project settings.
  • plugins/harness-ops/skills/audit-mod-posture/reference/checklist.md: criteria M6 (claude-written mods load unasked), M7 ($.tool.call or $.mcp.call) and M8 (noun overrides), plus source records for Create a mod, the disableSideloadFlags and defaultMode settings entries, and the mods reference 'Other mods' table.
  • plugins/harness-ops/skills/audit-mod-posture/SKILL.md: documents the new footer and column, how Phase 2 scores M6 to M8, and the report header and inventory table.
  • plugins/harness-ops/skills/audit-mod-posture/evals/evals.json: new eval case 4 (bypass-mode load-unasked, $.tool.call/$.mcp.call, and noun add/replace on an enabled row and an ignored disabled row). Updates M1-M5 to M1-M8 in case 3.
  • plugins/harness-ops/skills/audit-mod-posture/evals/fixtures/host-inventory-unasked.md: new fixture for eval case 4.
  • plugins/harness-ops/skills/audit-mod-posture/evals/fixtures/host-inventory.md: adds the nouns column, the # claude-written mods: footer and its not-read footer in the script's order.
  • .changes/harness-ops/work-resolve-issue-issue-17892-45076628004-1-23b1f57c.md: minor changelog fragment (Added: M6, M7, M8 and the nouns column, with the project and local override; Fixed: calls: nothing on $).

Verification

The runner ran each check from the base copy against d1556d4:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • read https: //code.claude.com/docs/en/plugins/mods/create: 'Ask Claude for a mod': in auto and bypassPermissions modes Claude Code can load the mod without asking. Such mods do not load in dontAsk, in the claude -p run that writes them, in an untrusted workspace, or with --safe-mode, --bare, and more.
  • read https: //code.claude.com/docs/en/plugins/mods/admin: 'Know what happens by default': calls such as $.tool.call and $.mcp.call can skip permission rules, permission prompts, a hook's ask, and the auto mode classifier. 'Choose how much to allow': disableSideloadFlags keeps mods Claude writes from loading.
  • read https: //code.claude.com/docs/en/settings: 'A value you set is ignored': permissions.defaultMode values auto and bypassPermissions don't take effect from project or local settings. Precedence is managed, then command line, then local, then project, then user.
  • read https: //code.claude.com/docs/en/settings-reference: the disableSideloadFlags entry gives Scope Managed, Boolean, default false. The permissions.defaultMode entry lists the allowed values (default, acceptEdits, plan, auto, dontAsk, bypassPermissions, manual).
  • read https: //code.claude.com/docs/en/plugins/mods/reference: the 'Other mods' table row for engine.create: a hook returns a changed mods API, to add a namespace, and a mod in the prepend or append tier can also withhold one.
  • check-changelog-fragments: first run failed (fragment had no section). Fixed; rerun: all 2 fragments valid.
  • check-changed-skills: PASS, 0 errors, 1 warning (SKILL.md body grew 136 to 147 lines).
  • check-affected: first run failed on shellcheck SC2249, the changelog fragment, and comment-lint (two new section-header comments). Fixed; rerun: 17 passed, 10 skipped, 0 failed.
  • check-evals-quality on the skill's evals.json: PASS with 1 warning, on eval case 2's .claude/settings.json token, which was already there.
  • cant-fail-scan --file mod-posture.test.sh --check: PASS, no gating findings, 1 test file fully read.
  • Fresh-context review subagent over the whole diff found no blocking bugs and confirmed the test strings, withheld count (5) and planted-secret count (22) by tracing. One confirmed low finding (fixture not-read footer order) was fixed.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/45076628004
  • Review round (project and local defaultMode override): check-affected passed (17 passed, 10 skipped) after fixing comment-lint and editing the changelog fragment. mod-posture.test.sh was not run in this round; CI runs it on the new head.

Left out: the items under Not verified.

Related

#17892

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head d1556d491517ab1343e214296608eb18783260e6. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed e43a71fdd6617fb63fe17765e226957721c35cf5: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #18258, incremental (d1556d4 → e43a71f)

No security issues found. This review covered only blocking findings, because this lane already reviewed an earlier head (blocking only: yes).

I read every hunk of the 5 files in the incremental scope:

  • the changelog fragment
  • SKILL.md
  • reference/checklist.md
  • mod-posture.sh
  • mod-posture.test.sh

None of them matches a trusted-path glob. The change touches no workflow, token, trusted-actor list, kill switch, merge hold or plugin manifest.

What I checked

  • Project and local settings reads leak nothing (mod-posture.sh, the new mode_of and the for scope in project local loop).
    • Both new files go through the same mode_word jq filter as managed and user settings. It turns the value into one of the fixed mode names, other or unset.
    • A jq failure gives the fixed word unreadable.
    • A non-object permissions gives empty output, and several JSON documents give several fixed words. Neither is unset, auto or bypassPermissions, so both set mode. That falls to the *) unknown ($mode_from settings unreadable) branch, and $mode_from is only one of managed, user, project or local.
    • So no raw value from a settings file the repository controls reaches stdout. The path of the file read ($PROJECT/.claude/settings.json or settings.local.json) is never printed.
  • The project or local override can only lower the mode the footer reports. auto and bypassPermissions from those scopes are skipped (case "$scope_mode" in unset | auto | bypassPermissions) ;;). A hostile project can't make the footer claim load-unasked. At most it can show a lower mode, which the settings reference says takes effect anyway. The footer is an advisory audit output that gates nothing, so a wrong result there gives an attacker nothing.
  • Instruction text: the SKILL.md and checklist.md edits only describe the precedence rule. They delete or relax no rule. The "Reading mods" rule against opening settings files directly is unchanged.
  • Tests: the new cases write only under $FIX/proj/.claude and $U inside the temporary fixture, and the existing rm -rf -- "${FIX:?}/proj/.claude" cleans up after them.
  • PR context: it contains no text telling the review lane what to do.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on d1556d491517ab1343e214296608eb18783260e6; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed e43a71fdd6617fb63fe17765e226957721c35cf5: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, d1556d4 → e43a71f): audit-mod-posture project/local defaultMode (#18258)

This is an incremental review, and it was blocking only: the prior-findings file shows this lane already reviewed an earlier head. I read every hunk of the 5 files in .claude-lane/incremental.diff. I also read the unchanged code the changed lines call: MODE_WORD, PROJECT, the managed-mode block, and the test fixture setup at mod-posture.test.sh:335-366.

Prior finding addressed. The earlier advisory (discussion_r4660402629) said project and local settings can lower the user's defaultMode but were never read. The new mode_of helper and the project → local loop at mod-posture.sh:232-249 fix it:

  • The loop runs only when managed settings set no mode.
  • It ignores unset, auto and bypassPermissions in project or local settings, and lets any other mode override the user's. Local is read last, so it outranks project, which matches managed > local > project > user.
  • An unparsable project or local file now gives unknown (<scope> settings unreadable) instead of the old hard-coded user.

Tests. The new test cases each check one of these paths, and each could fail:

  • user bypassPermissions with project plan
  • local dontAsk over project plan
  • local auto with unparsable project settings

I traced each one by hand against the fixture state, with the managed file removed at L361. Each expected string matches what the script prints. No existing expectation was changed or loosened. I could not run mod-posture.test.sh because this lane has no shell.

Docs. The changelog fragment, SKILL.md, checklist.md M6 and the script's header comment all describe the new precedence the same way the code implements it.

Closing issue #17892. This push does not change how the Done-when items are covered. They stay as assessed at the earlier head.

Loosened checks: none. Loosened checks would be marked: fail (bundled default; the prompt has no loosened_check_verdict: or loosened_check_patterns: lines); patterns: 0. The prompt has no loosened_check_decision_record: line, so I did not check the citation requirement.

Other: No plugin manifest changed. The PR context and prior-findings files contain no embedded instructions. This change spends nothing and needs no hold.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head d1556d491517ab1343e214296608eb18783260e6, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=d1556d491517ab1343e214296608eb18783260e6 rubric=10.8.2 rater=claude-opus-5-5 checker=claude-opus-5-5

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback

Run 45079733635, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 45079733635

Failed GitHub API calls

No failed call recorded by the run job's scripts.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM66pEpE
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch

Run 45079733635, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed e43a71f
Run 45079733635

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on e43a71f.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback

Run 45079733635, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 45079733635

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 22, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head e43a71fdd6617fb63fe17765e226957721c35cf5, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=e43a71fdd6617fb63fe17765e226957721c35cf5 rubric=10.8.2 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit aace0a6 Nov 22, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17892-45076628004-1 branch November 22, 2026 23:25
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit aace0a62d5f09f0baff829af1afa8af2714da7bf; later checks count it verified from this comment.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

harness-ops: audit-mod-posture checks for unasked mod enablement and noun overrides (2.1.321, 2.1.323)

0 participants