docs: add compliance event reporting to filter scripts and documentation#372
Conversation
Update all pre-provided filter scripts, embedded UI templates, and documentation to demonstrate the compliance_events output field added in #371. Enterprise users now have working examples of governance event reporting in PII redaction, content blocking, and response guardrails. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Martin Buhr seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
This PR introduces a new compliance event reporting feature for filter scripts. It allows scripts to emit non-blocking audit events, such as PII redactions or policy violations, which are captured by the analytics pipeline for reporting and auditing. The changes primarily focus on documenting this new feature and providing practical examples. All existing example filter scripts and UI templates have been updated to demonstrate how to generate these compliance events. Files Changed AnalysisThe changes are distributed across documentation, example scripts, and UI components:
Architecture & Impact Assessment
Data FlowsequenceDiagram
participant Client
participant AI Gateway
participant Filter Script
participant Analytics Pipeline
participant Admin
Client->>AI Gateway: Makes API Request
AI Gateway->>Filter Script: Executes Filter
Filter Script->>AI Gateway: Returns output with `compliance_events`
AI Gateway-->>Analytics Pipeline: Forwards compliance events for storage
AI Gateway->>Client: Proxies request/response
Admin->>AI Gateway: GET /api/v1/compliance/events
AI Gateway->>Analytics Pipeline: Queries stored events
Analytics Pipeline-->>AI Gateway: Returns events
AI Gateway-->>Admin: Responds with event data
Scope Discovery & Context ExpansionWhile this PR focuses on documentation and examples, it reveals a significant backend feature. The changes in The broader impact extends to:
Metadata
Powered by Visor from Probelabs Last updated: 2026-04-14T09:35:47.565Z | Triggered by: pr_updated | Commit: f9bac0f 💡 TIP: You can chat with Visor using |
Security Issues (2)
✅ Performance Check PassedNo performance issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-04-14T09:35:33.592Z | Triggered by: pr_updated | Commit: f9bac0f 💡 TIP: You can chat with Visor using |
Use "matched_pattern" consistently for detected text and "redacted_types" (as an array) for PII redaction scripts, replacing the inconsistent mix of "keyword", "pattern", "patterns". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
examples/filter-scripts/to emitcompliance_events(PII redaction, content blocking, harmful content detection, refund promises, LLM policy checks)ScriptTemplateSelector.jswith compliance event examplesdocs/site/docs/filters.mdwith schema reference, validation rules, and examples for both request and response filtersexamples/filter-scripts/README.mdwith compliance event field reference and usage examplesfeatures/Filters.mdfeature spec with compliance event implementation detailsTest plan
go test -tags enterprise ./scripting/...passes🤖 Generated with Claude Code