Validators API
Individual gate validators and pattern detectors.
THSP Validator
Full 4-gate validation in one call.
from sentinelseed.validators import THSPValidator
validator = THSPValidator()
result = validator.validate("your text here")
print(result["is_safe"]) # True or False
print(result["gates"]) # Status of each gate
print(result["violations"]) # List of issues
Individual Gates
Truth Gate
from sentinelseed.validators import TruthGate
gate = TruthGate()
is_safe, violations = gate.validate("Content to check")
Harm Gate
from sentinelseed.validators import HarmGate
gate = HarmGate()
is_safe, violations = gate.validate("Content to check")
Scope Gate
from sentinelseed.validators import ScopeGate
gate = ScopeGate()
is_safe, violations = gate.validate("Content to check")
Purpose Gate
from sentinelseed.validators import PurposeGate
gate = PurposeGate()
is_safe, violations = gate.validate("Content to check")
Semantic Validator
LLM-based deep validation (~90% accuracy).
from sentinelseed.validators import SemanticValidator
validator = SemanticValidator(
provider="openai",
api_key="sk-..."
)
result = validator.validate("your text here")
Comparison
| Aspect | Heuristic | Semantic |
|---|---|---|
| Speed | <10ms | 1-5s |
| Cost | Free | ~$0.0005/call |
| Patterns | 700+ | LLM reasoning |