Skip to Content
ConceptsConcepts Overview

Concepts Overview

Govrix Scout enforces compliance and policy on every token that flows through the proxy. The five core concepts below form the foundation of how it works.

All features listed here are implemented and active in the OSS Scout build. No feature is SaaS-only or a stub.

Feature summary

ConceptWhat it doesStatus
Session ForensicsAttaches session ID, timestamp, SHA-256 Merkle lineage hash, and compliance tag to every event for immutable audit trailsActive
PII DetectionDetects 5 PII types (email, phone, SSN, credit card, IP address) in request and response payloads in under 1msActive
Kill SwitchBlocks any agent instantly at the proxy hot path — no redeploy required — returning HTTP 403Active
Budget EnforcementEnforces per-agent and global daily token/cost caps; persisted in budget_daily table; returns HTTP 429 when exceededActive
YAML Policy EngineEvaluates declarative YAML rules (6 operators, 5 fields, 3 actions) against every request/responseActive

How the pieces fit together

Every request that enters the proxy on port 4000 goes through the following sequence:

  1. Kill switch checkinterceptor.rs queries the agent registry; blocked agents are rejected immediately with HTTP 403.
  2. Budget check — in-memory counters (loaded from budget_daily at startup) are compared against per-agent and global caps.
  3. Policy evaluation — the YAML policy engine evaluates all matching rules against the request fields.
  4. PII scan — request payload is scanned for the 5 PII types; the pii_detected flag is set on the event.
  5. Upstream forward — the request is forwarded to the LLM provider; the response is streamed back to the caller.
  6. Event write — an AgentEvent is emitted fire-and-forget to the bounded channel; the background batch writer persists it to PostgreSQL within 100ms.
  7. Session recordSessionRecorder appends the event to the session trace.

The critical constraint is that steps 1 and 2 are the only ones that can return an error to the caller. Steps 6 and 7 are never awaited on the hot path.

Last updated on