Skip to content

feat(cso): add --fix flag with 9 provably safe auto-fixes#1053

Open
andreycpu wants to merge 1 commit intogarrytan:mainfrom
andreycpu:cso-fix-flag
Open

feat(cso): add --fix flag with 9 provably safe auto-fixes#1053
andreycpu wants to merge 1 commit intogarrytan:mainfrom
andreycpu:cso-fix-flag

Conversation

@andreycpu
Copy link
Copy Markdown

What this does

Adds /cso --fix — runs the full audit, then applies a curated set of fixes where the correct change is deterministic and the risk of breakage is near-zero. Zero changes to existing audit phases.

Directly follows Garry's feedback on the fortress PR: start with provably safe patterns, quality over quantity, each fix verified.

Fix catalog (9 patterns)

Fix Pattern Why it's safe
FIX-01 .gitignore secret hardening Additive only — never removes entries
FIX-02 Create .gitleaks.toml baseline Additive only
FIX-03 npm audit fix (no --force) Respects semver, patches only
FIX-04 rejectUnauthorized: falsetrue Single token flip, TLS bypass is never intentional in prod
FIX-05 verify=FalseTrue (Python requests) Single token flip
FIX-06 InsecureSkipVerify: truefalse (Go) Single token flip
FIX-07 httpOnly: falsetrue on cookies Never breaks server-side code
FIX-08 secure: falsetrue on cookies Single flag flip
FIX-09 DEBUG=truefalse in production env files Config only, removes information leakage

Every fix includes an explicit "Safe because" rationale in the skill. The agent skips any fix it can't apply with certainty and reports why in the summary table.

Usage

/cso --fix              # full audit + auto-fix
/cso --fix --diff       # branch-only audit + auto-fix
/cso --fix --code       # code-only audit + auto-fix

--fix is combinable with any existing scope flag.

Changes

  • cso/SKILL.md.tmpl — added --fix to Arguments, rule 7 to Mode Resolution, Phase 15 (Auto-Fix Engine), Edit to allowed-tools
  • cso/SKILL.md — regenerated from template

No changes to Phases 0-14 or any other skill.

Adds /cso --fix which runs the full audit then applies a curated set
of fixes where the correct change is deterministic and the risk of
breakage is near-zero.

Fix catalog:
- FIX-01: .gitignore secret hardening (.env, *.pem, *.key, etc.)
- FIX-02: Create .gitleaks.toml baseline if absent
- FIX-03: npm audit fix (non-breaking patches only, no --force)
- FIX-04: rejectUnauthorized: false → true (Node.js TLS bypass)
- FIX-05: verify=False → True (Python requests TLS bypass)
- FIX-06: InsecureSkipVerify: true → false (Go TLS bypass)
- FIX-07: httpOnly: false → true on session cookies
- FIX-08: secure: false → true on session cookies
- FIX-09: DEBUG=true → false in production env files

Each fix includes an explicit "Safe because" rationale. --fix is
combinable with any existing scope flag (--code, --infra, --diff, etc.)
and runs as Phase 15 after the report is complete. No changes to
existing audit phases.
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.

1 participant