Problem
UnsafeRelaxedJsonEscaping is used for local JSONL sinks. The current comments say these streams are local-only, but the safety boundary is implicit and could be weakened by future reuse.
Evidence
Mcp/AuditLogSink.cs configures JavaScriptEncoder.UnsafeRelaxedJsonEscaping.
Cli/MetricsSink.cs configures JavaScriptEncoder.UnsafeRelaxedJsonEscaping.
- Both appear intended for local append-only JSONL, not HTML or remote embedding.
Suggested fix
- Centralize or clearly name the local-only JSONL serializer options.
- Add comments/tests that assert these options are not used for HTTP responses, HTML contexts, or externally embedded JSON.
- Consider a small guard or type distinction for local telemetry/audit JSONL output.
Problem
UnsafeRelaxedJsonEscapingis used for local JSONL sinks. The current comments say these streams are local-only, but the safety boundary is implicit and could be weakened by future reuse.Evidence
Mcp/AuditLogSink.csconfiguresJavaScriptEncoder.UnsafeRelaxedJsonEscaping.Cli/MetricsSink.csconfiguresJavaScriptEncoder.UnsafeRelaxedJsonEscaping.Suggested fix