Skip to content

Policy examples

These policies come from common deployments. Copy one, change the group names and data classes, and start it in mode: shadow before enforcing. Each example is a complete, valid Policy resource.

apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: no-secrets }
spec:
priority: 10
rules:
- name: block-secrets
match: { data_class: [secret.*], min_confidence: medium }
action: block
on_error: fail_closed
message: "That looks like a key or password. It was not sent. Rotate it if it was pasted anywhere else."
alert: { channels: [siem], severity: high }

2. Steer personal AI accounts to the company workspace

Section titled “2. Steer personal AI accounts to the company workspace”
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: steer-to-approved }
spec:
rules:
- name: coach-personal-accounts
match: { app: [chatgpt-personal, claude-personal, gemini-personal] }
action: coach
allowOverride: true
message: "You're on a personal {{app}} account. Work content belongs in {{approved_app}}."
offer: { app: chatgpt-acme, url: "https://chatgpt.com" }
- name: block-high-risk-unsanctioned
match: { sanctioned: false, appRisk: { min: high } }
action: block
message: "{{app}} isn't approved for company use. Request a review in the IT portal."

3. Redact customer data, keep the work flowing

Section titled “3. Redact customer data, keep the work flowing”
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: customer-data }
spec:
appliesTo: { departments: [Customer Support, Sales] }
rules:
- name: redact-customer-pii
match: { data_class: [pii.email, pii.phone, pii.person_name, acme.customer_account] }
action: redact
redact: { style: token, restoreInResponse: true }
storage: redacted

The model sees [PERSON_1] and [ACCOUNT_1]. The user sees the real values restored in the answer.

4. HIPAA: PHI only to the BAA-covered model

Section titled “4. HIPAA: PHI only to the BAA-covered model”
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: phi-routing }
spec:
appliesTo: { groups: [Clinical, Revenue-Cycle] }
defaults: { storage: metadata-only }
rules:
- name: route-phi-to-azure
match: { data_class: [phi.*] }
action: route
route: { target: azure-openai-baa }
on_error: fail_closed
- name: block-phi-elsewhere
match: { data_class: [phi.*], sensor: [extension] }
action: block
message: "Patient information can only be used with Acme Clinical Assistant."
offer: { app: acme-clinical-assistant, url: "https://assistant.acme-health.internal" }
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: source-code }
spec:
rules:
- name: allow-approved-coding-tools
match: { app: [github-copilot-acme, cursor-business], data_class: [code.*] }
action: allow
- name: coach-code-to-other-ai
match: { data_class: [code.proprietary], min_count: 1 }
action: coach
message: "This matches code from our repositories. Use Copilot (Acme) or Cursor Business."
alert: { channels: ["slack:#appsec"], severity: medium, throttle: 4h }
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: api-budgets }
spec:
rules:
- name: downgrade-over-budget
match: { sensor: [gateway], budget: { scope: team, exceeded: true }, model: ["gpt-4o", "claude-opus-*"] }
action: route
route: { target: small-model-pool }
alert: { channels: ["teams:FinOps"], severity: low, throttle: 24h }
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: labeled-files }
spec:
rules:
- name: block-highly-confidential-uploads
match: { direction: upload, file: { label: ["Highly Confidential"] } }
action: block
message: "Files labeled Highly Confidential can't be uploaded to AI tools."
- name: alert-bulk-spreadsheets
match: { direction: upload, file: { types: [xlsx, csv], min_size: 5MB } }
action: alert
alert: { channels: [siem], severity: medium }
apiVersion: promptglass.ai/v1
kind: Policy
metadata: { name: eu-works-council }
spec:
priority: 5
appliesTo: { groups: [EU-Employees] }
defaults: { storage: metadata-only, retention: 30d }
rules:
- name: only-high-severity-content
match: { data_class: [secret.*, phi.*, pci.*] }
action: log
storage: redacted

See employee privacy for the reporting restrictions that go with this mode.