- Allow: Permit requests (default behavior)
- Block: Prevent requests from reaching AI providers
- Redact: Remove sensitive data before forwarding
- Alert: Allow but generate notifications for review
Quick Start
Create a policy file at~/.config/oisp-sensor/policies.yaml:
Policy Structure
Basic Format
Supported Formats
| Format | Use Case | Example |
|---|---|---|
| YAML | Cloud sync, complex policies | policies.yaml |
| TOML | Local config, developer use | policies.toml |
| JSON | API responses, programmatic | policies.json |
Match Conditions
All conditions in a policy are AND-ed. For OR logic, use multiple policies.Provider
Model
Process
Actor (User)
Content (for Redaction)
Time-Based
Cost/Usage
Actions
Allow
Permit the request (default).Block
Prevent the request from reaching the AI provider.Redact
Modify the request to remove sensitive data.Alert
Allow but generate an alert.Examples
Block Chinese AI Providers
Approved Apps Only
Redact PII in External Requests
Cost Controls
Business Hours Only
Evaluation Logic
Order
- Policies sorted by priority (highest first)
- First matching policy wins
- If no match,
default_actionapplies
Exception Handling
Useexcept to carve out exceptions:
Fail Mode
Built-in Patterns
| Pattern | Description | Example |
|---|---|---|
email | Email addresses | [email protected] |
phone | Phone numbers | +1-555-123-4567 |
ssn | US Social Security | 123-45-6789 |
credit_card | Credit cards | 4111-1111-1111-1111 |
api_key | API keys | sk-xxx, key-xxx |