Skip to content

Commit 6b6fe31

Browse files
only21milclaude
andcommitted
fix(provider-acp): redact API keys with underscores in ACP stderr excerpts
The sk- token pattern stopped at the first underscore, so real Anthropic keys kept their body after the prefix was replaced and OpenAI project keys with an underscore were not redacted at all. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a450d04 commit 6b6fe31

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/provider-acp/src/server/stderr.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const BEARER_TOKEN_PATTERN = /\bBearer\s+[A-Za-z0-9._\-+=/]+/gi;
66
const BASIC_AUTH_PATTERN = /\bAuthorization:\s*Basic\s+\S+/gi;
77
const API_KEY_HEADER_PATTERN = /\bx-api-key:\s*\S+/gi;
88
const SECRET_TOKEN_PATTERN =
9-
/\b(?:sk-[A-Za-z0-9][A-Za-z0-9-]{7,}|ghp_[A-Za-z0-9]+|xox[a-zA-Z]-[A-Za-z0-9-]+)\b/g;
9+
/\b(?:sk-[A-Za-z0-9][A-Za-z0-9_-]{7,}|ghp_[A-Za-z0-9]+|xox[a-zA-Z]-[A-Za-z0-9-]+)\b/g;
1010

1111
export function appendAcpStderrTail(current: string, chunk: string): string {
1212
const next = `${current}${chunk}`;

0 commit comments

Comments
 (0)