Template Backend
The template backend is Sentinel’s default narrative generator. It uses deterministic rules to produce structured assessments from telemetry data — no ML models, no external dependencies, sub-millisecond latency.
How It Works
Section titled “How It Works”The template backend processes the SentinelTelemetryFeed through a rule-based assessment pipeline:
- Gamma analysis — computes headroom, trend direction, and proximity to floor
- Warning trend analysis — examines the historical window for escalating patterns
- Steps-to-impact assessment — evaluates urgency from the escalation context
- Risk level classification — combines signals into
NOMINAL,ELEVATED, orCRITICAL - Narrative assembly — generates a human-readable summary from structured templates
- Highlight extraction — selects the most important metrics for the operator
Risk Classification Rules
Section titled “Risk Classification Rules”The template backend classifies risk based on these signals:
| Signal | NOMINAL | ELEVATED | CRITICAL |
|---|---|---|---|
| Gamma headroom | > 25% | 5–25% | < 5% |
| Warning trend | Stable or decreasing | Increasing | Rapidly increasing |
| Steps to breach | > 10 | 3–10 | < 3 |
| Loss event in window | No | No | Yes |
Multiple signals are combined — a CRITICAL from any single signal elevates the overall assessment to at least ELEVATED.
Narrative Generation
Section titled “Narrative Generation”The template backend constructs narratives from pre-defined sentence templates, parameterized with actual telemetry values:
- Opening — overall stability assessment based on risk level
- Gamma state — current gamma, floor, and headroom percentage
- Warning trend — describes the trajectory over the historical window
- Urgency — steps-to-breach and escalation type context
- Recommendation — action guidance based on the escalation type
Example output at CRITICAL:
System stability is deteriorating rapidly. Gamma has dropped to 0.250 against a floor of 0.200, leaving only 5.0% headroom. Warning criticality has escalated from 0.0 to 0.75 over the last 3 ticks, with impact projected in 3.0 steps. Immediate operator review recommended.
Example output at NOMINAL:
System stability is within normal parameters. Gamma is at 0.650 with comfortable headroom above the 0.200 floor. This escalation appears precautionary — no immediate action required.
Characteristics
Section titled “Characteristics”| Property | Value |
|---|---|
| Determinism | Fully deterministic — same input always produces same output |
| Latency | Sub-millisecond (typically < 1ms) |
| Dependencies | None beyond kairos-engine-core types |
| Feature flag | Always available (no feature gate) |
| Backend identifier | template in SentinelSummary.backend |
When to Use Template
Section titled “When to Use Template”The template backend is the right choice when:
- Determinism is required — you need reproducible assessments for audit trails
- Latency is critical — sub-millisecond response time
- No model infrastructure — you don’t want to manage model bundles
- Deployment simplicity — zero additional dependencies
For richer, more contextual narratives, see the SLM backend.