veto policy apply command deploys policy files to your local environment or Veto Cloud.
Syntax
Description
Applies a policy YAML file by:- Local: Validates and loads rules into local Veto instance
- Cloud: Pushes rules to Veto Cloud (creates draft for review)
Required Options
File Path
Optional Settings
Target
local- Apply to local Veto instance (default)cloud- Push to Veto Cloud
Project ID
JSON Output
Examples
Apply Locally (Default)
Apply to Cloud
Apply Multiple Files
Use shell globbing or multiple commands:Apply with JSON Output
Validation
Before applying, the command validates:Schema Validation
- YAML syntax is correct
- Required fields are present
- Field types are correct
- Operators are valid
Semantic Validation
- Rule IDs are unique
- Tool names are valid
- Conditions reference valid fields
- Dependency rules exist
Example Validation Error
Cloud Workflow
1. Authenticate
First, log in to Veto Cloud:2. Select Project
Set active project:3. Apply Policy
Push policy to cloud:4. Review Draft
Review the draft in Veto Cloud web UI:5. Approve or Iterate
- Approve: Draft becomes active policy
- Iterate: Make changes and re-apply
File Format
Policy files use YAML format:Common Scenarios
Apply After Generation
Update Existing Policy
Deploy to Production (Cloud)
Troubleshooting
File Not Found
Invalid YAML
Cloud Authentication Failed
Rule ID Conflict
- Change rule ID to be unique
- Or remove existing rule first
- Or overwrite with
--force(if available)
Best Practices
1. Version Control
Commit policy files to git:2. Test Locally First
3. Use Meaningful Filenames
4. Document Your Rules
Add clear descriptions:5. Organize by Domain
Next Steps
- Test Policies - Validate applied policies
- Generate Policies - Create new policies
- Scan Coverage - Check policy coverage
- Diff Policies - Compare policy versions

