Overview
Custom rules let you define security policies in natural language that ZeroPath evaluates during every scan. Instead of writing complex pattern-matching rules, describe what you want to check and ZeroPath’s AI applies it across your codebase.Creating Rules
From the Dashboard
- Navigate to Rules in the ZeroPath dashboard.
- Click “Create Rule”.
- Write your rule in natural language. For example:
- “All API endpoints must require authentication”
- “Database queries must use parameterized statements, never string concatenation”
- “User input must be validated before being passed to file system operations”
- “Sensitive data (PII, credentials) must not be logged”
- Optionally provide a name and description for the rule.
- Save the rule.
From the API
Rules can be managed via the v2 API:How Rules Are Evaluated
During each scan, ZeroPath:- Identifies applications in your repository (services, modules, entry points).
- Evaluates each custom rule against every application in context.
- Reports violations as findings alongside SAST, SCA, and other results.
Rule Scope
Rules can be scoped at different levels:| Scope | Applies To |
|---|---|
| Organization | All repositories in the organization |
| Tag | All repositories with a specific tag |
| Repository | A single repository |
Managing Rules
From the dashboard or API, you can:- List all rules for your organization
- View a rule’s definition, scope, and metadata
- Update a rule’s name, description, or natural language definition
- Delete rules that are no longer needed
Custom Rules Only Mode
For organizations or repositories that want to run only their custom rules, enable the Custom rules only toggle in your scanner settings. When enabled, ZeroPath disables all built-in scanning modules — including SAST, SCA, IaC, Secrets, and EOL — and evaluates only your custom natural-language rules against identified sources. This setting can be configured at the organization, tag, or individual repository level, following the standard settings inheritance cascade.Best Practices
- Be specific — “All API endpoints must validate the user’s session token before processing” is better than “APIs should be secure”.
- One policy per rule — create separate rules for separate concerns so violations are actionable.
- Start broad, then refine — begin with high-level policies and add detail based on the violations you see.
- Use tags for team-specific rules — different teams may have different security requirements; scope rules using tags.