Runtime Permission Gateway
PolicyGate
Prompts are suggestions a model can ignore. PolicyGate is enforcement a model cannot.
A deterministic runtime permission gateway for AI agent tool calls.
Every tool call is checked before execution.
Small refunds are auto approved only when they are low value and low risk.
Every decision links back to the SOP line that caused it.
AI extracts candidate actions and risk signals. PolicyGate enforces the final decision with deterministic code.
Presentation Mode
Live Permission Demo
Pick a scenario, then follow request to AI extraction to deterministic enforcement to audit proof.
Final decision: deterministic TypeScript
Scenario · Allow refund 30, low risk
| <= $50 | $50-$200 | > $200 | |
|---|---|---|---|
| Low risk | Allow | Approval | Deny |
| Medium / high risk | Approval | Approval | Deny |
| Repeated abuse | Deny | Deny | Deny |
Technical Details
SOP to Policy
Source lines are clickablePolicy Summary
defaultDecision: DENYRaw Policy JSON
{
"id": "policygate-demo-policy",
"name": "PolicyGate Demo Policy",
"version": "1.0.0",
"defaultDecision": "DENY",
"rules": [
{
"id": "deny-prompt-injection-refund_order",
"priority": 10,
"action": "refund_order",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-prompt-injection-view_order",
"priority": 11,
"action": "view_order",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-prompt-injection-send_coupon",
"priority": 12,
"action": "send_coupon",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-prompt-injection-export_customer_data",
"priority": 13,
"action": "export_customer_data",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-prompt-injection-bulk_refund",
"priority": 14,
"action": "bulk_refund",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-prompt-injection-modify_policy",
"priority": 15,
"action": "modify_policy",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-prompt-injection-unknown",
"priority": 16,
"action": "unknown",
"decision": "DENY",
"all": [
{
"field": "contains_prompt_injection",
"operator": "eq",
"value": true
}
],
"any": [],
"reason": "Policy bypass, hiding, or override attempt detected.",
"sourceSopLines": [
11
]
},
{
"id": "deny-repeat-refund-count-abuse",
"priority": 100,
"action": "refund_order",
"decision": "DENY",
"all": [
{
"field": "refund_count_30d",
"operator": "gte",
"value": 5
}
],
"any": [],
"reason": "Customer has 5 or more refund requests in the last 30 days.",
"sourceSopLines": [
5
]
},
{
"id": "deny-repeat-refund-amount-abuse",
"priority": 110,
"action": "refund_order",
"decision": "DENY",
"all": [
{
"field": "refund_amount_30d",
"operator": "gt",
"value": 200
}
],
"any": [],
"reason": "Customer has more than $200 refunded in the last 30 days.",
"sourceSopLines": [
6
]
},
{
"id": "deny-same-address-refund-abuse",
"priority": 120,
"action": "refund_order",
"decision": "DENY",
"all": [
{
"field": "same_address_refund_count_30d",
"operator": "gte",
"value": 10
}
],
"any": [],
"reason": "Shipping address has 10 or more refund requests in the last 30 days.",
"sourceSopLines": [
7
]
},
{
"id": "deny-refund-over-200",
"priority": 130,
"action": "refund_order",
"decision": "DENY",
"all": [
{
"field": "amount",
"operator": "gt",
"value": 200
}
],
"any": [],
"reason": "Refund amount is above $200.",
"sourceSopLines": [
4
]
},
{
"id": "allow-low-risk-refund-up-to-50",
"priority": 140,
"action": "refund_order",
"decision": "ALLOW",
"all": [
{
"field": "amount",
"operator": "lte",
"value": 50
},
{
"field": "risk_level",
"operator": "eq",
"value": "LOW"
}
],
"any": [],
"reason": "Refund amount is up to and including $50 and risk is LOW.",
"sourceSopLines": [
1
]
},
{
"id": "approve-medium-risk-refund-up-to-50",
"priority": 150,
"action": "refund_order",
"decision": "APPROVAL",
"all": [
{
"field": "amount",
"operator": "lte",
"value": 50
},
{
"field": "risk_level",
"operator": "eq",
"value": "MEDIUM"
}
],
"any": [],
"reason": "Small refund, but risk signals require human approval.",
"sourceSopLines": [
2
]
},
{
"id": "approve-high-risk-refund-up-to-50",
"priority": 160,
"action": "refund_order",
"decision": "APPROVAL",
"all": [
{
"field": "amount",
"operator": "lte",
"value": 50
},
{
"field": "risk_level",
"operator": "eq",
"value": "HIGH"
}
],
"any": [],
"reason": "Small refund, but HIGH risk requires human approval.",
"sourceSopLines": [
2
]
},
{
"id": "approve-refund-over-50-up-to-200",
"priority": 170,
"action": "refund_order",
"decision": "APPROVAL",
"all": [
{
"field": "amount",
"operator": "gt",
"value": 50
},
{
"field": "amount",
"operator": "lte",
"value": 200
}
],
"any": [],
"reason": "Refund amount is above $50 and up to and including $200.",
"sourceSopLines": [
3
]
},
{
"id": "deny-export-customer-data",
"priority": 180,
"action": "export_customer_data",
"decision": "DENY",
"all": [
{
"field": "customer_data_type",
"operator": "in",
"value": [
"email",
"address",
"phone",
"personal_data"
]
}
],
"any": [],
"reason": "Exporting customer emails, addresses, phone numbers, or personal data is forbidden.",
"sourceSopLines": [
8
]
},
{
"id": "deny-modify-policy",
"priority": 190,
"action": "modify_policy",
"decision": "DENY",
"all": [],
"any": [],
"reason": "Modifying permission rules is forbidden.",
"sourceSopLines": [
9
]
},
{
"id": "deny-bulk-refund",
"priority": 200,
"action": "bulk_refund",
"decision": "DENY",
"all": [],
"any": [],
"reason": "Bulk refunds are forbidden.",
"sourceSopLines": [
10
]
}
]
}Agent Request Simulator
AI extracts; PolicyGate decidesMode A: Preset Tool Calls
Mode B: Natural Language Request
Selected preset ToolCall
{
"id": "tool_allow_refund_30_low_risk",
"action": "refund_order",
"amount": 30,
"refund_count": 0,
"customer_tier": "standard",
"reason_category": "delivery_issue",
"orderId": "ord_syn_1001",
"customerId": "cus_syn_alpha",
"rawUserRequest": "Refund order ord_syn_1001 for $30. Customer provided photo evidence of a delayed delivery.",
"riskLevel": "LOW",
"riskSignals": [
"photo evidence",
"delivery issue",
"no recent refunds"
],
"evidenceProvided": true,
"hasDeliveryIssue": true,
"refundCount30d": 0,
"refundAmount30d": 0,
"accountAgeDays": 420,
"sameAddressRefundCount30d": 0
}Extracted ToolCall
No extracted tool call yet.
Decision and Approval
Deterministic result- Matched rule
- allow-low-risk-refund-up-to-50
- Reason
- Refund amount is up to and including $50 and risk is LOW.
- Risk level
- LOW
- Risk signals
- photo evidence, delivery issue, no recent refunds
- Amount
- 30
- Refund count 30d
- 0
- Executed
- true
Refund order ord_syn_1001 for $30. Customer provided photo evidence of a delayed delivery.
Candidate ToolCall JSON
{
"id": "tool_allow_refund_30_low_risk",
"action": "refund_order",
"amount": 30,
"refund_count": 0,
"customer_tier": "standard",
"reason_category": "delivery_issue",
"contains_prompt_injection": false,
"action_count": 1,
"customerId": "cus_syn_alpha",
"orderId": "ord_syn_1001",
"rawUserRequest": "Refund order ord_syn_1001 for $30. Customer provided photo evidence of a delayed delivery.",
"riskLevel": "LOW",
"riskSignals": [
"photo evidence",
"delivery issue",
"no recent refunds"
],
"evidenceProvided": true,
"hasDeliveryIssue": true,
"refundCount30d": 0,
"refundAmount30d": 0,
"accountAgeDays": 420,
"sameAddressRefundCount30d": 0
}Audit Timeline
No audit events for this filter.
Evaluation Dashboard
31 deterministic casesView detailed evaluation layers
LLM Extraction Layer
LLM extraction is shown live in the request simulator. Deterministic enforcement is evaluated below.
Deterministic Engine Layer
Safety and Abuse Guard Layer
Architecture Notes
PolicyGate gates synthetic commerce tool calls at the execution boundary.