feat(security): add secrets masking and validation (H-21/SEC5) #116

Merged
hamza.khyari merged 4 commits from feature/m4-security-secrets into develop-hamza-1 2026-02-19 13:45:29 +00:00
Member
No description provided.
hamza.khyari added 4 commits 2026-02-19 12:51:08 +00:00
Refs: H-21, SEC5.secrets
Planned: Day 13
Implement centralized redaction utility that masks API keys, tokens,
and credentials across CLI output, structlog logs, and error messages.

- Add shared/redaction.py with pattern-based secret detection (sk-*,
  sk-ant-*, tok_*, Bearer tokens), sensitive key name detection,
  database URL masking, custom pattern registration, and thread-safe
  global show_secrets flag
- Add config/logging.py with structlog configuration integrating the
  secrets_masking_processor into the processor chain
- Add --show-secrets global CLI option to reveal secrets when needed
- Redact error details in main.py, project.py, and auto_debug.py
  error handlers before printing
- Wrap format_output() in formatting.py with automatic dict redaction
- Add show_secrets field and safe __repr__ to Settings model
- Add 43-scenario Behave feature (features/security_secrets.feature)
- Add 10 Robot Framework smoke tests (robot/security_secrets.robot)
- Add ASV benchmarks (benchmarks/security_secrets_bench.py)
- Add reference docs (docs/reference/secrets_handling.md)
hamza.khyari self-assigned this 2026-02-19 12:57:24 +00:00
hamza.khyari merged commit 4eda3b6453 into develop-hamza-1 2026-02-19 13:45:29 +00:00
freemo added this to the v3.3.0 milestone 2026-02-23 17:26:05 +00:00
freemo added the
State
Completed
label 2026-03-04 00:59:24 +00:00
Sign in to join this conversation.
No Reviewers
No Label
State
Completed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#116