Skip to content

Policies overview

A PromptGlass policy is an ordered list of rules. Each rule matches on who (users, groups, departments), where (AI app, model, sensor), what (data classes, topics, file types) and how much (budgets, volume). It then takes one action. Policies are YAML, version-controlled, and evaluated in microseconds at the gateway and in the browser extension.

Action Effect Available on
allow Pass through and record metadata All sensors
log Pass through and record per the storage mode All sensors
coach Show the user a message; they can switch tools, edit, or continue with a reason Extension, gateway (web)
redact Replace sensitive spans with tokens before sending; optionally restore in the response Extension, gateway
block Stop the request and show a message Extension, gateway
route Send the request to an approved model or tenant instead Gateway (API and supported web apps)
alert Pass through and notify (SIEM, Slack/Teams, ticket) All sensors, including connectors

Connectors and the endpoint agent observe after the fact, so on those sensors any rule that would coach, redact, block or route is recorded as a would-have action and can alert.

Rules are evaluated top-down, and the first matching rule with a terminal action wins (allow, coach, redact, block, route). log and alert are non-terminal: they record and notify, then evaluation continues. That lets you put broad logging rules first and enforcement rules after them.

apiVersion: promptglass.ai/v1
kind: Policy
metadata:
name: baseline
spec:
defaults:
storage: redacted
on_error: fail_open
rules:
- name: block-secrets-everywhere
match: { data_class: [secret.*] }
action: block
message: "This looks like a credential. Remove it before using AI. Need help? #security"
- name: coach-personal-chatgpt
match: { app: [chatgpt-personal, gemini-personal] }
action: coach
message: "Please use ChatGPT (Acme workspace) for work. It keeps your data out of model training."
offer: { app: chatgpt-acme, url: "https://chatgpt.com/?workspace=acme" }
- name: log-everything
action: log
  1. Observe: start every new rule as mode: shadow. It records the action it would have taken without affecting users.
  2. Coach: switch to coach and watch the override rate. A high override rate means the rule is too broad or the approved alternative is lacking.
  3. Enforce: move to redact or block for the data classes where the risk justifies it.
- name: redact-customer-records
mode: shadow # shadow | enforce
match: { data_class: [acme.customer_record] }
action: redact
  • Console: a visual editor with a live test panel.
  • CLI / GitOps: promptglass policy apply -f policies/ from CI. The console shows Git-managed policies as read-only.
  • Simulation: promptglass policy simulate --since 7d replays recent events against a draft policy and reports how its actions would differ.

See the policy reference and examples.