Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.
ZeroPath gives you two natural-language surfaces for tuning scans: Repository Context and Custom Rules. They sound similar but do different jobs, and most of the value comes from using them together. This page is a side-by-side reference for choosing between them.
Repository Context
A natural-language knowledge layer that tells ZeroPath things about your codebase it cannot
infer from code alone. Refines existing findings — reduces false positives.
Custom Rules
Natural-language security policies ZeroPath evaluates during scans across your selected
repositories. Generates new findings when violated.
Declarative vs. imperative is the cleanest mental split. Context says “X is already true in our
stack.” Rules say “X must always hold; flag any violation.”
Use Repository Context when ZeroPath is producing noise on patterns that are actually safe in
your codebase — facts the code itself cannot reveal.Trigger signals
The same false positive keeps reappearing across scans
Findings on internal-only or dev-only paths that are not externally reachable
Code uses safe wrappers, sanitizers, or middleware that ZeroPath cannot recognize
Architectural facts hidden from the code (gateways, ingress, middleware, runtime sandboxes)
Typical examples
“All endpoints in this service sit behind a JWT gateway — anonymous access is not possible.”
“The eval() call in src/sandbox/ runs inside a restricted Docker container with no network access.”
“Rate limiting is enforced at the load balancer for all public-facing routes.”
Do not use Repository Context to suppress a finding you simply do not want to fix, or to
paper over missing detection. Over-broad context — e.g. asserting org-wide JWT enforcement
when one repo allows anonymous endpoints — silently hides real findings.
Use Custom Rules when you have an organization-specific policy that built-in SAST does not
enforce.Trigger signals
Your organization has security policies not covered by built-in SAST
You want internal coding standards enforced consistently across repos
Idiomatic patterns specific to your stack need a dedicated check
Typical examples
“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.”
“All database queries must use parameterized queries instead of string concatenation.”
Avoid duplicating built-in SAST checks, bundling multiple unrelated concerns into one rule,
or writing vague rules like “APIs should be secure.” Vague rules give ZeroPath nothing
concrete to enforce.
Both features support the same three-level scope cascade and glob-based file scoping, but only Repository Context lets you target individual scan phases and input types.
Both features follow the same org → tag → repo inheritance model as scanner settings.
Scope
Applies to
Organization
All repositories in the organization, including ones added later
Tag
All repositories with the selected tag(s)
Repository
Only the selected repository or repositories
Scopes stack — a repository receives its own entries plus tag-level and org-level entries
that apply to it. More specific scopes never replace broader ones.
Repository Context has two extra targeting dimensions — useful when a fact is only relevant to a particular kind of analysis. Custom rules are always evaluated in the natural-language rule phase against identified sources, so they do not expose phase selection.
Scan phases (Context only)
Six phases are selectable under Advanced Settings when creating a context entry:
Phase
What ZeroPath is doing
Application identification
Understanding what your code does — services, modules, entry points
Source identification
Finding where untrusted data enters your application
Sink identification
Finding where data flows to sensitive operations
Vulnerability investigation
Evaluating whether potential issues are real, exploitable vulnerabilities
Logic analysis
Analyzing business logic for issues beyond typical code patterns
Custom rule evaluation
Evaluating your custom rules against the codebase
If you are unsure which to select, leave all phases enabled — ZeroPath applies your context
wherever it is relevant.
Input types (Context only)
Eight input types are selectable under Advanced Settings:
Input type
Description
HTTP Handler
Web API endpoints and HTTP request handlers
File Handler
File upload and file system input processing
Stdin Handler
Command-line stdin and pipe input
Browser Data
Client-side browser input (cookies, local storage, DOM)
WebSocket
WebSocket message handlers
Socket
Raw TCP/UDP socket connections
CLI Argument
Command-line arguments and flags
Mobile Inputs
Mobile application user input
All input types are selected by default. Deselect the ones that are not relevant to narrow the
scope.
Context and Custom Rules are most useful in combination. Without context, a rule that says “must check auth” has no idea what an auth check looks like in your stack. Without rules, context only reduces noise on built-in detections — it cannot enforce your own policies.
All endpoints exposing PII must require authentication.
4
Result
ZeroPath now flags only endpoints that handle PII fields and bypass one of the two
recognized auth mechanisms. Endpoints behind requireAuth() or mTLS are correctly treated as
safe; everything else surfaces as a high-signal finding.
Without the context entries, the same rule would produce lower-confidence findings everywhere the
model wasn’t sure how your stack handles authentication or what counts as PII. Pairing rules with
context is what makes findings actionable.
Where to manage:Settings → Repository context in the dashboard. Table
view with title (or body preview), file pattern, tags, and repository scope.Creation paths
Manual creation in the dashboard
One-click Generate & Save Context from any false positive — no review step, takes effect
on the next scan
Editing and deletion
Click a row to edit text, targeting, or scope
Individual or bulk delete with confirmation
Changes take effect on the next scan
Review cadence: quarterly. Architecture drifts; stale context can hide real issues. Delete
entries that no longer reflect reality.
Where to manage:Settings → Rules → Custom rules tab. The
sibling Rule Packs tab exposes curated bundles published by ZeroPath that you can enable
without authoring.Creation paths
Manual creation in the dashboard
Enable Rule Packs — no authoring needed
v2 API for programmatic management
Editing and deletion
Update name, description, rule text, or scope
Switch between allRepositories and specific repositoryIds (mutually exclusive in the same
request)
Delete rules that are no longer needed
Review cadence: quarterly, or after major architectural change. Refine rules as you see
which findings are actionable vs. noise.
Custom Rules Only mode — the Custom rules only toggle in scanner
settings disables every built-in scanning module (SAST, SCA, IaC,
Secrets, EOL) and evaluates only your natural-language rules. This is rarely the right choice;
enable it only when you intentionally want ZeroPath to run as a pure custom-rule engine.
Over-broad context that silently suppresses findings
The single most dangerous mistake. Saying “all endpoints require JWT” at org scope is fine
only if it is literally true everywhere. One legacy service with an anonymous endpoint and
you have just taught ZeroPath to ignore a real finding. Start narrow; widen only when the
statement is provably true across the broader scope.
Vague rules that produce noise
“APIs should be secure” is not enforceable. Rules need a concrete, testable assertion: a
specific behavior that either holds or doesn’t. If you cannot describe how a reviewer would
check the rule by hand, ZeroPath cannot enforce it consistently either.
Using context to mask findings instead of stating facts
Context is for facts that are true in your codebase, not for hiding findings you don’t want
to triage. If the underlying claim isn’t true, the entry will eventually hide a real bug.
Rules without supporting context
Standalone rules produce findings, but ZeroPath has to guess what “auth check” or
“sanitized input” means in your stack. Pair every non-trivial rule with the context it needs
to recognize the safe pattern.
Leaving all input types and phases enabled by default
Default targeting is intentionally permissive. When you know a context entry only applies to
HTTP handlers during source identification, narrow it. Over-broad targeting makes irrelevant
context bleed into unrelated analysis.
Connect repos, run full scans, and enable the relevant Rule
Packs. No custom work yet — let the baseline
surface where the noise is.
2
Week 2 — Triage into context
For every false positive, use the one-click Generate & Save Context workflow. Aim to
convert roughly 80% of FPs into context entries. This is the highest-ROI step.
3
Week 3 — Author rules for policy gaps
Identify org-specific policies not covered by built-in SAST or Rule Packs. Write 3–5 custom
rules. For each, add the supporting context entries that describe the safe patterns the rule
must recognize.
4
Week 4 — Tag, review, and own
Tag rules and context entries by team or compliance framework. Assign a quarterly review owner
so entries don’t go stale as the codebase evolves.
Architectural fact every engineer knows but the code doesn’t show
Repository Context
Compliance policy needs code-level enforcement
Custom Rule
Org-wide coding standard to enforce
Custom Rule
Built-in SAST misses a pattern specific to your stack
Custom Rule
Need to enforce a policy and teach ZeroPath what safe looks like
Both, paired
Repository Context docs
Targeting axes, false-positive workflow, scope inheritance, and best practices.
Custom Rules docs
Authoring rules, the v2 API, Rule Packs, and Custom Rules Only mode.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"ZeroPath Documentation","colors":{"primary":"#3B82F6","light":"#60A5FA","dark":"#2563EB"},"logo":{"light":"https://mintcdn.com/zeropath/6zbHY4NJRijPMEJo/logo/light.svg?fit=max\u0026auto=format\u0026n=6zbHY4NJRijPMEJo\u0026q=85\u0026s=aace36c86b3bf8423db31fabdbae24fd","dark":"https://mintcdn.com/zeropath/6zbHY4NJRijPMEJo/logo/dark.svg?fit=max\u0026auto=format\u0026n=6zbHY4NJRijPMEJo\u0026q=85\u0026s=3e1f09efd7bac343f10da2c943e903a1","href":"https://zeropath.com"},"favicon":"https://mintcdn.com/zeropath/6zbHY4NJRijPMEJo/favicon.png?fit=max\u0026auto=format\u0026n=6zbHY4NJRijPMEJo\u0026q=85\u0026s=05ab358cd348cd549b3a368ca5637f2c","navbar":{"links":[{"href":"https://discord.gg/ZRqDvZ6qjJ","label":"Community"},{"href":"mailto:support@zeropath.com","label":"Support"}],"primary":{"type":"button","label":"Get a demo","href":"https://zeropath.com/demo"}},"footer":{"socials":{"github":"https://github.com/zeropathai","twitter":"https://twitter.com/zeropathai","linkedin":"https://linkedin.com/company/zeropathai","discord":"https://discord.gg/ZRqDvZ6qjJ"}},"search":{"prompt":"Search ZeroPath docs..."},"seo":{"metatags":{"robots":"index, follow"},"indexing":"all"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"metadata":{"timestamp":false},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Dashboard","icon":"grid","href":"https://zeropath.com/app"},{"anchor":"Status","icon":"signal","href":"https://status.zeropath.com"}]},"languages":[{"language":"en","href":""},{"language":"pt","href":"pt"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zeropath","hasAudioNarration":false,"actualSubdomain":"zeropath","customDomains":["zeropath.com"],"gitSource":{"type":"github","owner":"zeropathai","repo":"cunningham","deployBranch":"main","contentDirectory":"src/typescript/docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae35718bede01962d4161b3","collectionId":"eb110955-b6ab-4930-bd8e-98c468083c0b","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae35718bede01962d4161b3"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"DISABLED"},"CONTEXTUAL_FEEDBACK":{"status":"DISABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"DISABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae35718bede01962d4161b3","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"en","tag":"API Reference","count":119},{"language":"en","tag":"Guides","count":66},{"language":"pt","tag":"Guias","count":55},{"language":"en","tag":"Webhooks","count":34},{"language":"en","tag":"SCA","count":27},{"language":"en","tag":"Repositories","count":23},{"language":"en","tag":"Integrations","count":15},{"language":"en","tag":"Platform","count":12},{"language":"en","tag":"Issues","count":12},{"language":"en","tag":"Developer Tools","count":11},{"language":"pt","tag":"Ferramentas de Desenvolvimento","count":11},{"language":"pt","tag":"Integrações","count":11},{"language":"pt","tag":"Plataforma","count":11},{"language":"en","tag":"Scanning","count":9},{"language":"pt","tag":"SCA","count":9},{"language":"pt","tag":"Escaneamento","count":9},{"language":"pt","tag":"Agentes de Codificação","count":5},{"language":"pt","tag":"Visão Geral","count":3},{"language":"pt","tag":"Autenticação","count":2},{"language":"pt","tag":"CLI","count":2}]},"assistantConfig":{"enableStarterQuestions":false},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"global.css","content":".prose a.link,.prose-sm a.link{border-bottom:none;color:#2563eb;font-weight:600}.prose a.link:hover,.prose-sm a.link:hover{text-decoration:underline;text-underline-offset:3px}html.dark .prose a.link,html.dark .prose-sm a.link{color:#60a5fa}.zp-label{display:inline-flex;align-items:center;font-size:.72rem;line-height:1.1;font-weight:500;padding:3px 10px;border-radius:6px;border:1px solid transparent;vertical-align:middle;position:relative;top:-1px;margin-right:8px}.zp-label+.zp-label{margin-left:-2px}.zp-badges{display:flex;gap:6px;align-items:center;margin:2.25rem 0 0}.zp-badges .zp-label{margin:0;top:0}.zp-badges+h3{margin-top:.5rem}.zp-label-new{background:rgba(34,197,94,.12);color:#15803d;border-color:rgba(34,197,94,.25)}.zp-label-early{background:rgba(59,130,246,.12);color:#1d4ed8;border-color:rgba(59,130,246,.25)}.zp-label-improved{background:rgba(168,85,247,.1);color:#7e22ce;border-color:rgba(168,85,247,.25)}.zp-label-ga{background:rgba(113,113,122,.12);color:#3f3f46;border-color:rgba(113,113,122,.25)}.zp-label-beta{background:rgba(245,158,11,.12);color:#b45309;border-color:rgba(245,158,11,.3)}html.dark .zp-label-new{background:rgba(34,197,94,.2);color:#4ade80;border-color:rgba(34,197,94,.3)}html.dark .zp-label-early{background:rgba(59,130,246,.2);color:#60a5fa;border-color:rgba(59,130,246,.3)}html.dark .zp-label-improved{background:rgba(168,85,247,.15);color:#d8b4fe;border-color:rgba(168,85,247,.3)}html.dark .zp-label-ga{background:rgba(113,113,122,.2);color:#a1a1aa;border-color:rgba(113,113,122,.3)}html.dark .zp-label-beta{background:rgba(245,158,11,.15);color:#fbbf24;border-color:rgba(245,158,11,.3)}.update .prose-sm{font-size:.9375rem;line-height:1.7}.update .prose-sm li,.update .prose-sm p{font-size:inherit;line-height:inherit}.update .prose-sm li{margin-top:.3rem;margin-bottom:.3rem}.update .prose-sm ul{margin-top:.6rem;margin-bottom:.6rem}.update .prose-sm h3{font-size:1.1875rem;font-weight:650;letter-spacing:-.015em;margin-bottom:.4rem}.update .prose-sm .zp-cat,.zp-cat{margin:2.75rem 0 .35rem;padding-top:1.35rem;border-top:1px solid rgba(125,125,135,.2);font-size:1rem;line-height:1.35;font-weight:650;letter-spacing:-.015em}html.dark .update .prose-sm .zp-cat,html.dark .zp-cat{border-top-color:rgba(160,160,175,.16)}.update .prose-sm .zp-group,.zp-group{margin:1.5rem 0 .15rem;font-size:.7rem;line-height:1.3;font-weight:700;letter-spacing:.1em;text-transform:uppercase;opacity:.5}.update .prose-sm .zp-cat+.zp-group,.zp-cat+.zp-group{margin-top:1rem}.zp-group+ul{margin-top:.3rem}#sidebar,#sidebar-content{scrollbar-width:none}#sidebar-content::-webkit-scrollbar,#sidebar::-webkit-scrollbar{width:2px}#sidebar-content::-webkit-scrollbar-track,#sidebar::-webkit-scrollbar-track{background:0 0}#sidebar-content::-webkit-scrollbar-thumb,#sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.05);border-radius:2px}#sidebar-content::-webkit-scrollbar-thumb:hover,#sidebar::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.15)}html:not(.dark) #sidebar-content::-webkit-scrollbar-thumb,html:not(.dark) #sidebar::-webkit-scrollbar-thumb{background:rgba(0,0,0,.05)}html:not(.dark) #sidebar-content::-webkit-scrollbar-thumb:hover,html:not(.dark) #sidebar::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.15)}"}],"page":{"pagePath":"platform/context-vs-custom-rules","slug":"/platform/context-vs-custom-rules","pageMetadata":{"title":"Repository Context vs. Custom Rules","description":"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.","href":"/platform/context-vs-custom-rules"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,blockquote:`blockquote`,code:`code`,em:`em`,li:`li`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,AccordionGroup,Card,Columns,Heading,Info,Note,Step,Steps,Tab,Table,Tabs,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!AccordionGroup)_missingMdxReference(`AccordionGroup`,true);if(!Card)_missingMdxReference(`Card`,true);if(!Columns)_missingMdxReference(`Columns`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`ZeroPath gives you two natural-language surfaces for tuning scans: `,_jsx(_components.strong,{children:_jsx(_components.a,{href:`/platform/repo-context`,children:`Repository Context`})}),` and `,_jsx(_components.strong,{children:_jsx(_components.a,{href:`/platform/custom-rules`,children:`Custom Rules`})}),`. They sound similar but do different jobs, and most of the value comes from using them together. This page is a side-by-side reference for choosing between them.`]}),`\n`,_jsxs(Columns,{cols:2,children:[_jsx(Card,{title:`Repository Context`,icon:`book-open-cover`,href:`/platform/repo-context`,children:_jsxs(_components.p,{children:[`A natural-language knowledge layer that tells ZeroPath things about your codebase it cannot\ninfer from code alone. `,_jsx(_components.strong,{children:`Refines existing findings — reduces false positives.`})]})}),_jsx(Card,{title:`Custom Rules`,icon:`shield-check`,href:`/platform/custom-rules`,children:_jsxs(_components.p,{children:[`Natural-language security policies ZeroPath evaluates during scans across your selected\nrepositories. `,_jsx(_components.strong,{children:`Generates new findings when violated.`})]})})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Declarative vs. imperative is the cleanest mental split. Context says `,_jsx(_components.em,{children:`“X is already true in our\nstack.”`}),` Rules say `,_jsx(_components.em,{children:`“X must always hold; flag any violation.”`})]})}),`\n`,_jsx(Heading,{level:`2`,id:`at-a-glance`,children:`At a glance`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Dimension`}),_jsx(_components.th,{children:`Repository Context`}),_jsx(_components.th,{children:`Custom Rules`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Purpose`})}),_jsx(_components.td,{children:`Reduce false positives, teach ZeroPath your architecture`}),_jsx(_components.td,{children:`Enforce org-specific security policy, cover gaps in built-in SAST`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Phrasing`})}),_jsx(_components.td,{children:`Declarative — facts about your stack`}),_jsx(_components.td,{children:`Imperative — policies that must hold`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Effect on findings`})}),_jsx(_components.td,{children:`Refines existing findings; reduces noise`}),_jsx(_components.td,{children:`Generates new findings alongside SAST results`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Visibility to engineers`})}),_jsx(_components.td,{children:`Invisible improvement — fewer false alarms in PRs`}),_jsx(_components.td,{children:`Visible findings with severity, confidence, file, and remediation`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Mental model`})}),_jsx(_components.td,{children:`”Onboarding doc for ZeroPath\"`}),_jsx(_components.td,{children:`\"Linter for security policy”`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Best entry point`})}),_jsxs(_components.td,{children:[`One-click `,_jsx(_components.strong,{children:`Generate \u0026 Save Context`}),` from a false positive`]}),_jsxs(_components.td,{children:[`Browse `,_jsx(_components.strong,{children:`Rule Packs`}),`, then author custom rules for gaps`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`when-to-use-each`,children:`When to use each`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Reach for Repository Context`,id:`reach-for-repository-context`,children:[_jsx(_components.p,{children:`Use Repository Context when ZeroPath is producing noise on patterns that are actually safe in\nyour codebase — facts the code itself cannot reveal.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Trigger signals`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`The same false positive keeps reappearing across scans`}),`\n`,_jsx(_components.li,{children:`Findings on internal-only or dev-only paths that are not externally reachable`}),`\n`,_jsx(_components.li,{children:`Code uses safe wrappers, sanitizers, or middleware that ZeroPath cannot recognize`}),`\n`,_jsx(_components.li,{children:`Architectural facts hidden from the code (gateways, ingress, middleware, runtime sandboxes)`}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Typical examples`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.em,{children:`“All endpoints in this service sit behind a JWT gateway — anonymous access is not possible.”`})}),`\n`,_jsx(_components.li,{children:_jsxs(_components.em,{children:[`“The `,_jsx(_components.code,{children:`eval()`}),` call in `,_jsx(_components.code,{children:`src/sandbox/`}),` runs inside a restricted Docker container with no network access.”`]})}),`\n`,_jsx(_components.li,{children:_jsx(_components.em,{children:`“Rate limiting is enforced at the load balancer for all public-facing routes.”`})}),`\n`]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`Do `,_jsx(_components.strong,{children:`not`}),` use Repository Context to suppress a finding you simply do not want to fix, or to\npaper over missing detection. Over-broad context — e.g. asserting org-wide JWT enforcement\nwhen one repo allows anonymous endpoints — silently hides real findings.`]})})]}),_jsxs(Tab,{title:`Reach for Custom Rules`,id:`reach-for-custom-rules`,children:[_jsx(_components.p,{children:`Use Custom Rules when you have an organization-specific policy that built-in SAST does not\nenforce.`}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Trigger signals`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Your organization has security policies not covered by built-in SAST`}),`\n`,_jsx(_components.li,{children:`Compliance frameworks (PCI, HIPAA, SOC 2) require code-level enforcement`}),`\n`,_jsx(_components.li,{children:`You want internal coding standards enforced consistently across repos`}),`\n`,_jsx(_components.li,{children:`Idiomatic patterns specific to your stack need a dedicated check`}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Typical examples`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.em,{children:`“Flag any API endpoint that returns user email addresses without the caller having admin scope.”`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.em,{children:`“Find logging statements that include request bodies which may contain passwords or tokens.”`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.em,{children:`“All database queries must use parameterized queries instead of string concatenation.”`})}),`\n`]}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`Avoid duplicating built-in SAST checks, bundling multiple unrelated concerns into one rule,\nor writing vague rules like `,_jsx(_components.em,{children:`“APIs should be secure.”`}),` Vague rules give ZeroPath nothing\nconcrete to enforce.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`targeting-and-scope`,children:`Targeting and scope`}),`\n`,_jsx(_components.p,{children:`Both features support the same three-level scope cascade and glob-based file scoping, but only Repository Context lets you target individual scan phases and input types.`}),`\n`,_jsx(Heading,{level:`3`,id:`shared-scope-cascade`,children:`Shared: scope cascade`}),`\n`,_jsxs(_components.p,{children:[`Both features follow the same `,_jsx(_components.strong,{children:`org → tag → repo`}),` inheritance model as `,_jsx(_components.a,{href:`/platform/scanner-settings`,children:`scanner settings`}),`.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Scope`}),_jsx(_components.th,{children:`Applies to`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Organization`})}),_jsx(_components.td,{children:`All repositories in the organization, including ones added later`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Tag`})}),_jsx(_components.td,{children:`All repositories with the selected tag(s)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Repository`})}),_jsx(_components.td,{children:`Only the selected repository or repositories`})]})]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Scopes `,_jsx(_components.strong,{children:`stack`}),` — a repository receives its own entries plus tag-level and org-level entries\nthat apply to it. More specific scopes never replace broader ones.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`shared-file-level-glob`,children:`Shared: file-level glob`}),`\n`,_jsx(_components.p,{children:`Both features accept a glob pattern to limit which files they apply to. The default is all files.`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Pattern`}),_jsx(_components.th,{children:`Matches`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`**`})}),_jsx(_components.td,{children:`All files (default)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`src/api/**`})}),_jsxs(_components.td,{children:[`All files under `,_jsx(_components.code,{children:`src/api/`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`**/*.controller.ts`})}),_jsx(_components.td,{children:`All TypeScript controller files`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`services/auth/**`})}),_jsx(_components.td,{children:`All files in the auth service`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`context-only-scan-phases-and-input-types`,children:`Context-only: scan phases and input types`}),`\n`,_jsx(_components.p,{children:`Repository Context has two extra targeting dimensions — useful when a fact is only relevant to a particular kind of analysis. Custom rules are always evaluated in the natural-language rule phase against identified sources, so they do not expose phase selection.`}),`\n`,_jsxs(AccordionGroup,{children:[_jsxs(Accordion,{title:`Scan phases (Context only)`,id:`scan-phases-context-only`,children:[_jsxs(_components.p,{children:[`Six phases are selectable under `,_jsx(_components.strong,{children:`Advanced Settings`}),` when creating a context entry:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Phase`}),_jsx(_components.th,{children:`What ZeroPath is doing`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Application identification`})}),_jsx(_components.td,{children:`Understanding what your code does — services, modules, entry points`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Source identification`})}),_jsx(_components.td,{children:`Finding where untrusted data enters your application`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Sink identification`})}),_jsx(_components.td,{children:`Finding where data flows to sensitive operations`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Vulnerability investigation`})}),_jsx(_components.td,{children:`Evaluating whether potential issues are real, exploitable vulnerabilities`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Logic analysis`})}),_jsx(_components.td,{children:`Analyzing business logic for issues beyond typical code patterns`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Custom rule evaluation`})}),_jsx(_components.td,{children:`Evaluating your custom rules against the codebase`})]})]})]}),_jsx(_components.p,{children:`If you are unsure which to select, leave all phases enabled — ZeroPath applies your context\nwherever it is relevant.`})]}),_jsxs(Accordion,{title:`Input types (Context only)`,id:`input-types-context-only`,children:[_jsxs(_components.p,{children:[`Eight input types are selectable under `,_jsx(_components.strong,{children:`Advanced Settings`}),`:`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Input type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`HTTP Handler`})}),_jsx(_components.td,{children:`Web API endpoints and HTTP request handlers`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`File Handler`})}),_jsx(_components.td,{children:`File upload and file system input processing`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Stdin Handler`})}),_jsx(_components.td,{children:`Command-line stdin and pipe input`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Browser Data`})}),_jsx(_components.td,{children:`Client-side browser input (cookies, local storage, DOM)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`WebSocket`})}),_jsx(_components.td,{children:`WebSocket message handlers`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Socket`})}),_jsx(_components.td,{children:`Raw TCP/UDP socket connections`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`CLI Argument`})}),_jsx(_components.td,{children:`Command-line arguments and flags`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Mobile Inputs`})}),_jsx(_components.td,{children:`Mobile application user input`})]})]})]}),_jsx(_components.p,{children:`All input types are selected by default. Deselect the ones that are not relevant to narrow the\nscope.`})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`how-they-work-together`,children:`How they work together`}),`\n`,_jsxs(_components.p,{children:[`Context and Custom Rules are most useful in combination. Without context, a rule that says `,_jsx(_components.em,{children:`“must check auth”`}),` has no idea what an auth check looks like in your stack. Without rules, context only reduces noise on built-in detections — it cannot enforce your own policies.`]}),`\n`,_jsx(Heading,{level:`3`,id:`worked-example-enforcing-auth-on-pii-endpoints`,children:`Worked example: enforcing auth on PII endpoints`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Org-level Repository Context`,children:[_jsxs(_components.p,{children:[`Define what `,_jsx(_components.em,{children:`“authenticated”`}),` means across the organization.`]}),_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Authentication =`}),` a request that carries a valid JWT validated by the `,_jsx(_components.code,{children:`requireAuth()`}),`\nmiddleware, `,_jsx(_components.strong,{children:`or`}),` presents an mTLS client certificate at ingress.`]}),`\n`]})]}),_jsxs(Step,{title:`Repo-level Repository Context (e.g. payments-api)`,children:[_jsxs(_components.p,{children:[`Define what `,_jsx(_components.em,{children:`“PII”`}),` means in this repository.`]}),_jsxs(_components.blockquote,{children:[`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`PII fields include`}),` `,_jsx(_components.code,{children:`card_last4`}),`, `,_jsx(_components.code,{children:`billing_email`}),`, `,_jsx(_components.code,{children:`customer_phone`}),`.`]}),`\n`]})]}),_jsxs(Step,{title:`Org-scoped Custom Rule`,children:[_jsx(_components.p,{children:`State the policy.`}),_jsxs(_components.blockquote,{children:[`\n`,_jsx(_components.p,{children:_jsx(_components.em,{children:`All endpoints exposing PII must require authentication.`})}),`\n`]})]}),_jsx(Step,{title:`Result`,children:_jsxs(_components.p,{children:[`ZeroPath now flags only endpoints that handle PII fields `,_jsx(_components.strong,{children:`and`}),` bypass one of the two\nrecognized auth mechanisms. Endpoints behind `,_jsx(_components.code,{children:`requireAuth()`}),` or mTLS are correctly treated as\nsafe; everything else surfaces as a high-signal finding.`]})})]}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Without the context entries, the same rule would produce lower-confidence findings everywhere the\nmodel wasn’t sure how your stack handles authentication or what counts as PII. Pairing rules with\ncontext is what makes findings actionable.`})}),`\n`,_jsx(Heading,{level:`2`,id:`lifecycle-and-management`,children:`Lifecycle and management`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Repository Context`,id:`repository-context`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Where to manage:`}),` `,_jsx(_components.a,{href:`https://zeropath.com/app/context`,children:`Settings → Repository context`}),` in the dashboard. Table\nview with title (or body preview), file pattern, tags, and repository scope.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Creation paths`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Manual creation in the dashboard`}),`\n`,_jsxs(_components.li,{children:[`One-click `,_jsx(_components.strong,{children:`Generate \u0026 Save Context`}),` from any false positive — no review step, takes effect\non the next scan`]}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Editing and deletion`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Click a row to edit text, targeting, or scope`}),`\n`,_jsx(_components.li,{children:`Individual or bulk delete with confirmation`}),`\n`,_jsx(_components.li,{children:`Changes take effect on the next scan`}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Review cadence:`}),` quarterly. Architecture drifts; stale context can hide real issues. Delete\nentries that no longer reflect reality.`]})]}),_jsxs(Tab,{title:`Custom Rules`,id:`custom-rules`,children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Where to manage:`}),` `,_jsx(_components.a,{href:`https://zeropath.com/app/rules`,children:`Settings → Rules`}),` → `,_jsx(_components.strong,{children:`Custom rules`}),` tab. The\nsibling `,_jsx(_components.strong,{children:`Rule Packs`}),` tab exposes curated bundles published by ZeroPath that you can enable\nwithout authoring.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Creation paths`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Manual creation in the dashboard`}),`\n`,_jsxs(_components.li,{children:[`Enable `,_jsx(_components.strong,{children:`Rule Packs`}),` — no authoring needed`]}),`\n`,_jsx(_components.li,{children:`v2 API for programmatic management`}),`\n`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Editing and deletion`})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Update name, description, rule text, or scope`}),`\n`,_jsxs(_components.li,{children:[`Switch between `,_jsx(_components.code,{children:`allRepositories`}),` and specific `,_jsx(_components.code,{children:`repositoryIds`}),` (mutually exclusive in the same\nrequest)`]}),`\n`,_jsx(_components.li,{children:`Delete rules that are no longer needed`}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Review cadence:`}),` quarterly, or after major architectural change. Refine rules as you see\nwhich findings are actionable vs. noise.`]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Custom Rules Only mode`}),` — the `,_jsx(_components.strong,{children:`Custom rules only`}),` toggle in `,_jsx(_components.a,{href:`/platform/scanner-settings`,children:`scanner\nsettings`}),` disables every built-in scanning module (SAST, SCA, IaC,\nSecrets, EOL) and evaluates only your natural-language rules. This is rarely the right choice;\nenable it only when you intentionally want ZeroPath to run as a pure custom-rule engine.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`pitfalls-to-avoid`,children:`Pitfalls to avoid`}),`\n`,_jsxs(AccordionGroup,{children:[_jsx(Accordion,{title:`Over-broad context that silently suppresses findings`,id:`over-broad-context-that-silently-suppresses-findings`,children:_jsxs(_components.p,{children:[`The single most dangerous mistake. Saying `,_jsx(_components.em,{children:`“all endpoints require JWT”`}),` at org scope is fine\nonly if it is `,_jsx(_components.strong,{children:`literally true everywhere`}),`. One legacy service with an anonymous endpoint and\nyou have just taught ZeroPath to ignore a real finding. Start narrow; widen only when the\nstatement is provably true across the broader scope.`]})}),_jsx(Accordion,{title:`Vague rules that produce noise`,id:`vague-rules-that-produce-noise`,children:_jsxs(_components.p,{children:[_jsx(_components.em,{children:`“APIs should be secure”`}),` is not enforceable. Rules need a concrete, testable assertion: a\nspecific behavior that either holds or doesn’t. If you cannot describe how a reviewer would\ncheck the rule by hand, ZeroPath cannot enforce it consistently either.`]})}),_jsx(Accordion,{title:`Using context to mask findings instead of stating facts`,id:`using-context-to-mask-findings-instead-of-stating-facts`,children:_jsx(_components.p,{children:`Context is for facts that are true in your codebase, not for hiding findings you don’t want\nto triage. If the underlying claim isn’t true, the entry will eventually hide a real bug.`})}),_jsx(Accordion,{title:`Rules without supporting context`,id:`rules-without-supporting-context`,children:_jsxs(_components.p,{children:[`Standalone rules produce findings, but ZeroPath has to guess what `,_jsx(_components.em,{children:`“auth check”`}),` or\n`,_jsx(_components.em,{children:`“sanitized input”`}),` means in your stack. Pair every non-trivial rule with the context it needs\nto recognize the safe pattern.`]})}),_jsx(Accordion,{title:`Leaving all input types and phases enabled by default`,id:`leaving-all-input-types-and-phases-enabled-by-default`,children:_jsx(_components.p,{children:`Default targeting is intentionally permissive. When you know a context entry only applies to\nHTTP handlers during source identification, narrow it. Over-broad targeting makes irrelevant\ncontext bleed into unrelated analysis.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`suggested-rollout`,children:`Suggested rollout`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Week 1 — Baseline`,children:_jsxs(_components.p,{children:[`Connect repos, run full scans, and enable the relevant `,_jsx(_components.a,{href:`https://zeropath.com/app/rules?tab=packs`,children:_jsx(_components.strong,{children:`Rule\nPacks`})}),`. No custom work yet — let the baseline\nsurface where the noise is.`]})}),_jsx(Step,{title:`Week 2 — Triage into context`,children:_jsxs(_components.p,{children:[`For every false positive, use the one-click `,_jsx(_components.strong,{children:`Generate \u0026 Save Context`}),` workflow. Aim to\nconvert roughly 80% of FPs into context entries. This is the highest-ROI step.`]})}),_jsx(Step,{title:`Week 3 — Author rules for policy gaps`,children:_jsx(_components.p,{children:`Identify org-specific policies not covered by built-in SAST or Rule Packs. Write 3–5 custom\nrules. For each, add the supporting context entries that describe the safe patterns the rule\nmust recognize.`})}),_jsx(Step,{title:`Week 4 — Tag, review, and own`,children:_jsx(_components.p,{children:`Tag rules and context entries by team or compliance framework. Assign a quarterly review owner\nso entries don’t go stale as the codebase evolves.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`quick-reference`,children:`Quick reference`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Situation`}),_jsx(_components.th,{children:`Use`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Same false positive keeps appearing`}),_jsx(_components.td,{children:`Repository Context`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Internal-only service flagged as public`}),_jsx(_components.td,{children:`Repository Context`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Safe wrapper or helper not recognized`}),_jsx(_components.td,{children:`Repository Context`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Architectural fact every engineer knows but the code doesn’t show`}),_jsx(_components.td,{children:`Repository Context`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Compliance policy needs code-level enforcement`}),_jsx(_components.td,{children:`Custom Rule`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Org-wide coding standard to enforce`}),_jsx(_components.td,{children:`Custom Rule`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Built-in SAST misses a pattern specific to your stack`}),_jsx(_components.td,{children:`Custom Rule`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Need to enforce a policy `,_jsx(_components.strong,{children:`and`}),` teach ZeroPath what safe looks like`]}),_jsx(_components.td,{children:`Both, paired`})]})]})]}),`\n`,_jsxs(Columns,{cols:2,children:[_jsx(Card,{title:`Repository Context docs`,icon:`arrow-right`,href:`/platform/repo-context`,children:_jsx(_components.p,{children:`Targeting axes, false-positive workflow, scope inheritance, and best practices.`})}),_jsx(Card,{title:`Custom Rules docs`,icon:`arrow-right`,href:`/platform/custom-rules`,children:_jsx(_components.p,{children:`Authoring rules, the v2 API, Rule Packs, and Custom Rules Only mode.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Repository Context vs. Custom Rules","description":"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.","href":"/platform/context-vs-custom-rules"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"At a glance","slug":"at-a-glance","depth":2,"children":[]},{"title":"When to use each","slug":"when-to-use-each","depth":2,"children":[]},{"title":"Targeting and scope","slug":"targeting-and-scope","depth":2,"children":[{"title":"Shared: scope cascade","slug":"shared-scope-cascade","depth":3,"children":[]},{"title":"Shared: file-level glob","slug":"shared-file-level-glob","depth":3,"children":[]},{"title":"Context-only: scan phases and input types","slug":"context-only-scan-phases-and-input-types","depth":3,"children":[]}]},{"title":"How they work together","slug":"how-they-work-together","depth":2,"children":[{"title":"Worked example: enforcing auth on PII endpoints","slug":"worked-example-enforcing-auth-on-pii-endpoints","depth":3,"children":[]}]},{"title":"Lifecycle and management","slug":"lifecycle-and-management","depth":2,"children":[]},{"title":"Pitfalls to avoid","slug":"pitfalls-to-avoid","depth":2,"children":[]},{"title":"Suggested rollout","slug":"suggested-rollout","depth":2,"children":[]},{"title":"Quick reference","slug":"quick-reference","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"zeropath","siteName":"ZeroPath Documentation","title":"Repository Context vs. Custom Rules - ZeroPath Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/platform/context-vs-custom-rules","matchLevel":0},"pt":{"href":"/pt/platform/context-vs-custom-rules","matchLevel":1}}},"lastModified":"2026-10-16T00:44:37.187Z","originalFileLocation":"platform/context-vs-custom-rules.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.\">\u003cmeta data-mint-head name=\"application-name\" content=\"ZeroPath Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Repository Context vs. Custom Rules - ZeroPath Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"ZeroPath Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://zeropath.com/docs/platform/context-vs-custom-rules\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zeropath.mintlify.app/_mintlify/api/og/v2?division=Settings\u0026amp;title=Repository+Context+vs.+Custom+Rules\u0026amp;description=Two+natural-language+surfaces+in+ZeroPath+%E2%80%94+one+teaches+the+scanner+what+is+already+true+in+your+codebase%2C+the+other+defines+new+policies+it+must+enforce.+Use+t\u0026amp;theme=d6b8365df04f7be0e5d1d259\u0026amp;signature=ea6dd1dfe5f6897e3bb1ac11f0efc40a8db309484b876465a620a1c30b50b933\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Repository Context vs. Custom Rules - ZeroPath Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zeropath.mintlify.app/_mintlify/api/og/v2?division=Settings\u0026amp;title=Repository+Context+vs.+Custom+Rules\u0026amp;description=Two+natural-language+surfaces+in+ZeroPath+%E2%80%94+one+teaches+the+scanner+what+is+already+true+in+your+codebase%2C+the+other+defines+new+policies+it+must+enforce.+Use+t\u0026amp;theme=d6b8365df04f7be0e5d1d259\u0026amp;signature=ea6dd1dfe5f6897e3bb1ac11f0efc40a8db309484b876465a620a1c30b50b933\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/zeropath/cy-InRTurylVBS7Q/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"ZeroPath Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3B82F6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://zeropath.com/docs/platform/context-vs-custom-rules\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/platform/context-vs-custom-rules.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://zeropath.com/docs/platform/context-vs-custom-rules\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"pt\" href=\"https://zeropath.com/docs/pt/platform/context-vs-custom-rules\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://zeropath.com/docs/platform/context-vs-custom-rules\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://zeropath.com/#organization\",\"name\":\"ZeroPath Documentation\",\"url\":\"https://zeropath.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/zeropath/6zbHY4NJRijPMEJo/logo/light.svg?fit=max\u0026auto=format\u0026n=6zbHY4NJRijPMEJo\u0026q=85\u0026s=aace36c86b3bf8423db31fabdbae24fd\"}},{\"@type\":\"WebSite\",\"@id\":\"https://zeropath.com/docs#website\",\"name\":\"ZeroPath Documentation\",\"url\":\"https://zeropath.com/docs\",\"publisher\":{\"@id\":\"https://zeropath.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://zeropath.com/docs/platform/context-vs-custom-rules#webpage\",\"url\":\"https://zeropath.com/docs/platform/context-vs-custom-rules\",\"name\":\"Repository Context vs. Custom Rules\",\"description\":\"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.\",\"dateModified\":\"2026-10-16T00:44:37.187Z\",\"isPartOf\":{\"@id\":\"https://zeropath.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://zeropath.com/docs/platform/context-vs-custom-rules#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://zeropath.com/docs/platform/context-vs-custom-rules#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Platform\",\"item\":\"https://zeropath.com/docs/platform/ai-assistant\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Settings\",\"item\":\"https://zeropath.com/docs/platform/teams\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Repository Context vs. Custom Rules\",\"item\":\"https://zeropath.com/docs/platform/context-vs-custom-rules\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://zeropath.com/docs/platform/context-vs-custom-rules#article\",\"headline\":\"Repository Context vs. Custom Rules\",\"name\":\"Repository Context vs. Custom Rules\",\"description\":\"Two natural-language surfaces in ZeroPath — one teaches the scanner what is already true in your codebase, the other defines new policies it must enforce. Use them together.\",\"url\":\"https://zeropath.com/docs/platform/context-vs-custom-rules\",\"mainEntityOfPage\":{\"@id\":\"https://zeropath.com/docs/platform/context-vs-custom-rules#webpage\"},\"dateModified\":\"2026-10-16T00:44:37.187Z\",\"publisher\":{\"@id\":\"https://zeropath.com/#organization\"},\"isPartOf\":{\"@id\":\"https://zeropath.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"ZeroPath Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"ZeroPath Documentation","nav":{"global":{"anchors":[{"anchor":"Dashboard","icon":"grid","href":"https://zeropath.com/app"},{"anchor":"Status","icon":"signal","href":"https://status.zeropath.com"}]},"languages":[{"language":"en","tabs":[{"tab":"Guides","groups":[{"group":"Getting Started","pages":[{"title":"Documentation","mode":"wide","href":""},{"title":"Quick Start","href":"/quickstart"},{"title":"Navigating ZeroPath","href":"/platform/navigation"}]},{"group":"Assets","pages":[{"title":"Repositories","href":"/platform/repositories"},{"title":"Monorepo partitions","href":"/platform/monorepos"}]},{"group":"Findings","pages":[{"title":"Issues","href":"/platform/issues"},{"title":"Scans","href":"/platform/scans"}]},{"group":"Scanning","pages":[{"title":"SAST Overview","href":"/scanning/sast-overview"},{"title":"PR Scanning","href":"/scanning/pr-scanning"},{"title":"Bot Commands","href":"/scanning/bot-commands"},{"title":"Secrets Scanning","href":"/scanning/secrets"},{"title":"IaC Scanning","href":"/scanning/iac"},{"title":"Container Scanning","href":"/scanning/container-scanning"},{"title":"Dynamic Testing (DAST)","href":"/scanning/runtime-validation"},{"title":"Auto-Fix \u0026 Patches","href":"/scanning/auto-fix"},{"title":"Fix Verification","href":"/scanning/fix-verification"}]},{"group":"SCA","pages":[{"title":"SCA Overview","href":"/sca/overview"},{"title":"Supported Ecosystems","href":"/sca/ecosystems"},{"title":"Coverage \u0026 Warnings","href":"/sca/coverage"},{"title":"Reachability Analysis","href":"/sca/reachability"},{"title":"License Compliance","href":"/sca/licenses"},{"title":"AI Inventory (AI-BOM)","href":"/sca/ai-inventory"},{"title":"Auto-remediation \u0026 Alerts","href":"/sca/remediation"},{"title":"Blast Radius","href":"/sca/blast-radius"},{"title":"SCA SBOM Exports","href":"/sca/sbom-exports"}]},{"group":"Platform","pages":[{"group":"Automation","pages":[{"title":"AI AppSec Assistant","sidebarTitle":"Assistant","href":"/platform/ai-assistant"}]},{"group":"Reporting","pages":[{"title":"Reports","href":"/platform/reports"},{"title":"SLAs, SLOs \u0026 SLIs","sidebarTitle":"SLA","href":"/platform/sla"},{"title":"Audit log","href":"/platform/audit-log"},{"title":"Compliance \u0026 GRC","href":"/platform/compliance"}]},{"group":"Settings","pages":[{"title":"Teams \u0026 Permissions","href":"/platform/teams"},{"title":"Repository tags","href":"/platform/repository-tags"},{"title":"Scanner Settings","href":"/platform/scanner-settings"},{"title":"Custom Rules","href":"/platform/custom-rules"},{"title":"Repository Context","description":"Give ZeroPath background knowledge about your codebase to improve scan accuracy and reduce false positives","href":"/platform/repo-context"},{"title":"Repository Context vs. Custom Rules","href":"/platform/context-vs-custom-rules"},{"title":"Threat Model","description":"Review and edit the application context ZeroPath uses for SAST triage, Dynamic Testing, and prioritization","href":"/platform/threat-model"}]}]},{"group":"Developer Tools","pages":[{"title":"VS Code Extension","href":"/developer-tools/vscode"},{"title":"MCP Server","href":"/mcp/overview"},{"title":"Remote MCP Server","href":"/mcp/remote"},{"title":"MCP Installation","href":"/mcp/installation"},{"title":"MCP Tools Reference","href":"/mcp/tools"},{"title":"On-Demand Code Scans Beta","href":"/developer-tools/async-code-scans"},{"group":"Coding Agents","pages":[{"title":"Coding Agent Integrations","href":"/developer-tools/coding-agents/overview"},{"title":"Claude Code","href":"/developer-tools/coding-agents/claude-code"},{"title":"OpenAI Codex","href":"/developer-tools/coding-agents/codex"},{"title":"Cursor","href":"/developer-tools/coding-agents/cursor"},{"title":"Configuration","href":"/developer-tools/coding-agents/configuration"}]}]},{"group":"Integrations","pages":[{"title":"GitHub Enterprise Integration","href":"/integrations/github-enterprise-server"},{"title":"GitLab Integration","href":"/integrations/gitlab"},{"title":"Azure DevOps Integration","href":"/integrations/azure-devops"},{"title":"Bitbucket Data Center Integration","href":"/integrations/bitbucket-data-center"},{"title":"Gerrit Integration","href":"/integrations/gerrit"},{"title":"CVS Integration","href":"/integrations/cvs"},{"title":"Private Registries","href":"/integrations/private-registries"},{"title":"Wiz Integration","href":"/integrations/wiz"},{"title":"Exposure Information","href":"/integrations/wiz-exposure"},{"title":"UVM Integration","href":"/integrations/wiz-uvm"},{"title":"Jira Integration","href":"/integrations/jira"},{"title":"Linear Integration","href":"/integrations/linear"},{"title":"Slack Integration","href":"/integrations/slack"},{"title":"Microsoft Teams Integration","href":"/integrations/microsoft-teams"},{"title":"Security Compass / SD Elements","href":"/integrations/security-compass"}]},{"group":"Authentication","pages":[{"title":"Enterprise SSO \u0026 Directory Sync","href":"/authentication/enterprise-sso"},{"title":"Self-Hosted SSO (OIDC)","href":"/authentication/self-hosted-sso"},{"title":"API Tokens","href":"/authentication/api-tokens"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/introduction"}]},{"tab":"Webhooks","pages":[{"title":"Webhooks","href":"/webhook/introduction"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"language":"pt","pages":[{"title":"pt","href":"/pt/platform/context-vs-custom-rules"}]}]},"basePath":"","title":"Repository Context vs. Custom Rules - ZeroPath Documentation","buildId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","deploymentId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","dynamics":[],"chunks":[]}