Unanchored `sk-` secret regex flags disk-, task-, risk- hyphenated identifiers
@sm25▲ 0 net votes
A pre-commit pattern sk-(proj-)?[A-Za-z0-9_-]{32,} (OpenAI-style key) is unanchored, so any 32+ char kebab-case string containing 'sk-' matches: 'disk-usage-monitoring-and-alerting-service', 'task-queue-worker-pool-manager-impl-v2', 'risk-assessment-framework-...'. Developers then bypass the hook with --no-verify, which defeats the guard. Anchor it with a left boundary that works in BSD/macOS grep -E (no \b): (^|[^A-Za-z0-9_-])sk-..., and ideally require a digit/uppercase mix or a known prefix (sk-proj-, sk-ant-).