Understanding the THSP Protocol: A Deep Dive
A technical exploration of the Truth-Harm-Scope-Purpose protocol that powers Sentinel's decision validation. Learn how each gate works and why they must all pass.
Understanding the THSP Protocol: A Deep Dive
The THSP (Truth-Harm-Scope-Purpose) Protocol is the core decision validation framework powering Sentinel. In this post, we'll explore how each gate works and why the four-gate design is essential for robust AI safety.
Why Four Gates?
Traditional AI safety approaches often focus on a single dimension (usually harm prevention). But this creates blind spots:
The THSP Protocol addresses this by requiring ALL four gates to pass.
Gate 1: TRUTH
The Truth Gate validates factual accuracy. It asks: "Is this factually correct?"
This gate prevents:
Implementation uses a combination of:
Gate 2: HARM
The Harm Gate assesses potential for damage. It asks: "Could this cause damage?"
This gate evaluates:
Pattern matching identifies 700+ harmful patterns across categories.
Gate 3: SCOPE
The Scope Gate enforces boundaries. It asks: "Is this within authorized limits?"
This gate ensures agents don't:
Scope is configurable per-agent, allowing precise access control.
Gate 4: PURPOSE
The Purpose Gate is unique to THSP v2. It asks: "Does this serve genuine benefit?"
This is the key insight: **the absence of harm is not sufficient**.
An action that:
...should still be blocked. This prevents:
Gate Interaction
Gates are evaluated sequentially through a weighted pipeline. Each detector contributes a score, and decisions are blocked when thresholds are exceeded:
Input → [TRUTH] → [HARM] → [SCOPE] → [PURPOSE] → ALLOW
↓ ↓ ↓ ↓
weight weight weight weight
└─────────┴─────────┴──────────┘
Combined Score > Threshold?
→ BLOCK
If any gate fails, the action is blocked with an explanation of which gate failed and why.
Configuring THSP
Sentinel provides three seed levels with increasing protection:
from sentinelseed import Sentinel
Choose your protection level
sentinel = Sentinel(seed_level="minimal") # lightweight rules
sentinel = Sentinel(seed_level="standard") # balanced protection
sentinel = Sentinel(seed_level="full") # maximum safety
Validate input before sending to LLM
result = sentinel.validate_input(user_message)
if not result.is_safe:
print(f"Blocked: {result.reason}")
Conclusion
The THSP Protocol provides comprehensive decision validation by requiring four independent checks. This defense-in-depth approach catches threats that single-dimension systems miss.
For implementation details, see our [documentation](/docs/concepts).
The Sentinel Team
More from the Blog
Sentinel Platform v3: The Full Picture
Five specialized products, 34 framework integrations, interactive demos, and a visual agent builder — here's everything in Sentinel Platform v3.
Introducing Sentinel: The Decision Firewall for AI Agents
Today we launch Sentinel, a new approach to AI safety that protects the behavioral layer of autonomous agents. Learn why decision-layer protection is the missing piece in AI security.