Repository navigation
fix: security follow-ups from the 2026-11-26 issue run (skills allowlist, Devin fail-closed, Codex .git) - #4020
Merged
Merged
Conversation
Skills installed from declarative sources passed their tool sections (Claude Code allowed-tools and hooks, for example) through to the generated files. Apply the same canonical-field allowlist that commands and subagents from sources already use: a curated SKILL.md keeps targets, name, description, the invocation flags and the Agent Skills packaging fields, and every other key is dropped with a warning. The body and companion files are kept. Refs #4007 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…in hooks
Devin plugin hook commands were anchored as "$DEVIN_PLUGIN_ROOT"/..., so
on a Devin CLI older than v3000.5.20, which leaves the variable empty, a
hook ran /scripts/... from the filesystem root. Emit
"${DEVIN_PLUGIN_ROOT:?}"/... instead, so the shell stops with an error.
Import accepts the ${VAR:?} spelling for every project directory
variable, so the command still round-trips to ./.
Refs #4007
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…e Codex .git carve-out An all-tools '*' deny spelled with Windows separators (.git\hooks\**) did not count as restricting .git, so the default .git/** write carve-out was still emitted. Check each pattern with / in place of \ as well; reading an escape as a separator only adds patterns that skip the carve-out, which keeps the decision on the safe side. Refs #4007 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
… reminder The reminder compared trimmed strings, so a re-indented or CRLF copy that generate leaves untouched (keeping its approved digest) was still reported as changed. Use fileContentsEquivalent, the same comparison that decides whether generate rewrites the file. Refs #4007 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…ound trips - Factory Droid keeps riskLevel only when every preToolUse hook that returns updatedInput sets preserveRiskLevel. - Junie imports the shared .agents/ root flat, so nested Antigravity agents there are not imported as Junie agents. - import --output-root pairs with generate --output-roots for a round trip to the same directory. Refs #4007 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
…-out and ${VAR:?} import
- Curated skills also drop metadata.openclaw and metadata.hermes, which
OpenClaw and Hermes Agent read as gating and install settings, and a
Codex agents/openai.yaml companion file (policy and MCP dependencies).
- The Codex .git carve-out reads restrictive :workspace_roots entries with
/ in place of \ too, through the same helper as the all-tools check.
- Only a tool that writes ${VAR:?} itself (the Devin plugin) converts it
back to ./ on import; elsewhere a hand-written ${VAR:?} command is kept
as written so it keeps failing closed.
Refs #4007
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4
dyoshikawa
force-pushed
the
resolve-issue-4007-low-followups
branch
from
November 29, 2026 07:11
d72d8e9 to
5a58f5f
Compare
This was referenced Nov 29, 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.
Summary
Picks up the security-flavoured items and a few small correctness items from the umbrella of low review leftovers. Each item is its own commit.
What changed
Security-flavoured
SKILL.mdread from.rulesync/skills/.curated/now keeps only canonical fields (targets,name,description,disable-model-invocation,user-invocable,license,compatibility,metadata). Every tool section (for example Claude Codeallowed-toolsandhooks) is dropped, with one warning per skill. This reuseskeepCuratedFrontmatterKeysfrom feat(sources): install commands and subagents from declarative sources #4005 (newCURATED_SKILL_FRONTMATTER_KEYS). The body and companion files are kept. A local skill with the same name still keeps its tool sections.docs/guide/declarative-sources.mdis updated."${DEVIN_PLUGIN_ROOT:?}"/.... If an older Devin CLI leaves the variable empty, the shell stops with an error. Before, it ran/scripts/...from the filesystem root. This is the newfailsClosedOnEmptyProjectDirVarconverter option. Import accepts${VAR:?}for every project-dir variable, so commands still round-trip to./. Docs explain the:?and recommendfailClosed: trueon guard hooks..gitcarve-out (fix(permissions): close the remaining all-tools withholding gaps (#3822) #3987 follow-up): an all-tools*restriction written with backslash separators (.git\hooks\**) is now also checked with/. Reading a\escape as a separator only adds patterns that skip the carve-out, so the safe-side behaviour is kept. The over-dropping for*/xand**/configis unchanged.Correctness
fileContentsEquivalent. This is the same comparison that decides whether generate rewrites the file, so re-indented or CRLF copies no longer get a false reminder.updatedInputmust setpreserveRiskLevel. Checked against docs.factory.com/harness/hooks..agents/root is imported flat, so nested Antigravity agents there are not imported as Junie agents.import --output-root <dir>withgenerate --output-roots <dir>.Design decisions (made autonomously)
:?) over documenting a minimum version only."$VAR"was already POSIX-only, so${VAR:?}adds no new shell constraint. Note: bash exits 127 on:?and dash exits 2. So whether the hook blocks still depends onfailClosed, but it never runs a root-level path.Remaining items (not done here)
[hooks]keys, so it cannot tell a stale key it wrote from a hand-written gate. Removing them would need a new ownership marker, which is a design change.*/x/**/configover-dropping: kept as is (safe side).auto_reviewtable left on removal, and a combined hooks+permissions global test. Not done, to keep this PR small.findWinningSectiondedup,maxSubagentswording and paths, cross-writertoolswarning. These need a shared-helper refactor across two writers.src+src/**trade-off. Design change."no"vsno. Needs a YAML-AST-aware read.trae:spread. Not done, to keep the PR small.skillsResultmerge with sweep writes, plus a unit test. Needs a change to how the plan is assembled.apply_patchpath matching andw*folding. Design change.theia.mcpServerson import. Design change.Verification
:?generate and import, Codex backslash patterns (shown failing before the fix), Codewhale formatting-only difference. Updated the Devin plugin e2e expectations.pnpm run check, the full unit suite andpnpm run cicheck:contentpass. Locally,vp testcannot find the runner because two vitest versions are installed (5.1.1 bundled with vite-plus, 5.1.2 direct). So the same suite was run withpnpm exec vitest run --silent=trueon the same config. CI runs the normal path.Refs #4007
🤖 Generated with Claude Code
https://claude.ai/code/session_01JdNNKCxxrKAMDANMGDEGP4