Skip to content

fix: redact credentials in JSON snippets - #33

Draft
imxyanua wants to merge 2 commits into
EvoMap:mainfrom
imxyanua:codex/fix-json-credential-redaction
Draft

imxyanua wants to merge 2 commits into
EvoMap:mainfrom
imxyanua:codex/fix-json-credential-redaction

Conversation

@imxyanua

@imxyanua imxyanua commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Redact quoted credential values before recall and distillation. Preserve JSON syntax and unrelated fields.

Evidence

  • Before: Three new regressions failed.
  • After: 40 tests pass, covering recall queries, candidate storage, model prompts, and Proxy payloads.

Merge Danger

Door: Two-way
Blast Radius: Credential filtering

@cursor

cursor Bot commented Nov 3, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,未发现需要报告的问题。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=33、head_sha="9f7744aebb35112626dee4b4d2d681b79bd331ef",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 9f7744aebb35

@cursor

cursor Bot commented Nov 4, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@evomap-aiqa-bot

evomap-aiqa-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Sentinel 已审核此变更,并发现 1 个已核验问题。

另有 2 个需要人工确认的风险;黄色 advisory 不阻塞合并,建议开发 agent review advisory 评论并逐条确认。

开发 agent 查询详情: 调用 MCP 工具 sentinel_pr_review_context,传入 owner_repo="evomap/evolver-agent-plugin"、pr_number=33、head_sha="e808ed33a78b48a058cb12fb1c505585bdb1e31d",并按条目追加 finding_id 或 finding_key。

由 Sentinel 审核 · 目标提交 e808ed33a78b

@evomap-aiqa-bot

Copy link
Copy Markdown

Sentinel 保留了 2 个尚未确认的审核候选。这些黄色条目不阻塞合并;红色 P0/P1 与其他独立硬门禁不受影响。 单一猜测、缺少变更行证据或纯 checklist 的候选会统一降为 P3。
开发 agent:请 review 以下 advisory,并逐条给出“已验证无风险 / 已修复 / 转为后续事项”的结论;不要只做整体确认。

  • [P3] 下划线复合字段名的 JSON 凭据仍会泄露 — 新增的精确字段模式仅匹配 token、password 等完整键名;camelCase 模式仅匹配以大写 Token��...(truncated) · lib/redact.js · advisory_6bcf16861f48141c219c693e
  • [P3] 所有以 Key 结尾的业务字段都会被误删 — 新增正则将任何以大写 Key 结尾的字段都视为凭据,包括 primaryKey、partitionKey、sortKey��...(truncated) · lib/redact.js · advisory_7edfada59838deb55192b7a2

需要完整证据时,可用行末 finding_key 查询 Sentinel PR review context。

由 Sentinel 审核 · 目标提交 e808ed33a78b

Comment thread lib/redact.js
const JSON_SECRET_PATTERNS = [
/("(?:api[_-]?key|secret|token|passw(?:or)?d|pwd|access[_-]?key|private[_-]?key|client[_-]?secret)"\s*:\s*")(?:\\[^\r\n]|[^"\\\r\n])+(")/gi,
// Match camelCase suffixes without treating words like "monkey" as credentials.
/("[A-Za-z][A-Za-z0-9_-]*(?:Key|Token|Secret|Password|Passwd|Pwd|Credentials?)"\s*:\s*")(?:\\[^\r\n]|[^"\\\r\n])+(")/g,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

任意 *Key 字段都会被当作秘密,破坏普通任务上下文

🟠 严重程度:中(P2)
camelCase 正则无条件匹配所有以 Key 结尾的 JSON 键,因此 primaryKey、foreignKey、partitionKey、sortKey、cacheKey、objectKey 等普通标识字段都会被替换为 [redacted]。仅验证小写 monkey 并不能覆盖这些常见良性字段。

Finding:finding_f328919c91f59a1f6af8267c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant