You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: debug console.log leaks tool call data in production #11
Severity: P0 — Critical Category: Security / Data Leak Files: All source files (35+ occurrences)
Problem
35+ uncontrolled console.log/warn/error calls across the codebase with no log level control, no suppression mechanism, and at least one direct data leak.
Data Leak
anthropic.ts:492:
console.log('Tool calls detected in Anthropic response:',response.toolCalls);
This dumps full tool call payloads — potentially containing user data, function arguments, PII — into worker logs on every Anthropic tool-use response.
Log Pollution
The library is consumed by other applications. Every console.log in the circuit breaker, factory, and retry manager pollutes the consumer's stdout with no way to:
Suppress logs
Filter by level
Redirect to a custom logger
Disable in production
Locations (non-exhaustive)
File
Count
Examples
factory.ts
14
Provider init, chain selection, failures
circuit-breaker.ts
11
State transitions, decay, reset
base.ts
2
Request success/failure
anthropic.ts
2
SSE parse error, tool call data leak
openai.ts
1
SSE parse error
cerebras.ts
1
SSE parse error
groq.ts
1
SSE parse error
cost-tracker.ts
1
Warning
credit-ledger.ts
2
Restore warning, listener error
retry.ts
1
Retry attempt
Fix
Immediate: Remove console.log at anthropic.ts:492 (data leak)
Structural: Introduce a Logger interface with debug/info/warn/error levels
Accept an optional logger in config, default to no-op
Activity