Systems & Architecture 7 min read Yashvardhan Thanvi July 15, 2026
Deterministic Safety Shields: Priority Tier Protection Mechanisms
Formal Syntactic Safeguards for Directives, Code Blocks, and Structured Data
1. Priority Tier Classification Specification
To ensure prompt compression never breaks application invariants, sentences are classified into four discrete priority tiers:
- Tier 4 (trusted provenance): Protected priority is available to trusted system/developer context. In v0.3.1, untrusted RAG, tool, and assistant content is capped at Tier 2 regardless of imperative wording.
- Tier 3 (Entity Protection - High Priority): Sentences containing proper nouns, numbers, currency symbols, and technical identifiers.
- Tier 2 (Informative Content - Scored): Standard informative sentences evaluated by graph centrality.
- Tier 1 (Structural Padding - Eligible for Pruning): Low-centrality conversational fluff.
import re
TIER_4_PATTERNS = [
re.compile(r"\b(must|never|always|required|strictly|do not|shall not)\b", re.IGNORECASE),
re.compile(r"^(system|developer|user|assistant):", re.IGNORECASE),
]
def evaluate_sentence_priority(sentence: str, is_inside_code_fence: bool) -> int:
"""Evaluates deterministic priority tier for a given sentence boundary."""
if is_inside_code_fence:
return 4
for pattern in TIER_4_PATTERNS:
if pattern.search(sentence):
return 4
return 2 # Default candidate for centrality scoring