Skip to content

fix(#2134): consolidate protected path lists into single source of truth - #2136

Closed
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/2134-consolidate-protected-paths
Closed

fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/2134-consolidate-protected-paths

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Protected path lists were maintained inline in four locations (post-fix.sh, post-review.sh, pr-review/SKILL.md, agents/fix.md) and had diverged. The most dangerous gap: scripts/ was listed in LLM-facing instructions but missing from shell enforcement scripts, allowing agents to modify safety- net scripts without being blocked.

Changes:

  • Create scripts/protected-paths.txt as the canonical shared file with
    the full list: .github/, .claude/, .cursor/, agents/, harness/, plugins/,
    policies/, scripts/, api-servers/, skills/, CODEOWNERS, AGENTS.md,
    CLAUDE.md, .pre-commit-config.yaml, .gitattributes
  • Modify post-fix.sh and post-review.sh to read from the shared file
    via mapfile instead of inline arrays
  • Update pr-review/SKILL.md and agents/fix.md to reference the file as
    the authoritative source and enumerate the full canonical list
  • Normalize agents/fix.md: .github/workflows/ -> .github/ to match the
    other locations
  • Update agents/code.md reference from post-review.sh to the shared file
  • Add missing paths everywhere: scripts/, skills/, AGENTS.md, CLAUDE.md,
    .cursor/

In toto (tl;dr):

  • Add to the protected paths list via "protected-paths.txt"
    • .cursor/
    • skills/
    • AGENTS.md
    • CLAUDE.md
  • Broaden ".github/workflows/" to ".github/" in fix.md

Note: make lint could not run (Go module cache permission denied in sandbox). Shell scripts were reviewed manually. The post-script runs authoritative pre-commit on the runner.


Closes #2134

Post-script verification

  • Branch is not main/master (agent/2134-consolidate-protected-paths)
  • Secret scan passed (gitleaks — eda1e12306a7a4393c077260bcd5acde491b8649..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

Protected path lists were maintained inline in four locations (post-fix.sh,
post-review.sh, pr-review/SKILL.md, agents/fix.md) and had diverged. The
most dangerous gap: scripts/ was listed in LLM-facing instructions but
missing from shell enforcement scripts, allowing agents to modify safety-
net scripts without being blocked.

Changes:
- Create scripts/protected-paths.txt as the canonical shared file with
  the full list: .github/, .claude/, .cursor/, agents/, harness/, plugins/,
  policies/, scripts/, api-servers/, skills/, CODEOWNERS, AGENTS.md,
  CLAUDE.md, .pre-commit-config.yaml, .gitattributes
- Modify post-fix.sh and post-review.sh to read from the shared file
  via mapfile instead of inline arrays
- Update pr-review/SKILL.md and agents/fix.md to reference the file as
  the authoritative source and enumerate the full canonical list
- Normalize agents/fix.md: .github/workflows/ -> .github/ to match the
  other locations
- Update agents/code.md reference from post-review.sh to the shared file
- Add missing paths everywhere: scripts/, skills/, AGENTS.md, CLAUDE.md,
  .cursor/

Note: make lint could not run (Go module cache permission denied in
sandbox). Shell scripts were reviewed manually. The post-script runs
authoritative pre-commit on the runner.

Closes #2134
@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://1a2675ea-site.fullsend-ai.workers.dev

Commit: 4949f942dc6a6989ec806b0db89d1d9ef1f1ccb2

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:13 PM UTC · Completed 6:24 PM UTC
Commit: 4949f94 · View workflow run →

@ben-alkov ben-alkov self-assigned this Jun 10, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [logic-error] internal/scaffold/fullsend-repo/scripts/post-review.sh:75 — The PR expands enforcement scope by adding .cursor/, skills/, AGENTS.md, CLAUDE.md to the protected paths list via protected-paths.txt, and broadens .github/workflows/ to .github/ in fix.md. The PR body calls out the scripts/ gap but does not enumerate all other net-new enforcement additions. Consider explicitly listing all newly enforced paths in the PR description so human reviewers understand the full behavioral change.

  • [authorization] internal/scaffold/fullsend-repo/scripts/post-fix.sh:65 — Repos already scaffolded will remain on the old inline list (missing scripts/, skills/, AGENTS.md, CLAUDE.md from enforcement) until re-scaffolded. The pre-existing gap (scripts/ missing from enforcement) is being fixed by this PR, but only for newly scaffolded repos or repos that pull the update. Ensure all active repos are re-scaffolded after merge.

Low

  • [fail-open] internal/scaffold/fullsend-repo/scripts/post-fix.sh:63 — The grep pipeline used to parse protected-paths.txt does not strip trailing whitespace from entries. If a path entry has trailing whitespace, the pattern match will fail. Consider piping through sed 's/[[:space:]]*$//' in both post-fix.sh and post-review.sh.

  • [pattern-inconsistency] internal/scaffold/fullsend-repo/agents/fix.md:96 — The prohibition sentence now ends with a period instead of a colon before the list. The authoritative-source paragraph is inserted between the prohibition and the list, slightly fragmenting the flow.

  • [design-direction] internal/scaffold/fullsend-repo/agents/fix.md:96 — The inline protected paths list in fix.md and SKILL.md could drift from the canonical protected-paths.txt file in the future. The duplication is intentional for LLM context, and the authoritative-source references mitigate the risk.

  • [doc-style] internal/scaffold/fullsend-repo/agents/fix.md:101 — The .github/ entry has the comment "CI configuration" which is imprecise since .github/ contains more than CI configuration (CODEOWNERS, dependabot config, etc.).

  • [pattern-inconsistency] internal/scaffold/fullsend-repo/scripts/post-fix.sh:66 — The grep chain grep -v '^\\s*#' | grep -v '^\\s*$' could be simplified to a single grep -Ev '^\\s*(#|$)'.

Info

  • [authorization] internal/scaffold/fullsend-repo/scripts/protected-paths.txt:26 — The protected-paths.txt file includes scripts/ as a protected path, so the file protects itself from agent modification. This circular self-protection is correct and important.

  • [pattern-inconsistency] internal/scaffold/fullsend-repo/agents/code.md:89 — Phrasing "Protected paths are defined in" in code.md differs from "The authoritative list lives in" in fix.md. Minor inconsistency across agent docs.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Jun 10, 2026
@ben-alkov

Copy link
Copy Markdown
Member

/fs-fix

  • Move "protected-paths.txt" to "policies/"

    • Modify the post-scripts to reference "policies/protected-paths.txt"
      directly or using a repo-root-relative path like $(git rev-parse --show-toplevel)/policies/protected-paths.txt)
    • Adjust references in other files
  • The agent could potentially edit "protected-paths.txt" to remove its
    own parent directory entry, and the post-script would read the weakened
    version before checking for protected-path violations. With the old
    inline arrays, tampering required modifying the shell script itself
    (which was caught). The file-based approach introduces a TOCTOU gap
    that didn't exist before, so:

    Hardcode a self-protection check in the post-scripts, independent of
    the file contents. Something like:

    # Always protect the file itself, regardless of what's listed in it.
    if echo "${BRANCH_CHANGED_FILES}" | grep -qF "policies/protected-paths.txt"; then
      echo "::error::BLOCKED — agent modified the protected-paths policy file"
      exit 1
    fi
  • [pattern-inconsistency] internal/scaffold/fullsend-repo/agents/code.md:89
    Phrasing "Protected paths are defined in" in code.md differs from "The
    authoritative list lives in" in fix.md

    • Change both to "The authoritative list of protected paths is in"

@ralphbean

Copy link
Copy Markdown
Member

Closing this — after thinking about it, we don't want a single source of truth for protected paths. Each context (fix agent, review agent, shell enforcement) may intentionally define different sets of protected paths. For example, we might restrict the fix agent from touching one set of files while having the review agent escalate on a different set. Consolidating them into one file assumes they should always be identical, which removes flexibility we want to keep.

The specific gaps (like scripts/ missing from shell enforcement) are real, but the fix should be targeted additions to the individual lists rather than consolidation.

@fullsend-ai-retro

fullsend-ai-retro Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 8:56 PM UTC · Completed 9:00 PM UTC
Commit: 4949f94 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #2136

Unable to perform retrospective analysis. The retro agent's sandbox environment could not reach the GitHub API — the network proxy returned HTTP 403 on all CONNECT attempts to api.github.com, and gh auth status reported the token as invalid. Without API access, the agent cannot gather PR metadata, comments, reviews, workflow runs, or session traces needed to reconstruct the workflow timeline.

This is an infrastructure issue, not a workflow issue. One proposal filed to address the root cause.

What was attempted

  • gh pr view, gh run list, gh api — all failed with HTTP 403 via proxy
  • curl with and without proxy — proxy returns 403; bypassing proxy fails DNS resolution
  • WebFetch to the PR URL — also returned 403 (private repo)

Proposals

  1. Retro agent: ensure GitHub API access from sandbox environment — the proxy allowlist or token provisioning needs to include api.github.com for retro agent runs.

Proposals filed

This branch was successfully deployed

1 active deployment
site-preview — 4949f942 Deployed Jun 10, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protected path lists are drifting across four locations

2 participants