Finance
Protect financial data, flag material nonpublic information, add supervisory notices and retain audit evidence with this starter.
What it checks
| Policy | On | Checks | Action |
|---|---|---|---|
| prompt-injection | Request | 4 attack patterns; similarity threshold 0.78 | Block |
| pii-detector | Request | Payment-card data (PCI mode); 4 custom identifier patterns | Redact |
| dlp-filter | Request | 12 blocked terms such as “insider trading” and “earnings before announcement”; 3 custom patterns; classification markers; near-miss spellings | Block |
| mnpi-filter | Response | 12 watch terms such as “insider trading” and “earnings before announcement” | Block |
| financial-compliance | Response | 7 blocked phrases such as “buy this stock” and “sell immediately”; adds 3 disclaimers | Block, add disclaimers |
| quality-scorer | Response | Accuracy ≥ 0.90; relevancy ≥ 0.88; combined score ≥ 0.87; at least 180 characters and 3 sentences | Fallback |
| audit-logger | Request | Adds an allow-only audit marker to the decision | Record |
Rate limit: 180 requests per minute across all gateway replicas.
Policy YAML
pack:
id: "cfg_demo_finance"
name: "demo-finance-regulated"
version: "0.2.0"
enabled: true
author: "local"
description: "Financial services starter with PCI redaction, MNPI controls, and advice guardrails"
# Market events create bursty traffic, so limits should stay consistent across every gateway replica.
distributed_rate_limit:
backend: valkey
url_env: VERDICTAN_REDIS_URL
global_rate_limit:
max_requests: 180
window_seconds: 60
# The current schema-safe way to avoid raw retention is metadata-only history capture with blocked-event visibility.
history:
capture:
enabled: true
mode: metadata_only
include_blocked: true
fail_open: false
policies:
chain: [prompt-injection, pii-detector, dlp-filter, mnpi-filter, financial-compliance, quality-scorer, audit-logger]
policy:
# Stop jailbreaks before treasury, research, or client context reaches the model.
prompt-injection:
embedding_threshold: 0.78
attack_patterns: ["ignore.*previous.*instructions", "reveal.*system.*prompt", "act as.*investment banker", "bypass.*compliance"]
encoding: {decode_base64: true, normalize_unicode: true, detect_homoglyphs: true}
boundaries: {enforce_delimiters: true, reject_fake_boundaries: true}
# PCI-aware redaction keeps account and payment identifiers out of prompts while preserving workflow continuity.
pii-detector:
action: redact
pci_mode: true
detect_patterns: ['\b\d{3}-\d{2}-\d{4}\b', '\b(?:routing|aba)\s*(?:number)?\s*[:#-]?\s*\d{9}\b', '\b(?:account|acct)\s*(?:number)?\s*[:#-]?\s*\d{8,17}\b', '\b(?:iban)\s*[:#-]?\s*[A-Z]{2}\d{2}[A-Z0-9]{11,30}\b']
redaction:
marker_format: label
include_metadata: true
custom_markers: {generic_id: "[REDACTED-FINANCE-ID]"}
# Block wall-crossed, pre-release, and surveillance-sensitive prompts instead of letting them become model context.
dlp-filter:
blocked_terms: &finance_watch_terms ["insider trading", "earnings before announcement", "pending merger not public", "deal code name", "confidential board deck", "unannounced guidance change", "wall-crossed investor", "restricted list issuer", "loan loss reserve before filing", "suspicious activity report", "sanctions investigation", "material non-public information"]
detect_patterns: ['\b(?:mnpi|material non-public information)\b', '\b(?:ipo|follow-on|secondary)\s+pricing\s+before\s+launch\b', '\b(?:project|deal)\s+[A-Z][A-Za-z0-9_-]{2,12}\b']
action: block
fuzzy_matching: true
max_distance: 1
sensitivity_level: high
# Reuse the same watch list on output so the assistant cannot echo market-moving language back to the caller.
mnpi-filter:
detect_patterns: *finance_watch_terms
# Advice-like output must stay educational, never promotional, and always carry investor-protection disclaimers.
financial-compliance:
blocked_patterns: ["buy this stock", "sell immediately", "guaranteed returns", "risk-free investment", "front-run this trade", "target price is", "specific allocation recommendation"]
required_disclaimers:
- "This content is for informational and supervisory-support purposes only and is not financial, investment, or tax advice."
- "Do not trade, rebalance, or communicate client-specific recommendations without licensed review and firm approval."
- "Past performance, model output, and scenario analysis do not guarantee future results or suitability."
# Finance responses need a higher quality floor because users may operationalize them in client, treasury, or risk workflows.
quality-scorer:
min_output_chars: 180
min_sentences: 3
thresholds: {min_aggregate: 0.87, min_relevancy: 0.88, min_accuracy: 0.90}
weights: {relevancy: 0.4, accuracy: 0.6}
failure_action:
action: fallback
fallback_message: "Unable to provide a finance-safe response with sufficient confidence. Escalate to a licensed reviewer."
industry_profiles: {finance: {min_aggregate: 0.87, min_relevancy: 0.88, min_accuracy: 0.90}}
# Keep the audit marker active so downstream events and reviews show a supervised control path.
audit-logger: {}