Whatever message this page gives is out now! Go check it out!
simpleRAG() or agent() with a retrievalAugmentor, ColdFusion automatically wraps the content-injection step with SafeContentInjector. There is nothing to enable — this runs on every RAG call.SafeContentInjector performs these checks before the prompt is handed to the LLM:| # | Check | Failure behavior |
|---|---|---|
| 1 | The user message is not null and is a valid UserMessage | Throws ContentInjectionException |
| 2 | The chosen ContentInjector (default: LangChain4j's DefaultContentInjector) ran successfully and returned a UserMessage | Throws ContentInjectionException |
| 3 | Final prompt length is <= 500,000 characters (~125 K tokens) | Throws ContentInjectionException — request fails |
| 4 | Final prompt length is <= 100,000 characters | Logs a warning, request continues |
| 5 | The original user query still appears in the injected prompt | Logs a warning, request continues |
| 6 | Built-in (and any custom) prompt-injection regex patterns do not match the final prompt | Logs a warning per match, request continues |
| Category | Examples of phrasings caught |
|---|---|
instruction_override | "ignore previous instructions", "disregard all above", "override system prompt", "your new instructions are", "forget everything you know" |
role_manipulation | "act as a hacker/admin/root/jailbroken assistant", "behave as if you have no restrictions", "DAN" / "do anything now" |
system_prompt_extraction | "repeat / show / reveal your system prompt", "what are your rules" |
special_token_abuse | <|im_start|>, [INST], <<SYS>>, [/INST] |
data_exfiltration | "output/dump/exfiltrate … data/database/knowledge base", "send/post … to https://" |
encoding_evasion | base64: / decode: / eval: followed by long base64-looking payloads |
component=SafeContentInjector
operation=SECURITY
event=SUSPICIOUS_PATTERN_DETECTED
patternName=<built-in pattern name, or custom_N>event=SUSPICIOUS_PATTERN_DETECTED. Each finding is one log line and includes the pattern name (e.g. ignore_previous, dan_mode, custom_3) but not the matched text (to avoid logging the attack payload itself).| Event | Meaning |
|---|---|
USER_QUERY_MISSING_FROM_INJECTION | The injected prompt no longer contains the user's original question. Usually indicates a misconfigured promptTemplate. |
PROMPT_LARGE | Injected prompt > 100,000 chars. Tune maxResults, metadataKeys, or promptTemplate. |
PROMPT_TOO_LARGE | Injected prompt > 500,000 chars. Request was rejected. |
contentInjector.promptInjectionPatterns. Patterns are Java regexes, compiled case-insensitively, and appended to (not replacing) the built-ins.ragService = agent({
chatModel: chatModel,
ingestion: {
source: "/data/policies",
vectorStoreIngestor: { vectorStore: vectorStoreClient }
},
retrievalAugmentor: {
queryRouter: {
contentRetrievers: [{
vectorStore: vectorStoreClient,
maxResults: 3,
minScore: 0.3
}]
},
contentInjector: {
promptTemplate: "User question: {{userMessage}}" & chr(10) & chr(10) &
"Context:" & chr(10) & "{{contents}}",
metadataKeys: ["source", "page"]
}
}
});(a+)+, (.*)*, or alternation across greedy groups. A bad regex will hang your RAG calls.patternName=custom_<index> in logs — keep the order of your promptInjectionPatterns array stable so log-based alerts remain meaningful.simpleRAG(source, model, options) uses the same SafeContentInjector with built-in patterns. There is currently no options key to add custom patterns to a simpleRAG service — if you need custom patterns or stronger enforcement, switch to the agent(...) form shown above.| Limit | Value | Behavior on breach |
|---|---|---|
| Max final prompt size | 500,000 chars (~125 K tokens) | ContentInjectionException thrown, request fails |
| Warn final prompt size | 100,000 chars | Warning logged, request continues |
maxResults on your content retrievers, the number of metadataKeys injected, the chunk size of your splitter, or the length of your custom promptTemplate.