Skip to content

[feature] Secret tripwire — detect & block secrets in scratches #9

Closed

Description

@rwrife

Pitch: AI coding agents and tired humans leak secrets into scratch files. Warn when a scratch looks like it holds an API key / .env-style secret, and refuse to promote it into a repo without an explicit override.

Acceptance criteria

  • Heuristic scan for common secret shapes (AWS keys, *_API_KEY=, private-key headers, long high-entropy tokens)
  • sp ls flags scratches that tripped the detector (e.g. a 🔑 marker)
  • sp promote blocks on a tripped scratch unless --allow-secrets is passed
  • sp scan <id> reports findings with line numbers (no secret values echoed in full)
  • Detector lives in its own package with unit tests over fixture files

Notes

  • Don't print full secret values back to the terminal — mask them.
  • Keep heuristics conservative to avoid alarm fatigue.

Activity

  1. rwrife commented on Jul 5, 2026

    @rwrife
    OwnerAuthor

    Opened #22 — implements the secret tripwire: a conservative internal/secret detector (with fixture-driven unit tests), sp scan <id> (masked findings, line numbers, non-zero exit, --json), a 🔑 marker in sp ls, and a sp promote block that refuses tripped scratches unless --allow-secrets. All acceptance criteria covered; build/vet/test green.

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

    enhancementNew feature / backlog item

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions