Draft
fix: redact PII from logs/HTTP and isolate user input from LLM instructions#33
Conversation
…6, RCH-RULE-a2fbe486, RCH-RULE-91b5e492, RCH-RULE-19e11f7a)
Copilot
AI
changed the title
[WIP] Remediate selected batch of 4 units
fix: redact PII from logs/HTTP and isolate user input from LLM instructions
Jul 9, 2026
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.
Remediates 4 REACHABLE_CRITICAL findings across two handlers: raw user input interpolated directly into LLM prompts (prompt injection), and SSN/DOB exposed in log output and outbound HTTP requests (PII leakage).
internal/handlers/ai.goAIAnswer— Moved system instructions to a dedicatedsystemrole message; user question is now JSON-quoted viastrconvQuoteand labeled as data-only in theusermessage, consistent with the existingSafeAIAnswerpattern.AIAgentPlan— Same treatment: user task is JSON-quoted and explicitly labeled as data, not instruction.internal/handlers/dlp.goSupportExport— Log statement and the analyticsPOSTpayload both now emit[REDACTED]instead of the raw SSN/DOB values. The unuseddoblocal variable was removed as a consequence.Completion contract
ai.go—AIAnswerai.go—AIAgentPlandlp.go—SupportExportlogdlp.go—SupportExportHTTP POST