Documentation Index
Fetch the complete documentation index at: https://zeropath.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Custom rules let you define security policies in natural language that ZeroPath evaluates during full scans across your selected repositories. 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 and select the Custom Rules tab.
- Click “Add Rule”.
- Give the rule a descriptive name.
-
Write your rule in natural language. For example:
- “Flag any API endpoint that returns user email addresses without the caller having admin scope”
- “Find logging statements that include request bodies which may contain passwords or tokens”
- “Check that all database queries use parameterized queries instead of string concatenation”
-
Optionally set a file scope using a glob pattern (e.g.,
src/api/**,*.py) to limit the rule to specific files. The default is all files. - Choose the repository scope: apply the rule to all repositories (including any added in the future) or select specific repositories. You can also assign tags to organize your rules.
- Save the rule.
From the API
Rules can be managed via the v2 API:allRepositories: true instead of repositoryIds:
You cannot combine
allRepositories and repositoryIds in the same request. Use one or the other when creating or updating a rule.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 |
allRepositories field indicating whether it applies organization-wide.
Rules follow the same org → tag → repo inheritance cascade as scanner settings. Repository-level rules supplement (not replace) org and tag-level rules.
Managing Rules
From the dashboard or API, you can:- List all rules for your organization — rules that apply to all repositories display “All Repositories” instead of a numeric count
- View a rule’s definition, scope, and metadata
- Update a rule’s name, description, natural language definition, or scope (pass
allRepositories: trueto apply to all repos, orrepositoryIdsto scope to specific repos) - 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.Rule Packs
In addition to custom rules, ZeroPath offers Rule Packs — curated bundles of pre-built rules published by ZeroPath that target common security patterns and compliance requirements. You can browse available rule packs from the Rule Packs tab on the Rules page and enable the ones relevant to your organization. Rule packs supplement your custom rules. When a rule pack is enabled, its rules are evaluated during scans alongside any custom rules you have defined.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.