Why CI/CD Integration?
Prevent Uncovered Tools
Fail builds if new tools are added without rules.
Catch Rule Errors
Validate YAML syntax and rule logic before deployment.
Policy Diff in PRs
Show what rules changed and their impact on historical calls.
Enforce Standards
Require tests and coverage thresholds for all policy changes.
Using veto scan in CI
The veto scan command discovers tools in your codebase and checks if they have rules.
Basic Scan
Fail on Uncovered Tools
Use--fail-uncovered to exit with code 1 if any tools lack rules:
0: All tools covered1: Uncovered tools found
JSON Output
For programmatic parsing:Generate Suggestions
Get starter rule snippets for uncovered tools:GitHub Actions
Example Workflow
.github/workflows/veto-ci.yml
Comment on PR with Coverage Report
.github/workflows/veto-pr-comment.yml
GitLab CI
Example Pipeline
.gitlab-ci.yml
CircleCI
Example Config
.circleci/config.yml
Policy Diff in PRs
Show what changed between policy versions withveto diff:
With Impact Analysis
Replay historical calls to see how the diff affects them:Enforcing Coverage Thresholds
Require 100% Coverage
.github/workflows/veto-ci.yml
Require Minimum Coverage
Preventing Regression
Block if Coverage Drops
Docker Integration
Run Veto in a Docker container:Dockerfile.veto
Pre-Commit Hook
Add a pre-commit hook to validate policies locally:.git/hooks/pre-commit
Real-World Example: Complete CI Pipeline
Best Practices
Fail Fast
Run
veto scan --fail-uncovered early in the pipeline.Test on Every PR
Validate policies whenever code or rules change.
Cache Dependencies
Speed up CI by caching Veto CLI installation.
Store Reports
Archive coverage reports for historical tracking.
Troubleshooting
”veto: command not found”
Ensure Veto CLI is installed:“No rules loaded”
Verifyveto/veto.config.yaml exists and points to the correct rules directory:
“Scan detects no tools”
Veto scans TypeScript/JavaScript/Python source files. Check:- Are tools defined in supported languages?
- Are tool files in excluded directories (e.g.,
node_modules,dist)?
veto scan --include-examples --include-tests to scan all directories.
Next Steps
Testing Policies
Write tests for your rules
Writing Rules
Learn all rule syntax and operators
Audit Trail
Export decisions for compliance
Approval Workflows
Set up human-in-the-loop approval

