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.

Runtime Enforcement

Every tool call is checked before execution.

Refund Abuse Guard

Small refunds are auto approved only when they are low value and low risk.

Audit Proof

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

01
User request
"Refund $30"
→
02
AI extracts
candidate action
→
03
PolicyGate
deterministic
→
04
Decision
Allowed
→
05
Audit proof
SOP linked

Scenario · Allow refund 30, low risk

AllowedAllowed and executed
Matched rule
allow-low-risk-refund-up-to-50
Source SOP line
Reason
Refund amount is up to and including $50 and risk is LOW.
Executed
true
Refund requests up to and including $50 may be automatically approved only when the refund risk is LOW.
<= $50$50-$200> $200
Low riskAllowApprovalDeny
Medium / high riskApprovalApprovalDeny
Repeated abuseDenyDenyDeny

Technical Details

SOP to Policy

Source lines are clickable

Policy Summary

defaultDecision: DENY
Low value + low risk refundALLOW
Suspicious small refundAPPROVAL
Repeated refund abuseDENY
High value refundDENY
Customer data exportDENY
Raw 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 decides

Mode A: Preset Tool Calls

Safe
Needs Review
Blocked

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
ALLOW
Allowed and executed
Low risk refund
Audit proof
This decision is backed by SOP line 1.
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
Raw user request

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 cases
31
Deterministic cases
100%
Policy decision accuracy
100%
Abuse guard accuracy
100%
Injection action block rate
0%
False allow rate
0%
False deny rate
View detailed evaluation layers

LLM Extraction Layer

LLM extraction is shown live in the request simulator. Deterministic enforcement is evaluated below.

Action extraction
Demoed live
Amount extraction
Demoed live
Risk extraction
Demoed live

Deterministic Engine Layer

Policy decision accuracy
100%
Approval routing accuracy
100%
False allow rate
0%
False deny rate
0%

Safety and Abuse Guard Layer

Injection action block rate
100%
Abuse guard accuracy
100%
Repeated refund block rate
100%
Forbidden action block rate
100%

Architecture Notes

SOP compiler
LLM structured output
Action extractor
LLM structured output
Risk signal extraction
LLM structured output or synthetic demo context
Policy engine
Deterministic TypeScript
Execution boundary
Tool execution boundary in the demo runtime
Refund Abuse Guard
Deterministic policy conditions over risk fields and refund history
Audit
Every decision records matched rule and source SOP lines

PolicyGate gates synthetic commerce tool calls at the execution boundary.