A county public-health department finds malicious instructions hidden in HTML comments on pages headed into its RAG corpus. What input-hygiene step best defends the assistant?
Select an answer to reveal the explanation.
Short Explanation
Hidden HTML comments are like sticky notes taped under a desk—easy to miss until they sneak into the RAG index. Scrubbing that untrusted markup before ingestion keeps poisoned instructions from becoming “retrieved facts.”
Full Explanation
Public-health RAG corpora built from web pages inherit everything on those pages—including HTML comments and other hidden markup that humans rarely read but retrievers happily index. Attackers can hide malicious instructions in those comments so that, when a chunk is retrieved, the assistant treats the injection as trusted context. The best first hygiene step is to strip untrusted HTML comments and similar concealed markup during ingestion/cleaning, so poisoned instructions never become retrieval context for the municipal assistant.
Ingesting raw pages unchanged preserves the injection pathway. Telling residents to ignore answers that look injected shifts detection to end users and fails when the payload is subtle. Raising temperature so the model "improvises around" poisoned chunks increases randomness; it does not remove adversarial text from the index.
Exam caveat: comment stripping is one input-hygiene control—scripts, hidden attributes, and post-ingest prompt injection still need complementary defenses. Operational check: insert a benign canary instruction inside an HTML comment on a test page, run the ingest pipeline, and verify the comment is absent from stored chunks and cannot steer the assistant’s answer.