feat(secrets): P6 agent guardrails and secret scanning #50

Merged
jfraeys merged 1 commit from jfraeys/feat/p6-agent-safety into main 2026-10-10 17:32:11 -04:00
Owner

P6 of the secrets plan.

  • `.claude/settings.json` deny rules: plaintext secret paths (Read/Grep/Glob/Edit) and decrypt commands (Bash). Tool permission only; shell can still bypass, so value-silent scripts remain the primary control.
  • gitleaks: `.githooks/pre-commit` (enabled by `./setup`) and `secret-scan.yml` over full history, with a redacted baseline of 2 existing findings.
  • `scripts/check-secret-hygiene.py`: no tracked .env/tfstate/plaintext vault; tracked `*.sops.yml` fully `ENC[...]`.
  • `scripts/CLAUDE.md` and a P6 section in `docs/secrets-management-sops.md`.

Tested: fake token staged -> gitleaks exit 1; tracked `.env.bak` / plaintext sops file -> hygiene exit 1; real tree passes.

Follow-up (R track, not fixed here): baseline covers a staging key in `staging-web.yml` (42033c6) and a `.env.example` finding (131451e) that need a human check.

🤖 Generated with Claude Code

P6 of the secrets plan. - \`.claude/settings.json\` deny rules: plaintext secret paths (Read/Grep/Glob/Edit) and decrypt commands (Bash). Tool permission only; shell can still bypass, so value-silent scripts remain the primary control. - gitleaks: \`.githooks/pre-commit\` (enabled by \`./setup\`) and \`secret-scan.yml\` over full history, with a redacted baseline of 2 existing findings. - \`scripts/check-secret-hygiene.py\`: no tracked .env/tfstate/plaintext vault; tracked \`*.sops.yml\` fully \`ENC[...]\`. - \`scripts/CLAUDE.md\` and a P6 section in \`docs/secrets-management-sops.md\`. Tested: fake token staged -> gitleaks exit 1; tracked \`.env.bak\` / plaintext sops file -> hygiene exit 1; real tree passes. Follow-up (R track, not fixed here): baseline covers a staging key in \`staging-web.yml\` (42033c6) and a \`.env.example\` finding (131451e) that need a human check. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(secrets): P6 agent guardrails and secret scanning
All checks were successful
Lint / lint (pull_request) Successful in 2m8s
Secret scan / scan (pull_request) Successful in 14s
a639550376
Claude deny rules for plaintext secret paths and decrypt commands,
gitleaks (staged pre-commit hook, full-history CI scan with a redacted
baseline of existing findings), and a structural check that tracked
SOPS files are fully encrypted and no .env/tfstate/plaintext vault is tracked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfraeys/infra!50
No description provided.