ποΈ Policy Structure
Every policy consists of six core properties:| Property | Description | Example |
|---|---|---|
| name | Human-readable policy name | Production trust boundary |
| category | The domain this policy governs | trust_boundary |
| scope | Where the policy applies | gateway |
| condition | Expression evaluated against dispatch context | agent.trustLevel < 3 |
| action | What happens when the condition matches | block |
| enforcement | How strictly the action is applied | hard |
POLICY EVALUATION FLOW
Policy Rules
Fetch by category + scope. Global + scope-specific policies.
Condition Matching
Evaluate field operator value against PolicyContext (agent, gateway, run, role).
enforcement checkβ
Hard
Strictly enforced. Blocks.
Soft
Advisory. Reported only.
Audit
Observation only. Logged.
actionβ
Block
Hard stop. Step fails with policy_blocked.
disposition: blockRequire Approval
Hold for HITL. Execution pauses pending review.
disposition: holdWarn
Log warning event. Proceed with dispatch.
disposition: passLog
Silent audit record. No execution impact.
disposition: passHard enforcement + Block action = immediate dispatch failure. Audit enforcement = logged without blocking.
π Policy Categories
Policies are organized into categories that determine when and how they are evaluated:| Category | Purpose | Example Use Case |
|---|---|---|
trust_boundary | Enforce trust-level requirements between agents and gateways | Block low-trust agents from production gateways |
budget | Enforce cost-related business rules beyond envelope limits | Require approval when agent spend exceeds 80% of budget |
run_creation | Control when new workflow runs can be created | Block run creation on specific gateways during maintenance |
deployment | Control deployment lifecycle transitions | Require approval for production deployments |
guardrail | General safety guardrails for agent behavior | Block specific agent tiers from certain operations |
config_change | Control when configuration changes are allowed | Require approval for agent configuration changes |
trust_boundary, budget, and run_creation categories are evaluated. During workflow launch preflight, only run_creation policies are evaluated.
π― Policy Scopes
Every policy is scoped to control where it applies:| Scope | Meaning | scopeId |
|---|---|---|
global | Applies to all dispatch contexts | Not set |
gateway | Applies only to a specific gateway | Gateway registry ID |
agent | Applies only to a specific agent | Agent ID |
environment | Applies to all gateways in an environment | Environment name |
π Condition Language
Policy conditions use a simplefield operator value syntax that is validated at creation time and evaluated at runtime against a PolicyContext. The evaluator uses strict parsing with no dynamic code execution β it parses conditions into structured comparisons against a whitelisted set of fields.
Allowed Fields
Conditions can reference any of these dot-path fields:- Agent Fields
- Gateway Fields
- Run Fields
- Role Fields
| Field | Type | Description |
|---|---|---|
agent.trustLevel | number | Agentβs numeric trust level |
agent.tier | string | Agent tier (e.g., free, pro) |
agent.lifecycleStatus | string | Current lifecycle status |
agent.lifecycleStage | string | Current lifecycle stage |
agent.agentId | string | Agent identifier |
agent.owner | string | Agent owner |
Supported Operators
| Operator | Description | Example |
|---|---|---|
== | Equals | agent.tier == 'free' |
!= | Not equals | gateway.environment != 'production' |
> | Greater than | agent.trustLevel > 2 |
>= | Greater than or equal | agent.trustLevel >= 3 |
< | Less than | gateway.minTrustLevel < 5 |
<= | Less than or equal | agent.trustLevel <= 1 |
in | Value in list | agent.tier in ['free', 'pro'] |
Value Syntax
- Strings: Single-quoted (
'production','active') - Numbers: Unquoted (
3,100) - Booleans:
trueorfalse - Null:
null - Arrays: Bracket-delimited for
inoperator (['staging', 'production'])
Example Conditions
Policies do not support boolean composition (
AND/OR). To express compound conditions, create separate policies. This keeps the evaluator simple and each policy independently auditable.β‘ Enforcement Levels
Each policy has an enforcement level that determines how seriously a match is treated:| Level | Behavior | When to Use |
|---|---|---|
hard | Strictly enforced. Block actions produce immediate dispatch failure. | Production safety rules that must never be bypassed |
soft | Advisory enforcement. Matched policies are reported but may not block depending on action. | Rules being tested before promotion to hard enforcement |
audit | Observation only. Matched policies are logged for analysis. | New policies in observation mode before activation |
action: block and enforcement: hard produces a hard block in the governance pipeline. The same policy with enforcement: audit would log the match without blocking.
π Policy Lifecycle
Create
Policies are created through the Platform API or any connected operator interface. The condition expression is parsed and validated at creation time β malformed conditions are rejected before the policy is stored. Requires the
governance:manage permission.Enable / Disable
Policies have an
enabled flag. Disabled policies are never evaluated during governance checks. Toggle a policy off to temporarily suspend enforcement without deleting the rule.Update
Any property of a policy can be updated. If the condition changes, the new expression is re-validated. All updates are recorded in the audit trail.
auditEvents table with category governance.
β Approval Policies
In addition to dispatch policies, Forge supports dedicated approval policies that define when human approval is required for specific triggers:| Trigger | Description |
|---|---|
deployment | New deployment activations |
run_creation | New workflow run launches |
budget_change | Budget configuration changes |
agent_config_change | Agent definition changes |
policy_change | Policy rule changes |
agent_position_creation | New agent position creation in org hierarchy |
triggerCondition β the same condition language used by dispatch policies. When a trigger condition is present, the approval requirement only applies when the condition matches.
Approval policies are scoped to global, gateway, or environment and support specifying an approverRole and requiredApprovals count for multi-party approval workflows.
π§© How Policies Compose with Safety Gates
Policies are evaluated as Gate 9 and Gate 10 in the safety gate pipeline. The relationship is sequential, not parallel:- Gates 1-8 handle infrastructure and resource checks (health, status, concurrency, rate limits, budgets, trust)
- Gate 9 (Policy Rules) evaluates declarative policies β if a
blockpolicy matches, the pipeline returns immediately - Gate 10 (Approval Required) checks whether any
require_approvalpolicies or approval policies matched β if so, the pipeline returns aholddisposition
In Burgundy: Configure policies in Governance settings.

