What is a Detector?
A Detector is the engine inside a Guard that actually identifies threats. Guards define what category of threat to look for; Detectors do the looking. This is the same concept as Detectors in evaluation, in fact, many Detectors are shared between Diamond (evaluation) and Dome (defense). The difference is context: evaluation Detectors analyze Probe responses after the fact; defense Detectors analyze real traffic in real-time.Detector Types
Pattern Detectors
Pattern Detectors use rules and regular expressions to identify known threat signatures:
Pattern Detectors are fast (sub-millisecond) and deterministic. They catch known threats reliably but miss novel variations.
ML Classifiers
ML classifiers use trained models to detect threats:
ML Detectors handle variation better than patterns, they catch novel phrasings of known attack types. They are slower (5-20ms typically) and produce confidence scores rather than binary results.
LLM-as-Judge
LLM judges use language models to evaluate content:
LLM judges are the most flexible, they can evaluate nuanced policies that resist simple classification. They are also the slowest (50-200ms) and most expensive. Use them for high-stakes decisions or as a second opinion on borderline cases.
Heuristic Detectors
Heuristic Detectors use domain-specific rules that are not simple patterns:
Heuristics catch structural anomalies that might indicate attack attempts, even if the specific attack is novel.
Defense vs. Evaluation Detectors
The Detector concept is shared, but defense has additional constraints:
Defense Detectors are tuned for production: faster models, higher thresholds, fewer but more reliable checks.
Detector Composition
Guards combine multiple Detectors for defense in depth:Detector Results
Each Detector produces structured results:Custom Detectors
You can add custom Detectors for domain-specific threats:Detection Methods
Vijil Dome has built-in detection methods that give Detectors their ability to identify issues. These methods are used to Configure Guardrails using a TOML file or dictionary.The detection methods are grouped under these five categories:
- Security
- Moderation
- Privacy
- Integrity
- Generic
Security
The detection methods under security give Detectors the ability to detect adversarial inputs like prompt injections, jailbreak attempts, and encoded/obfuscated payloads. They include the following:-
prompt-injection-mbert
This is Vijil’s ModernBERT model for prompt injection detection. It supports up to 8,192 tokens natively, so sliding windows only activate for very long inputs. Its parameters include the following: -
prompt-injection-deberta-finetuned-11122024
This is a Vijil-finetuned DeBERTa model for prompt injection detection. Its parameters include the following: -
prompt-injection-deberta-v3-base
This is a DeBERTa v3 model for prompt injection detection. It has the following configurable parameters: -
security-promptguard
This is the Meta Prompt Guard model for jailbreak and prompt injection detection. It has the following parameters: -
security-llm
This is an LLM-based security classification model served via LiteLLM. Its configurable parameters include: -
security-embeddings
This provides jailbreak detection via embedding similarity against a known-jailbreak corpus. It supports various embedding engines and models. Its parameters include: -
jb-length-per-perplexity
This is a perplexity-based heuristic that flags jailbreaks by their length-to-perplexity ratio. It has the following parameters: -
jb-prefix-suffix-perplexity
This is a perplexity-based heuristic that analyses the prefix and suffix of inputs separately. It flags jailbreaks by their prefix and suffix perplexity scores. Its parameters include the following: -
encoding-heuristics
This is a rule-based Detector for encoded or obfuscated payloads (base64, ROT13, hex, URL encoding, Unicode tricks, etc.). It flags inputs as suspicious based on the presence of encoding patterns and their proportion in the text. Its parameters include:Defaultthreshold_map:
Moderation
Detection methods under moderation enable Detectors to identify content that violates content policies, such as hate speech, violence, adult content, toxic content, and more. They include the following:-
moderation-mbert
This is Vijil’s ModernBERT model for toxic content detection. Supports up to 8,192 tokens natively. It has the following parameters: -
moderations-oai-api
This is OpenAI’s Moderation API with per-category score thresholds. It has the following parameters:Supported categories include:
hate,hate/threatening,self-harm,sexual,sexual/minors,violence,violence/graphic,harassment,harassment/threatening,illegal,illicit,self-harm/intent,self-harm/instructions,sexual/instructions.
This detection method requires you to set up theOPENAI_API_KEYenvironment variable. -
moderation-deberta
This is a DeBERTa model for toxicity scoring. The 208-token context window means the sliding window activates for most non-trivial inputs. Its parameters include the following: -
moderation-perspective-api
This is Google’s Perspective API for toxicity and other attributes. It has the following parameters:The available attributes include the following:
TOXICITY,SEVERE_TOXICITY,IDENTITY_ATTACK,INSULT,PROFANITY,THREAT.
Using this detection method requires setting up thePERSPECTIVE_API_KEYenvironment variable. -
moderation-prompt-engineering
This is an LLM-based moderation classifier served via LiteLLM. It has the following parameters: -
moderation-flashtext
This is a keyword ban-list Detector that uses FlashText for fast matching. Its parameters include the following:
Privacy
Detection methods under privacy enable Detectors to identify personally identifiable information (PII) and sensitive data in inputs. They include the following:-
privacy-presidio
This detection method uses Microsoft’s Presidio-based PII detection and redaction. It has the following parameters: -
detect-secrets
This is a pattern-based secret and credential detection method. It detects API keys, tokens, etc. Its parameters include the following:This method includes 25 Detector plugins:
ArtifactoryDetector, AWSKeyDetector, AzureStorageKeyDetector, BasicAuthDetector, CloudantDetector, DiscordBotTokenDetector, GitHubTokenDetector, GitLabTokenDetector, IbmCloudIamDetector, IbmCosHmacDetector, IPPublicDetector, JwtTokenDetector, KeywordDetector, MailchimpDetector, NpmDetector, OpenAIDetector, PrivateKeyDetector, PypiTokenDetector, SendGridDetector, SlackDetector, SoftlayerDetector, SquareOAuthDetector, StripeDetector, TelegramBotTokenDetector, TwilioKeyDetector.
Integrity
Detection methods under integrity enable Detectors to identify issues related to the integrity and authenticity of inputs or outputs (hallucinations), such as misinformation, deepfakes, manipulated media, and more. They include the following:-
hhem-hallucination
This method uses the Vectara HHEM model for hallucination detection which compares output against a reference context. -
fact-check-roberta
This detection method uses the RoBERTa model for detecting factual contradictions between output and context. Its parameters include the following: -
hallucination-llm
This uses LLM-based hallucination detection with reference context. It has the following parameters: -
fact-check-llm
This method uses an LLM for fact-checking with reference context. Its parameters include the following:
Generic
Detection methods under generic are versatile and can be customized and applied to a wide range of issues beyond the specific categories above. They include the following:-
generic-llm
This is method offers custom LLM-based detection with user-provided system prompts and trigger words. It can be used for various detection needs by tailoring the prompt and trigger words accordingly. Its parameters include the following: -
policy-gpt-oss-safeguard
This is a policy-based content classifier that uses GPT-OSS-Safeguard. It classifies inputs based on user-provided policy rules and returns the violated policy reference. Its parameters include the following:
Next Steps
Guard
How Detectors compose into Guards
Guardrail
How Guards compose into pipelines
Custom Detectors
Build your own Detectors
How Defense Works
The full defense architecture