Skip to content

Review risk assessment cannot flag CSP/hosting-header config as security-sensitive; add per-repo security-sensitive paths and SECURITY.md scope #1952

Open

Description

@fullsend-ai-retro

What happened

  • 2026-11-10 15:18: the code agent opened shairevivo/react-shopping-cart#74 for issue ci(functional-tests): fix fullsend version check command #73, removing a GitHub star button. As part of the change it edited the Content-Security-Policy response header in root firebase.json (Firebase Hosting config): it removed a host from script-src and deleted the frame-src directive.
  • 15:30: the review agent (resolved from fullsend-ai/agents@v0.54.0, review run 42843253239) produced a PR risk assessment of low (1/5), describing the PR as having no protected paths, no dependency changes and no security sensitivity. It then approved with zero findings and added ready-for-merge.
  • The repo's SECURITY.md explicitly lists the deploy configuration (firebase.json) as in security scope, and lists CSP among the existing controls.
  • 16:01: the repo owner merged #75, which adds root firebase.json to the repo's auto-merge path allowlist. From now on, review-agent approval alone is the merge gate for agent edits to this file's CSP and other response headers. The owner noted this trade-off in the PR body.
  • Source inspection of v0.54.0 shows how the low score came about:
    • skills/pr-risk-assessment/scripts/risk-tier1.sh (L40-45) computes security sensitivity from a hard-coded SECURITY_PATTERNS list of directory names (mint/ auth/ oidc/ rbac/ permissions/ secrets/ crypto/ token/ tokens/ trust/ policies/). There is no override, and a root config file can never match.
    • skills/pr-risk-assessment/SKILL.md step 8 (L243-262) treats "no protected paths, no security-sensitive files, no dependency changes" as reasons the score must be 1.
    • skills/pr-review/sub-agents/security.md has no guidance on CSP, CORS or security response headers.
    • security-triage.md has no hosting-config heuristics.
    • No skill reads the target repo's SECURITY.md.
    • These files are unchanged on main as of 2026-11-10.

What could go better

The risk tier and security triage depend only on directory names, so security controls that live in root config files are invisible to them. This covers CSP and other security headers in firebase.json, netlify.toml, vercel.json, _headers, staticwebapp.config.json or nginx configs, and CSP <meta> tags in index.html.

On #74 the edit happened to tighten the CSP, so no harm was done. The same pipeline would also have scored a CSP that adds 'unsafe-eval' or a wildcard script host as "no security sensitivity, 1/5".

This repo now auto-merges agent PRs touching firebase.json on review approval, so the gap has a direct path to production. This combination of repo-level automation trust and blind spots in agent-level detection will recur in any repo that widens auto-merge scope.

Confidence:

  • High that the fixed pattern list caused the 1/5 score; the skill's step 8 prescribes it.
  • Moderate on the best fix shape. Adding firebase.json to REVIEW_PROTECTED_PATHS via a harness override would force human approval on every such PR. That conflicts with the owner's explicit choice to auto-merge this file. The repo needs a sensitivity signal (higher risk tier and a mandatory security pass), not a protected block.
  • Tension: Review triage step 3b should distinguish security-relevant config from operational config #1224 asks to narrow the broad "config files" security trigger. This proposal is about recognising security-control config specifically, which should be compatible.

Proposed change

In fullsend-ai/agents:

  1. Per-repo security-sensitive paths. Add a REVIEW_SECURITY_SENSITIVE_PATHS env (or similar), overridable via harness base: composition like REVIEW_PROTECTED_PATHS. Have risk-tier1.sh merge it with SECURITY_PATTERNS. Support exact file paths and globs, not just directory prefixes, so firebase.json can match.

  2. Default hosting/security-header patterns. Extend the defaults to cover common security-header config files: firebase.json, netlify.toml, _headers, vercel.json, staticwebapp.config.json, and nginx*.conf. Alternatively, add a lightweight content check in risk-tier1.sh that counts a file as security-sensitive when its diff touches lines matching Content-Security-Policy|Strict-Transport-Security|X-Frame-Options|Access-Control-Allow|Permissions-Policy|Referrer-Policy. The content check also catches CSP <meta> tags in HTML.

  3. Read SECURITY.md scope. In skills/pr-risk-assessment/SKILL.md (and the review security sub-agent), instruct the agent to read the target repo's SECURITY.md / threat-model doc if present. Changes to files that doc declares in scope must not be described as "no security sensitivity", and must get a security sub-agent pass.

  4. CSP guidance for the security sub-agent. In skills/pr-review/sub-agents/security.md, add a short section on response headers and CSP:

    • Loosening (new sources, unsafe-*, wildcards, removed directives that fall back to a weaker default-src) is a finding.
    • Tightening should be verified not to break still-used resources.
  5. Auto-merge widening guidance. In the same sub-agent, add guidance that workflow changes widening an auto-merge or merge-gate path allowlist should be called out. The review should name what security-relevant files the change makes bot-mergeable.

This refines #1893, which adds .fullsend/ to the protected list. It addresses the same root issue (a fixed path list misses repo-specific sensitive files) for the security-sensitive signal, and adds a per-repo extension point so each new path class doesn't need its own upstream change.

Validation criteria

  • Eval cases. Add two review evals:
    • A PR that only edits the CSP header in firebase.json to add 'unsafe-eval' must get SECURITY_SENSITIVE_COUNT >= 1, a risk score of at least 2, and a security finding.
    • A CSP-tightening edit must get SECURITY_SENSITIVE_COUNT >= 1 but may still approve.
  • Per-repo override. Setting the override on a test repo to include an arbitrary root file makes risk-tier1.sh count it.
  • Live sample. Over the next 5 agent PRs across fullsend-managed repos that touch a hosting-header config or a SECURITY.md-scoped file, none should have a risk assessment stating "no security sensitivity".

Related issues checked

Searched: risk assessment CSP; security sensitive paths; protected paths config; SECURITY.md review; content security policy; risk assessment security sensitivity; pr-risk-assessment; protected path; security headers; firebase.json; CSP; hosting config security; SECURITY.md scope; risk-tier1 security-sensitive
Considered: #1893, #1224, #535, #1445, #1077, fullsend-ai/fullsend#2745, fullsend-ai/fullsend#4698


Generated by retro agent from fullsend-ai/react-shopping-cart#75

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions