feat(shared): add secret detection and redaction #213
No reviewers
Labels
No labels
good first issue
has-pr
help wanted
idea
priority
critical
priority
high
priority
low
priority
medium
status
blocked
status
in-progress
status
needs-review
status
ready
type
bug
type
docs
type
enhancement
type
feature
type
refactor
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
customable/claude-mem!213
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/191-secret-detection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements Issue #191 - Automatic detection and redaction of secrets in prompts and observations.
Features
Secret Detection Patterns
sk-), Anthropic (sk-ant-), GitHub PAT (ghp_), GitLab PAT (glpat-)AKIA), Secret Access KeysConfiguration
Modes
[REDACTED:type](default)Changes
packages/shared/src/secret-detector.ts (NEW)
detectSecrets()- Find secrets in textredactSecrets()- Replace secrets with placeholdersprocessSecrets()- Process based on configcalculateEntropy()- Shannon entropy for high-entropy detectionpackages/shared/src/settings.ts
SECRET_DETECTION_ENABLEDsettingSECRET_DETECTION_MODEsettingpackages/hooks/src/handlers/post-tool-use.ts
packages/hooks/src/handlers/user-prompt-submit.ts
Test plan
sk-test1234567890123456789012345678901234[REDACTED:openai_key]in databaseSECRET_DETECTION_MODE: "skip"and verify observations are skippedSECRET_DETECTION_MODE: "warn"and verify secrets are logged but storedCloses #191
🤖 Generated with Claude Code
a05f787930ba17f4c33c