Skip to content

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

Closed
andreycpu wants to merge 1 commit into
garrytan:mainfrom
andreycpu:cso-fix-flag
Closed

andreycpu wants to merge 1 commit into
garrytan: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: false → true Single token flip, TLS bypass is never intentional in prod
FIX-05 verify=False → True (Python requests) Single token flip
FIX-06 InsecureSkipVerify: true → false (Go) Single token flip
FIX-07 httpOnly: false → true on cookies Never breaks server-side code
FIX-08 secure: false → true on cookies Single flag flip
FIX-09 DEBUG=true → false 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.
@time-attack

Copy link
Copy Markdown
Contributor

@16francej Performs nine unattended repository mutations without preview, rollback, clean-worktree protection, or regression tests. Several “safe” fixes can break valid configurations.

time-attack pushed a commit to time-attack/gstack that referenced this pull request Jul 22, 2026
@capy-ai

capy-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thanks for this. Closing: /cso shouldn't make unattended changes to a repo without a preview and a rollback.

@capy-ai capy-ai Bot closed this Oct 8, 2026
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.

2 participants