🏛️ The Three Pillars
Forge governance rests on three pillars that work together as a layered defense:10-gate sequential pipeline. Health, status, concurrency, rate limits, budgets, trust, context, policies.
Condition-based rule engine. Block, require approval, warn, or log. Scoped: global, gateway, agent, env.
Hierarchical budget envelopes. Daily, weekly, monthly periods. Auto-pause on exhaustion.
🛡️ Governance Pipeline
When a workflow step is ready to dispatch, the interpreter calls the governance engine. The engine evaluates a sequence of gates in strict order. If any gate blocks, remaining gates are skipped and the decision is returned immediately. This fail-fast behavior keeps governance evaluation fast — typically completing in single-digit milliseconds.GOVERNANCE PIPELINE
Step ready in DAG. Calls governance engine with full context.
Infrastructure
Lifecycle
Resource Limit
Throughput
Cost Control
Cost Control
Access Control
Provenance
Declarative
HITL
All gates passed. Step proceeds to gateway dispatch.
Gate failed. Step marked failed with structured error code.
Approval required. Execution pauses for human decision.
📋 Gate Summary
Every governance evaluation produces aGovernanceDecision containing the outcome of each gate. Here is the full gate sequence for step dispatch:
| # | Gate | Purpose | Blocks When | Retryable |
|---|---|---|---|---|
| 1 | Gateway Health | Verify the target gateway is operational | Gateway is offline | No |
| 2 | Agent Status | Verify the agent is not paused, terminated, or in error | Agent is paused/terminated/error | Paused only |
| 3 | Concurrency | Enforce per-agent concurrent step limits | Running steps at or above max limit | Yes |
| 4 | Rate Limit | Enforce dispatch rate limits via sliding window | Agent exceeds rate limit | Yes |
| 5 | Agent Budget | Check agent-level monthly budget ceiling | Spent at or above budget limit | No |
| 6 | Envelope Budgets | Check all applicable budget envelopes (global, gateway, agent) | Any envelope exhausted | No |
| 7 | Trust Level | Verify agent trust level meets gateway minimum | Agent trust below gateway minimum | No |
| 8 | Context Trust | Verify dispatch context provenance meets role requirements | Source class rejected or context stale | Freshness only |
| 9 | Policy Rules | Evaluate declarative policies (block/require_approval) | Policy with block action matches | No |
| 10 | Approval Required | Check if HITL approval is required and whether it exists | Policy requires approval and none exists | No |
⚖️ GovernanceDecision
Every governance evaluation produces aGovernanceDecision record. This is the single source of truth for what happened during evaluation and is persisted as an audit event for every dispatch attempt.
The decision includes:
disposition—pass,block, orholdgates— Outcome of every gate (pass, fail, or skipped with reason)blockedBy— When blocked: gate name, error code, message, and whether the failure is retryableheldBy— When held: policy name, policy ID, and trigger that caused the holdbudgetSnapshot— Current spend and limits for the agent and all envelopestrustSnapshot— Agent trust level and gateway minimum requirementcontextTrustSnapshot— Role trust config vs dispatch provenance evaluationscopeConstraints— Role-derived constraints (environments, tool allow/deny lists, data access)actorIdentity— Structured identity envelope for the actorroleSnapshot— Resolved role ID, name, and autonomy tierexplanation— Structured explanation with reasons and unblock hintsevaluatedAt/durationMs— Timestamp and evaluation duration
📋 Audit Trail
EveryGovernanceDecision is persisted in the auditEvents table with category governance or safety_gate. Events are retained for 365 days and are filterable by category, actor type, resource type, and timestamp. The audit trail provides complete traceability for every governance decision made by the platform.
🚀 Next Steps
Safety Gates
Deep dive into each gate: purpose, logic, error codes, and retry behavior.
Policies
Declarative policy engine: conditions, actions, enforcement levels, and scoping.
Approvals
Human-in-the-loop approval workflows: triggers, states, resolution channels.
Budget Controls
Budget hierarchy, envelope management, spend tracking, and auto-pause behavior.

