Skip to content

fix: redact secrets from audit errors - #21

Merged
haolpku merged 1 commit into
OpenDCAI:mainfrom
DevChiniwala:codex/redact-audit-error-secrets
Sep 20, 2026
Merged

haolpku merged 1 commit into
OpenDCAI:mainfrom
DevChiniwala:codex/redact-audit-error-secrets

Conversation

@DevChiniwala

Copy link
Copy Markdown
Contributor

AuditLogHook redacted secret-shaped argument keys but wrote exception text verbatim. Provider and transport failures can include API keys or bearer tokens, so failed tool calls could persist credentials in audit.jsonl. Added narrow text redaction for key=value/key: value and Bearer formats, plus a regression covering an exception path. Validation: 30 hook tests passed, 5 optional SDK tests skipped; hash-chain behavior remains covered; no API changes; targets main.

Copilot AI lite review requested due to automatic review settings September 17, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@haolpku haolpku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes because the new error-text redaction misses common JSON/dict-shaped diagnostics. For example, {"api_key": "sk-live-secret"} has a quote between the key and colon, so _SECRET_TEXT_RE does not match it. Please cover quoted keys plus credential-shaped raw tokens (at minimum sk-...) and add regression cases for JSON/dict and URL/query-string error text.

@haolpku
haolpku merged commit 5898079 into OpenDCAI:main Sep 20, 2026
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.

3 participants