Ward allows you to override rule behavior without editing the original rule files. You can disable specific rules or change their severity levels through theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eljakani/ward/llms.txt
Use this file to discover all available pages before exploring further.
config.yaml file.
Why Use Overrides?
Rule overrides are useful when you want to:- Suppress false positives — Disable rules that don’t apply to your project
- Adjust severity — Downgrade or upgrade rule severity for your context
- Maintain upgradability — Keep built-in rules intact while customizing behavior
- Team standards — Enforce team-specific severity levels across projects
Override Configuration
Overrides are configured in~/.ward/config.yaml under the rules section:
config.yaml
Disabling Rules
There are two ways to disable rules:Method 1: Disable List
Add rule IDs to thedisable array:
config.yaml
Method 2: Override with enabled: false
Disable individual rules in theoverride map:
config.yaml
disable for simple lists, or override when you also want to change severity.
Changing Severity
Modify a rule’s severity level without disabling it:config.yaml
Severity changes affect filtering via the
severity config option and --fail-on CLI flag.Valid Severity Levels
critical— Most severe, usually exploitable vulnerabilitieshigh— Serious security issues that should be fixed soonmedium— Moderate security concernslow— Minor issues or best practicesinfo— Informational findings, not security-critical
Combined Example
Here’s a complete example showing both disabling and severity changes:config.yaml
Override Processing
Ward applies overrides during rule loading (internal/config/rules.go:115-140):- Load all rules — From
~/.ward/rules/andcustom_dirs - Apply disable list — Remove rules in
rules.disable - Apply override map — For each rule in
rules.override:- If
severityis set, replace the rule’s severity - If
enabled: false, exclude the rule (same asdisable)
- If
- Return final rule set — Only enabled rules with adjusted severities
Common Use Cases
Disable Debug Rules in Development
config.yaml
Downgrade Crypto Warnings
If you use MD5/SHA1 for non-security purposes (e.g., cache keys, ETags):config.yaml
Upgrade Auth Issues to Critical
Enforce strict authentication standards:config.yaml
Disable False Positives
If a rule produces false positives for your codebase:config.yaml
Per-Project Overrides
Until per-project config is available, you can:- Use
custom_dirs— Load project-specific rules from./ward-rules/ - CI environment — Use different
~/.ward/config.yamlfiles per CI job - Baseline suppression — Use
--baselineto suppress known findings per project
Severity Filtering
Override severity affects global severity filtering:config.yaml
severity threshold, findings from that rule won’t appear in reports.
CI Fail Thresholds
Override severity also affects--fail-on behavior:
critical or high, it will trigger failures. If you downgrade to low or info, it won’t.
Viewing Active Rules
The JSON report includes all findings with their effective severity:Override vs. Custom Rules
| Use Case | Overrides | Custom Rules |
|---|---|---|
| Disable built-in rule | ✅ disable: [RULE-ID] | ❌ Not applicable |
| Change severity | ✅ override.RULE-ID.severity | ❌ Must edit rule file |
| Add new rule | ❌ Not applicable | ✅ Create .yaml in ~/.ward/rules/ |
| Modify pattern | ❌ Not supported | ✅ Edit rule file |
| Team-wide changes | ✅ Share config.yaml | ✅ Share rule directory |
- Use overrides for tweaking existing rules without editing files
- Use custom rules for adding new checks or heavily modifying patterns
Example: Staging vs. Production
You can use different override configurations for different environments: Staging (lenient):~/.ward/config.staging.yaml
~/.ward/config.production.yaml
Related Pages
- Configuration File — Main config.yaml structure
- Custom Rules — Writing your own rules
- Baseline Management — Suppressing findings without disabling rules