The Three Pillars
Forge governance rests on three pillars that work together as a layered defense:Fail-fast sequential pipeline. Two pipelines: dispatch (11 checks) and launch preflight (5 gates).
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
Forge uses two governance pipelines, selected by action type. The dispatch pipeline evaluates step and delegated-run dispatches through a sequence of safety gates. The launch pipeline runs a lighter preflight check before a workflow run is created. Both are fail-fast: if any gate blocks, remaining gates are skipped and the decision is returned immediately. This keeps governance evaluation fast — typically completing in single-digit milliseconds.DISPATCH PIPELINE (step_dispatch / delegated_run_dispatch)
Step ready in DAG. Calls governance engine with full context.
Infrastructure
Lifecycle
Credential
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 (the primary pipeline):
| # | 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 | Identity (NHI) | Validate agent Non-Human Identity credential | NHI credential expired | No |
| 4 | Concurrency | Enforce per-agent concurrent step limits | Running steps at or above max limit | Yes |
| 5 | Rate Limit | Enforce dispatch rate limits via sliding window | Agent exceeds rate limit | Yes |
| 6 | Agent Budget | Check agent-level monthly budget ceiling | Spent at or above budget limit | No |
| 7 | Envelope Budgets | Check all applicable budget envelopes (global, gateway, agent) | Any envelope exhausted | No |
| 8 | Trust Level + Autonomy | Verify agent trust level meets gateway minimum and autonomy rung permits the action type | Agent trust below gateway minimum, or rung blocks action | No |
| 9 | Context Trust | Verify dispatch context provenance meets role requirements | Source class rejected or context stale | Freshness only |
| 10 | Policy Rules | Evaluate declarative policies (block/require_approval) | Policy with block action matches | No |
| 11 | Approval Required | Check if HITL approval is required and whether it exists | Policy requires approval and none exists | No |
workflow_run_launch) uses a separate 5-gate sequence: authorityPosture → gatewayHealth → workflowReadiness → policyRules → approvalRequired. This lighter pipeline checks whether the execution authority posture permits run creation, whether the workflow has a valid version, and whether launch policies require approval.
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.

