Skip to main content

What Are Validators in TruGuard?

In TruGuard, validators are the core building blocks used to inspect, assess, and enforce trust and safety rules on AI inputs and outputs. Conceptually, a validator is an automated check that evaluates AI interactions against a specific risk dimension—such as security, safety, privacy, or policy compliance—and determines whether the content is acceptable or requires remediation. Validators do not generate or modify AI responses by themselves. Instead, they act as decision points in the AI request–response lifecycle, enabling TruGuard to:
  • Detect risks early
  • Apply consistent enforcement
  • Maintain observability and auditability across AI systems

Role of Validators in the TruGuard Pipeline

Validators operate as guardrails around AI systems. They can be applied to:
  • Inputs (user prompts, system instructions)
  • Outputs (model-generated responses)
Each validator evaluates content independently and produces a validation outcome. These outcomes can then trigger actions such as filtering, masking, encryption, or failure handling. This modular approach allows TruGuard to combine multiple validators into a layered protection system rather than relying on a single safety mechanism.

Regex Validator

A Regex (Regular Expression) validator enforces rules by matching text against defined patterns. At a conceptual level, it acts as a deterministic filter that checks whether content conforms to or violates specific syntactic rules. Regex validators are rule-based and precise. They do not rely on probabilistic models or context, which makes them predictable and fast. However, they only detect patterns that are explicitly defined and cannot infer meaning beyond the structure of the text. What It Protects Against:
  • Accidental leakage of structured identifiers (API keys, tokens, IDs)
  • Invalid or malformed inputs
  • Disallowed formats or command patterns

Blocklist Validator

A Blocklist validator scans content for explicitly disallowed words or phrases. Conceptually, it represents a lexical filter that prevents known-bad or undesired language from passing through the system. Unlike regex validators, blocklists focus on semantic units (words and phrases) rather than structural patterns. They are simple, transparent, and easy to maintain, but require ongoing updates to remain effective. What It Protects Against
  • Profanity and abusive language
  • Brand-sensitive or restricted terms
  • Organization-specific forbidden vocabulary

Content Moderation Validator

A Content Moderation validator evaluates content against safety categories such as violence, hate, self-harm, or sexual content. Conceptually, it relies on machine learning classifiers to assess the meaning and intent of text rather than its exact wording. This validator operates probabilistically, producing confidence scores for each category. Thresholds are then used to decide whether content is acceptable or should be restricted. What It Protects Against
  • Harmful or unsafe content
  • Policy violations and regulatory risks
  • Misuse of AI in sensitive domains

Prompt Injection Validator

A Prompt Injection validator is designed to detect attempts to manipulate an AI system’s behavior by overriding, bypassing, or subverting its intended instructions. Conceptually, it analyzes whether user input attempts to change system roles, reveal hidden instructions, or introduce conflicting directives. This validator focuses on control integrity rather than content safety. What It Protects Against
  • System prompt disclosure
  • Instruction hijacking and role manipulation
  • Jailbreaks and policy bypass attempts

PII Detection Validator

A PII (Personally Identifiable Information) validator identifies data that can be used to directly or indirectly identify an individual. Conceptually, it combines pattern matching, linguistic analysis, and statistical models to recognize sensitive entities. Rather than blocking content outright, PII detection is often paired with downstream actions such as masking, redaction, or encryption. What It Protects Against
  • Accidental exposure of personal data
  • Privacy violations and compliance risks
  • Data leakage through AI responses