fix(redaction): catch Google, Stripe and Hugging Face keys and env-style secret assignments #32
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.73) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 415 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.361
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.073
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #32"
general
weight: 0.35
mangeshraut712
Bug
Thread summaries, facets and insights go through
lib/redaction.jsbefore they're sent to the model (llm-insights.js) and written into the report. The patterns caughtsk-keys, GitHub, AWS, Slack and npm tokens, Bearer tokens and passwords. They missed several shapes that are common in Codex sessions, and those passed through verbatim:AIza…, e.g.GEMINI_API_KEY=AIza…);sk_live_…,rk_test_…). The underscore form doesn't match thesk-pattern;hf_…);OPENROUTER_API_KEY=…orSENTRY_AUTH_TOKEN: "…".Fix
_API_KEY | _SECRET | _SECRET_KEY | _ACCESS_TOKEN | _AUTH_TOKEN | _TOKENassignment pattern. It keeps the variable name and replaces only the value. It skips:- values that are already redacted;
- variable references (
$X,${{ secrets.X }});- unquoted values shorter than 8 characters (
CSRF_TOKEN=on);- names like
MAX_TOKENS.Tests
Two new cases in
test/redaction.test.js:main;${{ secrets… }},$VAR,MAX_TOKENS=4096andCSRF_TOKEN=onare left unchanged.npm test(153), lint, typecheck andnpm run checkpass. A 100 KB adversarial input redacts in about 1 ms, so there's no regex blow-up.The gap was found in a manual review assisted by AI (an AI coding agent working on Mangesh's behalf).
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/mangeshraut712/codex-insights/pull/32" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->