Repository navigation
Closed
Labels
enhancementNew feature or requestgithub_actionsPull requests that update GitHub Actions codeplannedImplementation plan approved
Description
Summary
This repo is public, and private material has leaked into it four times, each found by hand after the fact. Add automated scanning that blocks the push or PR before the leak: GitHub secret scanning and push protection (free for public repos, currently off), plus gitleaks with project-specific rules for the leaks generic scanners don't catch.
Current State
gh api repos/sequant-io/sequant --jq .security_and_analysis reports secret_scanning, secret_scanning_push_protection and dependabot_security_updates all disabled.
Past leaks, all non-credential, all caught by people:
- 2026-05: the
entire/checkpoints/v1shadow branch pushed full session transcripts toorigin(found by an outside researcher). - 2026-09-09:
/Users/<owner>/…absolute paths, a named downstream project and a vendor extraction method indocs/internal/. Fixing it took a history rewrite of 2,208 commits (PR docs: redact local paths, a project name, and the binary-extraction method from the graph docs #1019–fix(evals): repoint fixture_commit anchors after the history rewrite #1021). - 2026-09-15: a gated early-access flag name in 20 prose references across 7 files (PR docs: stop naming the plugin-eval early-access flag in prose #1061).
- test(#1094): golden-corpus verdict snapshot for pre-tool.sh #1128: hook-corpus fixture leaked session links and foreign project names. The harvester now redacts (
scripts/hook-corpus.ts).
Phase agents wrote two of these. They had no reason to know that docs/internal/ is public.
Proposed Change
- Owner settings (no code): turn on secret scanning, push protection and Dependabot security updates for the repo.
- gitleaks in CI on
pull_request(andmerge_groupif the merge-queue issue lands), with a.gitleaks.tomlthat extends the default rules with project rules:- absolute home paths (
/Users/[^/\s]+/,/home/[^/\s]+/with the/home/usertest convention allowlisted) - Claude session URLs (
claude.ai/code/session_,cse_ids) - an
entire/ref check in the push step - Sensitive literal strings (e.g. the gated flag name) must not be written into the public config. Match them by a generic pattern, or keep them in an untracked local rules file that the pre-commit hook loads when it exists.
- absolute home paths (
- Optional local pre-commit: run
gitleaks protect --stagedfrom the existing hook setup, so phase agents get the block before they push. - Reuse
scripts/hook-corpus.ts's redaction patterns where they overlap, so there is one source of truth.
Acceptance Criteria
- AC-1: owner gate — secret scanning, push protection and Dependabot security updates read
enabled— Evidence:gh api repos/sequant-io/sequant --jq .security_and_analysis - AC-2: a CI job runs gitleaks with
.gitleaks.tomlon every PR — Evidence:grep -n gitleaks .github/workflows/*.yml - AC-3: the config flags a fixture containing a
/Users/alice/path and aclaude.ai/code/session_URL, and passes the current tree — Evidence: test in the diff, mutation-verified (remove one rule → that fixture case fails) - AC-4:
.gitleaks.tomlcontains no literal sensitive string the incidents above redacted — Evidence: reviewer check, recorded in the PR - AC-5:
git grep -nE '/Users/[a-z]+/' origin/mainis empty, or every hit is allowlisted with a reason — Evidence: command output in the PR - AC-7 (derived by /spec; restated by the owner 2026-10-07): the committed
evals/results/*.jsoncarry no home path, and thehome-pathrule fails any PR that reintroduces one. The writer,claude plugin eval, is outside this repo and out of scope — Evidence:gitleaks dir --config .gitleaks.toml evals/resultsexits 0; the tree-pass test in__tests__/gitleaks-config.integration.test.ts
Context
- Location: repo settings,
.github/workflows/,.gitleaks.toml,.claude/hooks/ - Type: Security
- Effort: Quick win (settings) + Medium (custom rules)
- Tools: GitHub secret scanning / push protection, gitleaks
- Identified by:
/improveanalysis (tooling research, 2026-10-07)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestgithub_actionsPull requests that update GitHub Actions codeplannedImplementation plan approved
Activity
admarble commentedon Oct 7, 2026
If #1350 lands first, add
merge_groupto the gitleaks job's triggers.admarble commentedon Oct 7, 2026
AC-1 done by the owner's go-ahead (2026-10-07):
gh api repos/sequant-io/sequant --jq .security_and_analysis→secret_scanning: enabled,secret_scanning_push_protection: enabled,dependabot_security_updates: enabled(vulnerability alerts were also off and are now on, which Dependabot security updates require). The remaining ACs are code.admarble commentedon Oct 7, 2026
Runner note for the phase agents (sequant run, 2026-10-07):
npm testsuite in exec or qa. CI runs it on the PR and it is a required check. Run the test files you add or change, plus each AC's own Evidence command, in the foreground withtimeout 590.run_in_backgroundorMonitor: the phase ends when your turn ends and the result never arrives.SEQUANT_MUTATIONmarkers and AC table in exec's final## Summary. The runner checks the PR body after exec.gitleaks/gitleaks-actionneeds a paidGITLEAKS_LICENSEfor organization repos. Install the gitleaks CLI from its GitHub release instead (pinned version, checksum verified), and pin everyuses:to a commit SHA like the other workflows (Scorecard checks this).admarble commentedon Oct 7, 2026
Complexity: Standard (5 ACs, 4 directories)
AC Quality Check
grep -n gitleaks .github/workflows/*.ymlfails today (no gitleaks anywhere), so it gates the work. It would also pass on a comment mentioning gitleaks. Tighten in exec: grep thepull_requesttrigger and thegitleaks detectstep inside the new workflow file.git grep -nE '/Users/[a-z]+/'finds 146 hits. Most are/Users/user/test conventions. Real ones to fix or allowlist:evals/results/qa-trust-boundary-{pr-comment,tool-output}.json: 4 lines with the owner's real home path/Users/tony/Projects/worktrees/feature/1024-…. A live leak of the class this issue is about. Redact the paths in the committed results (or stop tracking them).scripts/hook-corpus.test.ts:175,178:/Users/tony/…as redaction test input. Replace with/Users/alice/…(also satisfies thead-motionproject-name hit on line 175).scripts/hook-corpus.test.ts:172and__tests__/integration/in-place-checkout-skill.integration.test.ts:259: a real-shapedclaude.ai/code/session_URL and a realcse_id. Replace with obviously fake ids.user,you,alice,dev,test,YourName,/mnt/c/Users/YourName) are allowlisted by name with a reason, not by file.Scope Assessment
Non-Goals:⚠️ Not in the issue. Proposed: no history rewrite, no scanning of git history beyond the PR range, no gated flag name in any public file, no change to repo settings (AC-1 is done).
.github/workflows, root config,scripts/__tests__,evals)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Secret scanning, push protection, Dependabot security updates enabled
Verification: Manual Test (done)
Scenario: Given the repo → When
gh api repos/sequant-io/sequant --jq .security_and_analysis→ Then all three readenabled.Assumptions: The owner's 2026-10-07 comment is current. Exec re-runs the command and pastes the output.
AC-2: CI job runs gitleaks with
.gitleaks.tomlon every PRVerification: Integration Test (workflow shape check; see
reference_shape_checks_live_in_workflows_too)Scenario: Given the new workflow → When parsed → Then it triggers on
pull_request(+merge_group), installs a pinned gitleaks release with a verified checksum, everyuses:is SHA-pinned, and it runsgitleaks detect --config .gitleaks.tomlover the PR range.Assumptions:
gitleaks-actionis not used (paid license for orgs, per runner note).AC-3: Config flags
/Users/alice/andclaude.ai/code/session_fixtures; passes current treeVerification: Integration Test (vitest
*.integration.test.ts, shells out to gitleaks; skips with a clear message if the binary is absent locally, hard-fails whenCIis set)Scenario: Given a temp dir with one fixture per rule → When
gitleaks dir --config .gitleaks.toml→ Then each rule id appears; and Given the repo tree → Then exit 0.Assumptions: Mutation-verify: delete the home-path rule → the home-path case fails; restore. Same for the session rule. Record with
Mutation-verified:markers (failedTest path = the test FILE first).AC-4: No literal sensitive string in
.gitleaks.tomlVerification: Manual Test + mechanical backstop
Scenario: Given the config → When reviewer reads it and the test asserts rule regexes contain no word from a short denylist kept outside the repo → Then none match.
Assumptions: Reviewer check is recorded in the PR body.
AC-5:
git grep -nE '/Users/[a-z]+/' origin/mainempty or allowlisted with a reasonVerification: Integration Test + command output
Scenario: Given the branch → When the same grep runs → Then every hit is a convention name allowlisted with a comment, and zero
/Users/tony.Assumptions: Evidence must be run on the branch, not
origin/main(the fix is not merged yet).Implementation Plan
Phase 1: Clean the tree (AC-5)
/Users/tony/…inevals/results/qa-trust-boundary-*.json(check which script writes them so the next run does not reintroduce it)./Users/tony,ad-motion, and the real-shaped session URL /cse_id in the two test files for fake values.Phase 2: Config (AC-3, AC-4)
.gitleaks.toml:[extend] useDefault = true; rules for/Users/<name>/and/home/<name>/, session URL,cse_ids. Allowlist convention names by regex with adescription. Keep patterns generic; no gated flag name.scripts/hook-corpus.tsREDACTION_RULES(lines 124–167). Export the sources and have a parity test compare them, or record why they differ (gitleaks uses Go RE2: no lookahead, so(?!sequant\b)cannot port)..gitleaks.local.tomlif present; add it to.gitignore.Phase 3: CI and hook (AC-2)
.github/workflows/gitleaks.yml: triggerspull_requestandmerge_group(improve(ci): merge queue on main instead of strict up-to-date — 37 merge-main commits in the last 40 PRs #1350, per the 2026-10-07 comment; harmless if the queue never lands),permissions: contents: read,fetch-depth: 0, pinned release download +sha256sum -c.entire/ref check:git ls-remote --heads origin 'entire/*'fails the job if any ref exists.scripts/wrapper runninggitleaks protect --stagedwhen the binary exists; wire it from the existing hook setup. Note.claude/hooks/pre-tool.shis a Claude PreToolUse hook, not a git hook, so the wrapper is called from there ongit commitor installed as.git/hooks/pre-commit; pick one in exec. Both repo and plugin-cache hooks fire (memory), so keep it out of the plugin copy unless needed.docs/on the scanner and the allowlist convention.Design Review
ci.yml, whosetestjob id is load-bearing for the ruleset), wrapper inscripts/.gitleaks-action(paid license for orgs); a custom TS scanner (reinvents the tool); adding a step toci.yml(couples to the requiredtestcontext).scorecard.yml. The leak class has recurred 4 times (docs: redact local paths, a project name, and the binary-extraction method from the graph docs #1019–fix(evals): repoint fixture_commit anchors after the history rewrite #1021, docs: stop naming the plugin-eval early-access flag in prose #1061, test(#1094): golden-corpus verdict snapshot for pre-tool.sh #1128, the 2026-05 entire branch), each a manual fix. This issue is the class fix (a gate), not another site fix. Redaction already exists in one place (hook-corpus.ts); step 4 handles the second source.evals/resultswriter,hook-corpus.tsharvester. Consumers: new CI job, optional pre-commit. Two pattern sources (gitleaks TOML, hook-corpus) → parity test in step 4.Feature Quality Planning
All standard checks pass. Notable items:
/Users/tonyhit inevals/resultsmeans the first CI run on this PR will fail until Phase 1 is done. Order commits accordingly.npm test, no background tests, commit every ~10 min, putSEQUANT_MUTATIONmarkers and the AC table in exec's## Summary.Derived ACs
evals/resultswriter no longer emits absolute home pathsOpen Questions
user|you|alice|dev|test|YourName|cwd|u). Impact: path-based hides future real leaks in those files.pre-commitwrapper inscripts/, optional install. Impact: PreToolUse only covers agents, not humans.mainruleset? — Recommendation: yes, after one green week; owner action.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Config + workflow work with an integration test; no UI;
testgenskipped because AC-3 stubs are small and need a real gitleaks binary. Security-review not needed: no auth or input handling.Label Review
Current: enhancement, github_actions
Recommended: enhancement, github_actions, planned
Reason: plan posted
Quality Loop: Won't auto-enable
admarble commentedon Oct 7, 2026
QA Verdict: AC_NOT_MET
AC coverage: 3/7 met
Gaps:
fix(#1352): build leak-shaped test fixtures at run time; run the rule…
fix(#1352): skip the round-1 fake fixtures in the PR commit-range sca…
admarble commentedon Oct 7, 2026
Runner note for QA round 2 (2026-10-07): the runner fixed the round-1 findings and the first CI failures on the PR branch (commits and reasons are in the PR body's "QA round 1 fixes" and "CI round fix" sections). CI is green on the current head, full suite included, so don't re-run
npm test: verify each AC with its own Evidence command and the named test files, foreground,timeout 590.admarble commentedon Oct 7, 2026
QA Verdict: AC_NOT_MET
AC coverage: 6/7 met
Gaps:
gitleaks.yml:39:${{ github.base_ref }}is interpolated intorun:. The risk is low because base_ref is a branch in the base repo, which outside authors cannot create. Still, passing it throughenv:is the hardening idiom..gitleaks.toml:23: the allowlist includesdev,me,u,xandname, which could be real account names. This follows spec OQ-1, so it was a deliberate choice.claude-cse-idrule has no fixture test. Only home-path and session-URL are covered, which is all AC-3 asks for.scripts/gitleaks-precommit.shusesgitleaks protect, which is deprecated in 8.x but still works (I smoke-tested it below).fix(#1352): pass event values to the scan through env; test the cse i…
feat(#1352): improve(security): enable secret scanning + push protect…
chore(#1351): merge main after v2.20.0