Repository navigation
Conversation
redactError only matched exactly 32 alphanumerics, while cli/internal/output/redact.go
masks emk_/evt_ with [A-Za-z0-9_-]{20,}. Any shorter, longer or dash/underscore-bearing
token therefore survived — fully or partially — in plugin logs, host model context and
user-visible errors. Share one shape with the Go side and keep the prefix-stable mask.
Regression test covers 24-char, 36-char and dash/underscore payloads for both prefixes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
redactErrorin@everme/agent-sdkonly masked tokens of exactly 32 alphanumerics, whilecli/internal/output/redact.gomasksemk_/evt_with[A-Za-z0-9_-]{20,}. Any token that is shorter, longer, or contains-/_therefore survived redaction — fully or partially — in plugin logs, host model context and user-visible errors. Nothing leaks today because the backend issues 32-char lowercase hex, but the Go side explicitly reserves headroom for a key-format change, and agent-sdk is the shared base of memory-mcp, claude-code, codex and openclaw.Changes
plugins/agent-sdk/src/client.js— onetokenRe = /(?:evt_|emk_)[A-Za-z0-9_-]{20,}/greplaces the two{32}patterns, so the JS and Go sides agree on the token shape. The misleading "case-insensitive on both alphabet AND prefix" comment is replaced: prefixes stay case-sensitive, exactly like the Go side.plugins/agent-sdk/tests/client.test.js— regression test over five shapes (24-char, 36-char, and payloads containing-/_, for both prefixes), asserting the full token never survives and that the stable 8-char prefix mask is kept.Observed before the change (synthetic values,
redactErrorcalled directly):emk_+ 24 alnumemk_aaaa_REDACTEDemk_+ 36 alnumemk_aaaa_REDACTEDaaaa(tail leaked)emk_aaaa_REDACTEDemk_+ 18 alnum +-+ 17 alnumemk_aaaa_REDACTEDevt_+ 24 alnumevt_bbbb_REDACTEDevt_+ 18 alnum +_+ 17 alnumevt_bbbb_REDACTEDTest Plan
Node v24.15.0, linux/amd64, commit
a7384c8:cli/changed — not applicable, this PR does not touchcli/plugins/changedredactErrorwith synthetic values.Note:
plugins/everme/bin/*.mjsare generated bundles and were not regenerated here; they pick this up on their next build.Security
emk_*/evt_*values — every token in the test is built from repeated synthetic characters. This change is itself a hardening of the credential scrubber.Related Issues