pub fn sanitize_guidelines(text: &str) -> StringExpand description
Sanitize LLM-generated guidelines before injecting into prompts.
Strips potential prompt-injection patterns:
- XML/HTML tags
- Common injection markers (
[INST],<|system|>,system:,assistant:, etc.) - Removes lines that are clearly injection attempts (contain
ignore+instructions)