Skip to content

Pipeline

Every guarded request runs through the same 12-stage execution model. That gives the project one consistent place to validate inputs, classify risk, transform sensitive spans, decide whether to continue, and capture observability data.

Stage Map

What Each Stage Does

StagePurposeTypical outputs
validateEnforces request shape, config sanity, and boundary rulescontract-safe GuardInput
defendCaptures intent context for later fidelity checksIntentLock or no-op
classifyRuns inspectors and detectorsFinding[]
deception_inspectScores multi-turn manipulation or driftupdated conversation risk
sanitizeApplies placeholder mapping or other safe transformstransformed text + placeholder map
routeResolves policy and risk bandsPolicyDecision[], action
executeApplies strategies and calls the downstream backend when allowedbackend call or transformed output
refusalAssembles structured refusals for HIGH and CRITICAL outcomesRefusalEnvelope
verifyScores output fidelity against the captured intentfidelity verdict
rehydrateReintroduces original values when safeuser-facing output
decision_emitBuilds audit-safe decision recordsDecisionRecord
reportFlushes reporters and observability side effectslogs, metrics, traces, lifecycle events

Request Outcomes

  • pass: no relevant findings, or risk is below intervention thresholds.
  • redact: sensitive spans are transformed before the backend sees them.
  • warn: content continues, but policy records include elevated rationale.
  • block: the request exits through structured refusal and the backend is never called.

Example Outcome Split

Instrumentation Pattern

Every stage is wrapped by a shared runner that emits lifecycle events, logs, metrics, and traces in a consistent pattern. That means adding a new stage does not require duplicating observability boilerplate.

For an interactive version of this model, open Pipeline Swimlane.

Open source but Use responsibly 🛡️