Policy Structure
This page documents the top-level structure of Rampart policy files, including version, default action, notifications, and policy organization.Schema Overview
Every Rampart policy file follows this structure:Top-Level Fields
Schema version. Always
"1". Required for all policy files.Default decision when no policy matches. Must be
"allow" or "deny".allow- Permit unmatched tool calls (recommended for most use cases)deny- Block unmatched tool calls (paranoid mode)
When using project policies (
.rampart/policy.yaml), the global policy’s default_action always takes precedence. Project policies can only add restrictions, not weaken security.List of policy objects. Each policy contains match conditions and rules. See Match Conditions for details.
Optional webhook notification configuration. Send alerts to Slack, Discord, Teams, or custom endpoints when policies trigger.
Complete Example
Validation Rules
Required Fields
versionmust be present and set to"1"default_actionmust be"allow"or"deny"policiesmust be a non-empty array
Constraints
- Policy names must be unique within a file
- Each policy must have at least one rule
- If
notifyis present, it must includeurlandon notify.onmust contain at least one valid event type
Best Practices
Deny Always Wins
If any policy denies a tool call, the call is denied regardless of other policies. Use this for security-critical rules.
Priority Ordering
Policies with lower priority numbers are evaluated first. Default priority is 100. Use priority 1 for critical security rules.
First Match Wins
Within a policy, rules are evaluated top-to-bottom. The first matching rule determines the action. Order your rules from specific to general.
Profile Presets
Rampart includes built-in profiles with different security postures:| Profile | Default | Use Case |
|---|---|---|
standard | allow | Block dangerous, watch suspicious, allow the rest |
ci | allow | Strict mode for headless/CI - all approvals become denies |
paranoid | deny | Explicit allowlist for everything |
yolo | allow | Log-only, no blocking |
Project-Local Policies
Place.rampart/policy.yaml in any git repo to add project-specific rules on top of your global policy:
Next Steps
- Learn about Match Conditions for targeting specific tool calls
- Explore Actions (deny, allow, watch, ask)
- Configure Webhooks for external decision logic