Repository navigation
feat(tier1): apply audited SkillSpector baselines - #300
Merged
Merged
Conversation
Public users had no way to accept a reviewed SkillSpector false positive. SkillEvaluator never passed a baseline to SkillSpector, and any suppressed finding in a report made the security check INCOMPLETE, so the only options were a red security check or dropping SkillSpector. Add --skillspector-baseline FILE to validate, tier1 (and tier1 validate), and security-scan (and tier1 security-scan), plus a skillspector_baseline argument on SecurityValidator, run_validation, run_security_scan, and run_tier1_workflow. The file goes to both SkillSpector stages with --baseline, and parallel catalog children receive it. Baselines are never discovered from the scanned skill, and suppressed findings without a requested baseline still fail closed. With a baseline, the report must account for suppressions (suppressed_count and suppressed), and suppressed rows are no longer counted as unseen occurrences when reconciling the risk score, so that check stays as strict as without a baseline. A baseline kept inside a skill that has evals/ outputs is passed as its staged copy, so SkillSpector excludes the file it actually scans instead of reporting the baseline's own match text as new findings. Rules whose id, path, and message contain no literal text (for example id: "*") are rejected before the scan, because SkillSpector would let them suppress every finding. JSON reports add results[].skillspector_baseline with the outcome (applied, no_matches, fingerprint_version_mismatch, not_applied), the baseline and runtime scanner versions, rule and fingerprint counts, and suppressed, active, and blocking finding counts. Fingerprints ignored after a SkillSpector upgrade are reported as an error when blocking findings remain and as a warning otherwise, instead of a baseline that silently suppresses nothing. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The skillspector_baseline report field recorded the baseline's absolute local path, and inspection errors repeated it. Reports elsewhere keep local paths out (quality_config provenance records only the file name), so the field now records the file name and a sha256 digest of the file instead, and errors name only the file. SkillSpector rejects an invalid baseline at load time with exit code 2, and the scanner diagnostics are redacted, so a baseline missing a required reason surfaced only as "unexpected exit code 2". SkillEvaluator now rejects, before the scan, a version 2 rule or fingerprint without a non-empty reason and rules or fingerprints that are not lists. Legacy rule-only baselines still need no reason. For any other rejection, an exit code 2 on a run with a baseline adds a hint to check the file with skillspector scan --baseline, and the baseline message explains that the outcome is unknown. Adds a regression test for the suppressed-row subtraction in the score floor kept after generated-artifact issues are removed; it fails without the subtraction. Docs now say that all rule globs are case-insensitive, that the JSON field is present only for single-skill targets when SkillSpector is installed, and that its finding counts come from SkillSpector's report before --llm-verify or policy overrides. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
requested review from
chrisknvidia,
mosheabr and
rmalani-nv
as code owners
October 30, 2026 20:08
chrisknvidia
force-pushed
the
naren/port-skillspector-baseline
branch
from
October 30, 2026 22:24
c44ecb2 to
0339f37
Compare
rng1995
commented
Nov 2, 2026
rng1995
left a comment
Collaborator
Author
There was a problem hiding this comment.
Automated review: 6 findings (0 P1, 4 P2, 2 P3); 6 posted inline.
Conflicts: CHANGELOG.md, docs/tier1-validation.mdx Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…errors
The pre-check loaded the baseline with plain yaml.safe_load. An impossible
date such as reviewed_on: 2026-06-31 raised an uncaught ValueError and
crashed the run, an empty or comment-only file was rejected although
SkillSpector loads it as an empty baseline, and chained merge keys expanded
without limit. It now reads at most 2 MiB and parses with a SafeLoader that
bounds composition and alias/merge expansion like SkillSpector's loader,
catches the scalar-constructor errors, and treats an empty document as {}.
Rule and fingerprint entries that are not mappings are now reported as such
instead of as an unbounded rule or a missing reason.
Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y report SkillSpector's LLM meta-analysis rewrites findings before the baseline is applied, so fingerprints from `skillspector baseline --no-llm` match only the static stage. Merging the LLM stage overwrote the static suppression count, and the outcome read `no_matches` although the baseline had matched. Each stage's count is now kept; when the LLM stage suppresses fewer findings the outcome is `llm_stage_unmatched`, reported as an error when blocking findings remain and as a warning otherwise. The outcome was only in the JSON report. It is now also a `skillspector_baseline` success detail with the file name and digest, so Markdown and HTML reports disclose applied or inert baselines, and a scan whose only findings were suppressed no longer reads "No security vulnerabilities detected". Docs: fingerprints work on static-only runs and narrow rules for LLM runs, where the JSON field appears for folder targets, and the suppression reference pinned to the SkillSpector release the docs install. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
chrisknvidia
reviewed
Nov 2, 2026
chrisknvidia
left a comment
Collaborator
There was a problem hiding this comment.
Two baseline-trust problems need fixing: an in-skill baseline lets the skill author write the exceptions, and the check for unbounded rules is passed by a single letter. The new pre-check loader and the per-stage outcome reporting otherwise read correctly (I fed the loader a couple dozen odd YAML inputs and ran real SkillSpector scans through the rule and fingerprint paths). The new item is that Markdown for a security-scan on a folder still says only 'All checks passed' for a skill whose findings were suppressed, which the new docs say it doesn't.
Require a literal run of two characters in a rule id, or four in a path or message glob, so `*e*` no longer passes the pre-check. Record every baseline outcome as a success detail even when it also adds an error, add suppressed severity counts and rule IDs to the diagnostic, keep the outcome in folder scan summary lines, and document keeping the baseline outside the skill under review. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Conflicts resolved by keeping both sides: run_validation and run_tier1_workflow take main's --skip and this branch's --skillspector-baseline; _validate_skillspector_report takes main's scanned_root (accepted image gaps) and this branch's baseline_requested; the LLM stage keeps main's repeated-warning dedupe and this branch's per-stage suppressed count; the security accordion keeps main's /etc/passwd bind-mount paragraphs and this branch's baseline pointer. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
e8aa35d committed security.py.orig and test_security.py.orig by mistake; they are stale copies from a conflict resolution. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
…he run The merge with main put the new --skip parameter beside --skillspector-baseline in run_validation and run_tier1_workflow; check that validate and tier1 forward both together. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
…rity.py.orig Commit e8aa35d briefly added tests/validators/test_security.py.orig (a merge leftover, removed again in 7a3bf92). Gitleaks scans full history, so the "us.anthropic.claude-opus-5" model ID that follows AWS_BEARER_TOKEN_BEDROCK in that copy is flagged as generic-api-key at a path the existing allowlist does not cover. Add an exact-path, exact-value allowlist entry for that file and pin it in the allowlist scope test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
enabled auto-merge (squash)
November 4, 2026 18:59
rng1995
added a commit
that referenced
this pull request
Nov 5, 2026
Resolve conflicts with #300 (SkillSpector baselines): SecurityValidator takes content_type, skillspector_reference_root, and skillspector_baseline; Tier 1 security passes the agent-scope arguments and the baseline; the SkillSpector summary keeps both the baseline-suppressed message and the agent-control-path suppression note. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--skillspector-baseline FILEso a reviewed SkillSpector exception can be applied explicitly, and reports whether the baseline actually did anything.New option on
validate,tier1(andtier1 validate), andsecurity-scan(andtier1 security-scan). The Python entry points take a matchingskillspector_baselineargument:SecurityValidator,run_validation,run_security_scan, andrun_tier1_workflow. The path is checked by Click (exists,readable, file only) and resolved, and parallel catalog children (validate --workers) receive it.The file is passed to both SkillSpector stages (static and LLM enrichment) with
--baseline. SkillEvaluator never discovers a baseline from the scanned skill and never passes--use-shipped-baseline.In-tree baseline on a staged scan. When a skill has
evals/or other generated output, the scan runs on a staged copy. A baseline inside the skill is then passed as its staged copy, so SkillSpector excludes the file it actually scans. Without this, the copied baseline was scanned as skill content, and its reviewed match text came back as new HIGH findings. A baseline outside the skill, or one under an excluded directory, keeps its original path.Unbounded rules. A rule whose
id,path, andmessagecontain no literal text (for exampleid: "*",path: "*/*", ormessage: "[!a]*") is rejected before the scan, because SkillSpector would let it suppress every finding. The check uses the same field aliases as SkillSpector's loader (rule_id,file). A missing, unparseable, or non-mapping baseline is also rejected. In each case the security check isINCOMPLETEwith an explanatory error, and SkillSpector does not run.Cheap schema pre-checks. SkillSpector rejects an invalid baseline at load time with exit code 2, and SkillEvaluator redacts scanner diagnostics, so the user saw only "unexpected exit code 2". Two errors that SkillSpector 2.9.5 through 2.12.0 all reject are now caught before the scan with a clear message: a version 2 rule or fingerprint without a non-empty
reason, andrulesorfingerprintsthat are not lists. Legacy rule-only baselines (no version, or version 1) still need no reason, as in SkillSpector. For anything else SkillSpector rejects, an exit code 2 on a run with a baseline adds a hint to check the file withskillspector scan <skill> --baseline <file>.Diagnostics. JSON reports for single-skill targets add
results[].skillspector_baselinewith these fields:status:applied,no_matches,fingerprint_version_mismatch, ornot_applied.fileanddigest: the baseline's file name and asha256:digest of its bytes. The local path is not recorded, and inspection errors name only the file.--llm-verifydowngrade or policy severity override.If fingerprints were generated with a different SkillSpector version, SkillSpector ignores all of them. SkillEvaluator then reports the mismatch with both versions: as an error when blocking findings remain, and as a warning otherwise. The pass/fail outcome does not change. Versions are compared as exact strings, as SkillSpector does. Rule-only baselines are not version-bound.
Docs: a new "Audited SkillSpector baselines" section in
docs/tier1-validation.mdxwith a v2 rule example, matching semantics, the bracketed-glob trick, theskillspector baselinefingerprint workflow, and version behavior. The option is also added todocs/cli-reference.mdx, and the JSON field to the CI table indocs/ci-integration.mdx.CHANGELOG entry under Unreleased / Added.
Why
Public users had no reviewed, file-based way to accept a SkillSpector false positive. SkillEvaluator never passed a baseline to SkillSpector. A report that contained suppressed findings anyway was treated as untrustworthy, and the security check went
INCOMPLETE. Users could either live with a red security check or stop running SkillSpector.Two problems come with naively adding the flag:
config/skillspector-baseline.yaml) is the natural layout. On any skill with Tier 3 output underevals/, that layout produced new findings from the baseline file itself, so the check stayed blocked even though the exceptions were correct.Both were reproduced with a real SkillSpector 2.11.2 run before the fix (see Tests).
Kept from public
INCOMPLETE.test_unexpected_skillspector_suppression_fails_closedis unchanged.suppressed_count == len(suppressed), finding-count reconciliation, and exit code against the risk score. With a baseline, the report must also include bothsuppressed_countandsuppressed. If either is missing, the scan fails closed instead of reporting counts as "unknown".findings_after_filteringbefore the minimum-score check. Otherwise each suppressed finding would count as an unseen occurrence and loosen the bound. The same subtraction applies to the score floor that is kept after generated-artifact or SPDX-comment issues are removed. Two regression tests cover this. In the first, a report that understates an active HIGH finding is still rejected when three findings are suppressed. In the second, the floor still raises theskillspector_risk_scoreHIGH finding when anevals/issue is removed and three findings are suppressed.copytree(symlinks=True)with shipped bytecode kept), path rewriting back to the original root, and the in-place fallback are unchanged. The baseline mapping only chooses which path goes to--baseline.quality_configprovenance, the baseline is identified by file name andsha256:digest, not by its absolute path.--skillspector-baselineoption is forwarded to catalog children, sotest_catalog_child_argv_forwards_every_validate_optionkeeps passing without an exemption.statusvalue plus a message. This leaves stable error codes to the separate effort in feat: add stable evaluator error codes #115.Tests
tests/validators/test_security.py(mocked SkillSpector, following the existing contract-test helpers):--baselineand its suppressions are accepted. Status isapplied, and the field appears in the JSON report with the file name and digest. The baseline's directory does not appear anywhere in the rendered report.evals/issue is removed, so theskillspector_risk_scoreHIGH finding is still raised. This test fails without the subtraction in report processing.no_matches).rulesorfingerprintsthat are not lists. The baselinemessageholds the error, and no error contains the local directory.--baselinehint, and the baseline message says the outcome is unknown. Without a baseline, an exit code 2 gets no such hint.rule_id/filealiases and bracketed globs. Legacy rule-only baselines (no version, or version 1) need no reason.--baseline.tests/validators/test_artifact_dir_exclusion.py:evals/keeps its original path.tests/test_commands.py:validate,security-scan,tier1 security-scan,tier1, andtier1 validate. A relative path is resolved.tests/golden/cli_surface.jsonregenerated (adds the option to the five commands above).main, rantests/validators/,tests/test_commands.py,tests/test_cli.py,tests/cli/,tests/golden/,tests/reporting/(including the retained CI report renderer),tests/ci/,tests/test_ci_workflows.py, the OSS packaging, boundary, and source-hygiene tests,tests/test_checks_routing.py,tests/test_quality_config.py,tests/test_publication_evidence.py,tests/test_quality_policy_gate.py, the catalog and plugin-inventory tests, andtests/test_safety_boundaries.py: 5609 passed, 3 skipped. CLI banner, progress, publication, results-location, and HTML-parser tests: 679 passed, 2 skipped.ruff checkis clean on all changed Python files.ruff formatintroduces no new drift:security.py,test_commands.py, andtest_security.pyalready differ from the formatter onmain, and this change adds nothing to that. The OSS boundary check passed.docker run --privilegedand anevals/directory:*--privileged*message, before the mapping: a new PE5 HIGH atconfig/skillspector-baseline.yaml:5.applied.applied.scanner_versionedited to 2.10.0: failed,fingerprint_version_mismatchwith both versions.id: "*"rule:INCOMPLETEbefore the scan.*--privilege[d]*example suppresses PE5 and does not trigger it when the baseline is scanned as content.--baselinefile exclusion were also confirmed in the SkillSpector v2.12.0 sources that the docs recommend.🤖 Generated with Claude Code