Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion plugins/codex-lcm/src/redact-assignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export function isBenignTokenMetric(key: string, value: unknown): boolean {
}

export function shouldRedactSecretKey(key: string, value: unknown): boolean {
return isSecretAssignmentKey(key) && !isBenignTokenMetric(key, value);
const parts = keyParts(key);
return isSecretAssignmentKey(key) &&
!isBenignTokenMetric(key, value) &&
!(typeof value === "boolean" && parts.length === 1 && parts[0] === "private");
}

function redactSecretAssignmentLine(value: string, path: string, redactions: RedactionRecord[]): string {
Expand Down
7 changes: 7 additions & 0 deletions plugins/codex-lcm/tests/redact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ test("redacts secret-like object keys recursively", () => {
assert.equal(result.truncations.length, 0);
});

test("preserves a benign private package flag", () => {
const result = sanitizeForStorage({ private: true });

assert.deepEqual(result.value, { private: true });
assert.equal(result.redactions.length, 0);
});

test("preserves benign token budget and count metadata", () => {
const result = sanitizeForStorage({
token_budget: 1200,
Expand Down