The policy engine lets you define rules that your audit trail must satisfy, then check them automatically.Documentation Index
Fetch the complete documentation index at: https://docs.provenlog.com/llms.txt
Use this file to discover all available pages before exploring further.
Built-in policies
Five policies are included and run with a single command:| Policy | Description |
|---|---|
| Chain Integrity | Hash chain is unbroken |
| Event Completeness | Every TOOL_CALL has a matching TOOL_RESULT |
| Session Health | No >1 hour gaps between consecutive events |
| Error Rate | Flag sessions with >50% error events |
| Duration Outliers | Flag tool calls >60 seconds |
Custom policies (YAML)
Define custom policies in a YAML file:Rule types
The policy engine supports 7 rule types:Sequence
If event X occurs, event Y must follow within a duration:Absence
If event X occurs, event Y must NOT follow:Boundary
Restrict an agent to a set of allowed actions:Presence
A scope must contain at least one matching event:Rate
No more than X events of type Y per scope:Pattern
Field values must match (or not match) a regex:match_pattern to require a field value matches a regex, or deny_pattern to require it does not.
Temporal
Events must fall within a time window:hours field takes [start, end) in 24-hour format. The days field uses 0=Sunday through 6=Saturday.
Common rule fields
All rule types support these optional fields:| Field | Description |
|---|---|
name | Name of the rule |
severity | "fail" (default) or "warn" |
scope | "session" or "agent" |
label_filter | Filter events by label values before evaluation |
Dry run
Test policies against existing events without affecting anything:plog policy test requires --file — it is designed for validating custom policy definitions.