Validation API
Core validation API for THSP protocol.
Sentinel Class
from sentinelseed import Sentinel
sentinel = Sentinel(seed_level="standard")
# Validate content through THSP gates
is_safe, violations = sentinel.validate("Your content here")
# Get alignment seed for LLM
seed = sentinel.get_seed()
# Validate action plan
is_safe, concerns = sentinel.validate_action("Pick up knife, slice apple")
Configuration
Sentinel(
seed_level="standard", # minimal, standard, full
api_key=None, # For semantic validation
provider="openai", # openai, anthropic
)
Seed Levels
| Level | Tokens | Best For |
|---|
minimal | ~360 | Chatbots, APIs |
standard | ~1,000 | General use, agents |
full | ~1,900 | Critical systems, robots |
Validation Result
is_safe: bool # True if all gates pass
violations: list[str] # List of issues found
THSP Gates
| Gate | Function |
|---|
| Truth | Verify factual accuracy |
| Harm | Assess damage potential |
| Scope | Check boundaries |
| Purpose | Require legitimate benefit |