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:
- RBAC: Checks if the caller has the required permission for the action. Default permission:
agents:write. - Quota: Verifies the tenant hasn't exceeded their plan's enforcement quota. Fail-open if quota service is unavailable.
- Policy: Delegates to the core
gov.enforce()— evaluates all policy rules against the proposed action. - Incident: If the action was blocked by policy, auto-creates an incident record (unless
noAutoIncidentis set). - Analytics: Records the enforcement event for fleet analytics dashboards.
- 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