Enforcement Pipeline

Unified enterprise enforcement gate — RBAC, quota, policy, analytics, and anomaly detection in a single call.

The enforcement pipeline is the primary entry point for enterprise governance. It chains 6 stages in a single enforce() call: RBAC, quota, policy evaluation, incident creation, analytics recording, and anomaly detection.

Setup

ts

Pipeline Stages

The pipeline runs these stages in order. If any stage blocks, subsequent stages are skipped:

  1. RBAC: Checks if the caller has the required permission for the action. Default permission: agents:write.
  2. Quota: Verifies the tenant hasn't exceeded their plan's enforcement quota. Fail-open if quota service is unavailable.
  3. Policy: Delegates to the core gov.enforce() — evaluates all policy rules against the proposed action.
  4. Incident: If the action was blocked by policy, auto-creates an incident record (unless noAutoIncident is set).
  5. Analytics: Records the enforcement event for fleet analytics dashboards.
  6. Anomaly: Ingests the event into the anomaly detector for behavioral analysis.

Usage

ts

Blocked Result

ts

Types

ts

Stats

ts

Skipping Stages

For lightweight deployments or testing, skip individual stages:

ts