Repository navigation
Description
Summary
Some findings are right in general but not actionable on a given platform, for one known item or URL. Today the only switch is disabling the whole rule, which also drops the cases that are actionable. Only a few rules take excludePatterns (links/orphan-pages, links/dead-end-pages, crawl/all-noindex-pages).
Examples from our Shopify audits:
security/cookie-flags(cookie-httponly,cookie-secure): Shopify setslocalizationandcart_currencyitself; merchant cookies on the same site must stay reported. We keep the rule on and drop the finding in post-processing only when every item is one of those two names.a11ylabel-name mismatch on Shopify Markets' native country<select>: option text such as "🇩🇪 Deutschland · EUR €" vsaria-label="Land auswählen"; the select is rendered by Shopify.
Request
A generic per-rule option, available on every rule, that drops matching items before the finding is built (and drops the finding when no item is left):
[rule_options."security/cookie-flags"]
ignore_items = ["localization", "cart_currency"] # matched against item id/value
[rule_options."a11y/label-content-name-mismatch"]
ignore_selectors = ["localization-form select"]
[rule_options."perf/ttfb"]
ignore_urls = ["/apps/"] # same pattern forms as excludePatternsIgnored items could be counted in the check (ignoredCount) so the report stays honest.
Why
We maintain item filters per platform outside squirrel (about 150 lines) and they break silently when item shapes change between releases. In config they would be versioned with the audit and visible in the report.
Triage
Only a handful of rules take excludePatterns, each declared in its own optionsSchema and applied in its own run(): links/orphan-pages, links/dead-end-pages, links/no-contextual-inbound and links/weak-internal-links, all using matchesExcludePattern from packages/utils/src/patterns.ts. The reporter lists crawl/all-noindex-pages too; the list is otherwise accurate and there is no generic mechanism. rule_options is free-form per rule (packages/config/src/schema.ts), validated against the rule's Zod schema, so unknown keys are not a generic channel today. Items are CheckItem (packages/core-contracts/src/index.ts): id, optional label, snippet, sourcePages, meta; there is no value field, so ignore_items would match id (and possibly label). A central filter is feasible: drop matching CheckItems from each check after the rule returns, and drop the check (or turn a fail into a pass) when no item is left, which needs no per-rule code. Risks: rules whose status or message is computed before items are built (counts, details, scores) would disagree with the filtered items, and the streaming and cached rule paths (rule-cache.ts, streaming.ts) must key the cache on the option. Recommend building ignore_items and ignore_urls as a central post-filter with an ignoredCount on the check, scoped to rules whose checks carry items; defer ignore_selectors (needs per-rule selector semantics) and say so. Do not silently drop findings: the ignored count must show in the report.
Acceptance Criteria
Rewritten after the decision of 2026-10-29 (one engine-level ignore, see the spec comment). The original criteria used per-rule ignore_items / ignore_urls options.
-
[[ignore]]entries (rule, optionalchecks,items,urls,reason) are accepted insquirrel.tomlwithout per-rule schema changes;squirrel config validaterejects an entry with neitheritemsnorurls, an unknown rule,rule_optionskeys namedignore*, andselectors("not supported yet"). - Items whose
idorlabelmatch anitemsmatcher (exact by default,glob:,regex:) are removed from the check before the finding is counted; a check left with no items becomes a pass with an "N waived" note (denominators and scores stay stable;--no-ignoreshows the unwaived result). -
urlsaccepts theexcludePatternsforms; a page-scope rule is not run on a matching page and emits a visible skipped check (skipReason: "ignored"); items listingsourcePageslose the matching pages. - A test with the
security/cookie-flagscase:localizationandcart_currencyignored, a merchant cookie still reported, and the message and counts built from the remaining cookies. - Checks record
ignored, the report recordsmeta.ignored(waived items and pages per rule and per entry, withreason), and the console, text, markdown, LLM, JSON and HTML reports say that findings were ignored; entries that matched nothing are listed. - Scores and counts are computed from the remaining items. Messages: for a rule with
messageCountsItemsonly the first number in the message is replaced with the remaining count; every rule whose check keeps some items then gets an(N ignored)suffix; a check with every item waived reads as a pass,N waived by squirrel.toml: <the original message>; a message that names its items (the platform-cookie note lists cookie names) is not rewritten and may still name a waived item. (Restated from thectx.ignoreopt-in, which was not built.) - Changing an entry invalidates the cached results of the rules it targets and no others; a fanned template sibling is not affected by another page's URL ignore; carried (smart audit) findings honour the ignore.
- Rules marked
ignorable: false(onlyintegrity/*and the threat-intel rules) cannot be named by an entry:squirrel config validateerrors and the engine skips the entry with a notice. -
reasonis optional and shown in the report and dashboard when present; fields within an entry AND, entries OR. -
squirrel audit --no-ignoreruns without the table (ships in the first PR). - With no
[[ignore]]entries the output is byte-identical to today. - Cloud: website settings accept the same entries (private follow-up), with API-side caps.
- Selector ignores are tracked in a follow-up issue. (Moot:
selectorsentries are already implemented, seepackages/rules/src/ignore-selector.tsanddocs/configuration/ignore.mdx.) - Config reference docs (
docs/configuration/ignore.mdx), report docs and completions are updated andmake validatepasses indocs/; the agent skill change is filed as askillsissue. -
scripts/test-suites.ts --run rulesand--run restpass.
Activity
nc9 commentedon Oct 29, 2026
Thanks @deniskern, this is a real gap: disabling a rule is too blunt. We will build a generic per-rule ignore for items and URLs with an ignored count in the report, and track selector ignores separately. Queued.
nc9 commentedon Oct 30, 2026
Decision (Nik, 2026-10-29): one generic engine-level
ignoreapplied to every rule's results, items and URLs first, selectors later, instead of per-rule options. This is a large change, so a short spec (config shape, matching semantics, interaction with excludePatterns and disabled rules, report wording for ignored findings) comes before implementation.nc9 commentedon Oct 30, 2026
Spec: one engine-level
ignoreStatus: decisions made (below); PR 1 in progress. Decision recorded above (Nik, 2026-10-29): a single generic ignore applied to every rule's results, items and URLs first, selectors later, instead of per-rule options. This replaces the
ignore_items/ignore_urls/ignore_selectorsoption names in the issue body and the acceptance criteria are rewritten to match (below).1. Where it plugs in
Every rule result passes through
RuleRunner.runOneRuleinpackages/rules/src/runner.ts(page rules, site rules, fanned template verdicts, cached replays are all rebuilt from checks that came through it). That is the one choke point, and it is before the streaming tallies, the fold and the score, so an ignored finding is simply never counted as a finding. The filter runs afterrun()returns and also after the fanned-verdict substitution (a template sibling's checks are cloned onto this page, so a URL ignore must be judged against this page, not the sibling).Two things the engine already does that the design must respect:
getRuleOptionsparsesrule_options.<rule>with the rule's Zod schema, which strips unknown keys. So an ignore stored underrule_optionswould never reach the rule or the cache key. The ignore therefore lives in its own config table and is not read throughrule_options.pageRuleSignature()(resolved options per rule). The ignore entries that target a rule must be part of that rule's signature, or an edited ignore would replay stale results.2. Config shape (
squirrel.toml)A top-level array of tables, one entry per waiver:
Rules for an entry:
ruleis required. A glob matches rule ids (security/*).*(all rules) needs at least one ofitemsorurls.itemsorurls. An entry with neither would silently turn a rule off, and[rules] disablealready does that, visibly.squirrel config validaterejects it and points atdisable.localizationcookie on/apps/pages"). Across entries they OR. Each entry is evaluated on its own so the report can say which entry waived what.reasonis free text, shown in the report next to the count (and in the dashboard). Recommended, not required.selectorsis reserved: validated as "not supported yet" with a message, never silently accepted (see phase 3).rule_optionskeys namedignore,ignore_items,ignore_urls,ignore_selectorsare reserved.squirrel config validatealready reports unknown option names (rule-options-check.ts); add a specific message pointing at[[ignore]].squirrel.tomlby the CLI and from the website settings by the cloud (section 9). One source per surface keeps "what was ignored" answerable.3. Matcher forms
Both
itemsandurlstake strings:urls: exactly thematchesExcludePatternforms frompackages/utils/src/patterns.ts(substring of the path,/exact-segment/,regex:...:flags), so one learned syntax coversexcludePatterns, thepathsoption of fix(cli): offline level snapshot reports what ran; unreachable start URL writes a report, exit 5 #1275 #1269 #1297, and this. Matched against the page the finding is on.items: exact match by default (not substring:localizationmust not waivelocalization_extra).glob:prefix for*and?wildcards,regex:prefix for a regular expression. Matched againstitem.id, thenitem.label; a match on either waives the item. There is novaluefield onCheckItem, so "id/value" in the issue means id and label.snippetis deliberately not matchable (it is page content and can be large).(a+)+,(a*)*), tested with a bounded input (item ids are already clamped to the medium-string cap byclampCheckItemIds, URLs tomaxUrlLength) and run under the existing rule time budget. This matters more here than forexcludePatternsbecause the cloud accepts the config from a dashboard form (section 9).4. Matching semantics (what an entry does to a result)
For a rule whose id matches the entry's
rule(and a check whosenameis inchecks, when given):urlspresent): if the rule is page-scope andctx.page.urlmatches, the rule is not run for that page. The engine emits oneskippedcheck withskipReason: "ignored",details.foldKey: "ignored"and the entry's reason, exactly like the existing soft-404 and noindex gates inrunOneRule. Skipped checks are excluded from tallies and score, which is the right model for "this page is waived for this rule". It also saves the work.items, drop the items that match (itemsmatchers, and, whenurlsis also present, whosesourcePagesall match; a page-scope item's page isctx.page.url). If an item lists severalsourcePagesand only some matchurls, the matching pages are removed from the item and the item stays while it has a page left.passcheck with the samename, messageN waived by squirrel.toml: <check message>and the ignored count. It is not deleted: the rule ran and found nothing left to act on, and a deleted check would change the page's check count.ignored. Messages anddetailscounts were built by the rule from the full list ("3 cookies lack HttpOnly"), and a central filter cannot rebuild them. Two measures: the engine appends(N ignored)to the message, and a rule can opt into exactness by declaringmeta.ignoreAwareand receivingctx.ignore.filter(items)so it builds the message from the remaining items. Phase 1 migratessecurity/cookie-flags(the motivating case) and any rule whose check message embeds an item count; the rest keep the suffix. This changes the issue's criterion "messages computed from the remaining items" from every rule to the migrated rules, plus an honest suffix for the others.ruleentries with noitems/urls, which is rejected, so such checks are never ignored. The way to silence one isdisable.skippedorpassare never altered.5. Interaction with what exists
[crawler] exclude/excludePatterns(crawl scope)ignore.urlscrawls and counts the page, and waives findings. Docs say which to use: exclude for "never touch", ignore for "touched, finding not actionable".links/orphan-pagesetc.excludePatternsoption[rules] disable/rule_options.<rule>.enabled[[ignore]]naming a disabled rule is reported byconfig validateas unused.rules.enableallowlistspaths, thresholds)audit-engine); if it bypassesrunOneRule, the same filter is applied at injection.6. Reporting, score and honesty
Nothing is dropped silently.
ignored?: { items: number; pages: number; entries: number[] }(indexes into the config list), set whenever the engine removed something. Additive onCheckResult, so older readers ignore it.meta.ignored(JSON) with total waived items, waived pages (skipped for ignore), counts per rule and per entry, and each entry'sreason. Computed from the streaming tallies (addignoredcounters toRuleTally) so it does not need the pages resident.Ignore entry 2 (a11y/select-name) matched nothing. This is the guard against the rot the reporter described (filters that "break silently when item shapes change").Ignored by squirrel.toml: 3 findings on 2 rules, 5 pages (see --verbose); per-issue suffix(2 ignored); markdown, LLM (an<ignored>element with the entries and reasons, so an agent knows the report is filtered and is not tempted to "fix" a waived item) and HTML get the same data.--verboselists each waived item with its entry.--no-ignoreruns the audit with the table disabled for a comparison run and for the question "what did we waive?".--fail-onis evaluated on the filtered report, like every other gate.integrity/*and the threat-intel rules, where an ignore could hide a compromised site) getsmeta.ignorable: false: an entry naming one is aconfig validateerror and the engine skips it with a notice. Everything else is ignorable, includingsecurity/leaked-secrets.7. Cache and the other readers of results
pageRuleSignature()options, so editing an ignore invalidates exactly the rules it touches and not the whole cache. The fingerprint hash of the rules source is not enough: it covers code, not config.rule_resultsare post-filter.squirrel reporton an old audit shows what that audit's config waived; changing the config does not re-open old results (re-run, or--refresh). Documented.8. Selectors (phase 3)
ignore_selectorsneeds a defined meaning per rule. Proposal:CheckItemgets an optionalselector(a CSS path the rule already computes for element findings) andselectorsentries match it with the same exact/glob/regex forms. Rules that cannot say where in the DOM an item is simply cannot be waived by selector, andconfig validatesays so per rule (a11y/label-content-name-mismatchsupports selectors,security/cookie-flagsdoes not). The a11y label-mismatch example in the issue is the first consumer. Until thenselectorsis rejected with "not supported yet" rather than accepted and ignored (the issue's own criterion).9. Cloud
A cloud audit does not read
squirrel.toml; it builds its config from the plan, the website settings and the run (buildCloudConfigmergesdisabledRulePatternsintorules.disable; crawl exclude patterns live inwebsite_settings.exclude_patterns). To honour the same waivers:website_settings.ignore(migration inUserAuditStore.ensureSchema), validated with the same schema as the TOML table (shared Zod schema in@squirrelscan/config), exposed on the website settings API and the MCPget_website_settings/update_website_settings, edited in the dashboard crawl-settings page (a table with rule picker, items, URLs, reason), and merged into the run config next todisabledRulePatterns. Item and entry caps (50 entries, 100 items per entry, 200 characters per matcher) are enforced at the API, because this is user input executed in our workers.meta.ignored, and the dashboard shows the line. A website-level ignore and a localsquirrel.tomlignore are separate: a local run honourssquirrel.toml, a hosted/scheduled run honours the website settings.squirrel configcan print the website's list (squirrel config show --cloud, phase 4) so the two do not drift unnoticed.10. Docs and skill
docs/configuration/ignore.mdx(new: shape, matchers, semantics, examples for the Shopify cases), a section indocs/configuration/rule-options.mdxpointing at it and atexcludePatternsvs ignore, report docs formeta.ignored(docs/configuration/output.mdx),docs/cli/audit.mdxfor--no-ignore, completions, the rule pages of migrated rules.ignoredbefore proposing fixes for a finding). A private issue labelledskillsis filed when the first PR is opened.11. Test plan
packages/rules/src/ignore.ts): every matcher form, case, glob escaping, regex rejection (nested quantifiers, length), bounded input, AND within an entry, OR across entries,checksscoping.skipped/passuntouched; non-ignorable rule refused.localizationandcart_currencyignored, a merchant cookie still reported, message counts correct (migrated rule).pageRuleSignaturetest), and a warm run with an unchanged ignore replays.meta.ignored, unused-entry notice, each renderer,--no-ignore.squirrel config validatefor every rejection, reservedrule_optionskeys.[[ignore]]the output is byte-identical to today (no result changes, no new fields).12. Phases and PR split
ignoredon checks, signature/cache,meta.ignoredplus the minimal console/JSON line, docs, tests. Items and URLs only.security/cookie-flagsmigrated toctx.ignore.--no-ignore, completions, migrate other count-in-message rules.website_settings.ignore, API and MCP, dashboard editor, cloud run config merge, dashboard report line. Depends on A for the shared schema.CheckItem.selector, per-rule support list).No migration for existing users: the table is new,
rule_optionsis untouched. An empty list changes nothing.13. Decisions (2026-10-30)
ignorable: falseonly for compromise detection:integrity/*and the threat-intel rules. Everything else is ignorable, includingsecurity/leaked-secrets. An entry that names a non-ignorable rule is asquirrel config validateerror, and the engine skips it with a notice if it gets through.--no-ignoreshows the unwaived result. (Replaces the pass-or-skip question; a waived PAGE, where the rule is not run at all, remains a visible skip.)reasonis optional and is shown in the report and dashboard when present.--no-ignoreships in the first PR.Acceptance criteria (replaces the checklist above, per the decision)
The issue body is updated to match.
nc9 commentedon Oct 30, 2026
Decisions (Nik, 2026-10-30): (1)
ignorable: falseonly for compromise detection (integrity/*and the threat-intel rules); everything else is ignorable, includingsecurity/leaked-secrets. (2) A fully waived check is a pass with an 'N waived' note, so denominators and scores stay stable;--no-ignoreshows the unwaived result. (3)reasonis optional, shown in the report and dashboard when present. (4) AND within an entry, OR across entries. (5)--no-ignoreships in the first PR. Spec comment and acceptance criteria updated; PR 1 (config, engine hook, cache, reporting,--no-ignore) is next.test(rules): build nested-quantifier patterns at runtime for static a…
feat(rules): [[ignore]] waives findings by item or URL without disabl…
test(rules): build nested-quantifier patterns at runtime for static a…
docs(changelog): keep the ignore entry under Unreleased after the v0.…
fix(rules): linear-time ignore regex and glob matchers, shared valida…
fix(rules): cap ignore entries, patterns and total work per audit; me…
fix(rules,cli): bound ignore regex compile cost, refuse bare entries,…
style(cli): oxfmt audit.ts (#1262)
fix(rules,report): table-level compile budget, refuse empty-matching …
feat(rules): [[ignore]] waives findings by item or URL without disabl…
feat(rules): [[ignore]] waives findings by item or URL without disabl…
feat(rules): [[ignore]] waives findings by item or URL without disabl…
feat(rules): [[ignore]] waives findings by item or URL without disabl…
feat(rules): [[ignore]] waives findings by item or URL without disabl…
feat(rules): [[ignore]] waives findings by item or URL without disabl…
nc9 commentedon Oct 31, 2026
Verified against main after v0.0.148 (
[[ignore]]landed). Met and ticked: criteria 1 to 4 (validation, item and URL waiving, the cookie example), 8 (integrity/*rules are not ignorable), 10 (--no-ignore) and 11 (no change without entries). Open: criterion 5 (the HTML report lists no unused entries), criterion 6 (the message rewrite is the shipped mechanism, noctx.ignoreopt-in; the platform-cookie info message still names waived cookies after a partial waiver), criterion 7 (carried smart-audit findings do not honour an ignore; the docs say so), criterion 9 (reasonis not shown in the console, text, markdown or HTML reports), criterion 13 (no public follow-up issue for selectors yet), and the hosted parts of 9 and 12. Criterion 14 and 15 are process items. Leaving this open for those.nik
nc9 commentedon Nov 12, 2026
Criterion 6 restated to match what shipped (rules with
messageCountsItemsrewrite their count; other rules keep their text with an(N ignored)suffix; a message naming its items may still name a waived item) and ticked; criterion 13 ticked as moot (selectors are already implemented). Still open: criterion 7 (carried smart-audit findings do not honour an ignore; the report warns withcarriedStale), criterion 12 (cloud, private), theskillsissue and the suite runs; the HTML/console/text/Markdown reason lines are in draft PR #1791.nik
fix(report,cli): [[ignore]] entry reasons and unmatched entries appea…
fix(report,cli): [[ignore]] entry reasons and unmatched entries appea…
fix(report,cli): [[ignore]] entry reasons and unmatched entries appea…
nc9 commentedon Nov 13, 2026
Shipped in squirrel v0.0.180 (https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.180): see the v0.0.180 section of CHANGELOG.md.