Skip to content

fix(security): explain SkillSpector LLM provider outages as retriable incomplete scans - #342

Merged
rng1995 merged 9 commits into
mainfrom
naren/port-skillspector-provider-outage
Nov 5, 2026
Merged

rng1995 merged 9 commits into
mainfrom
naren/port-skillspector-provider-outage

Conversation

@rng1995

@rng1995 rng1995 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • When the --llm SkillSpector stage fails because the LLM provider kept failing after SkillSpector's own bounded retries, the security error now says so. It reads skillspector-llm did not complete: the LLM provider kept failing after SkillSpector's bounded retries (llm_connection_retries_exhausted), says this is a retriable provider failure and not a security finding, says static findings are kept, and asks for a full rescan when the provider is available.
  • The report is checked on both LLM-stage failure paths. Exit code 2 comes first: SkillSpector v2.13.3 prints the JSON report and then exits 2 when execution_successful is false. A report with execution_successful=false and exit code 0 or 1 gets the same check, as a fallback.
  • A new strict classifier, _skillspector_provider_retries_exhausted, decides when the message applies. All of these must hold:
    • SkillSpector v2.12.0 or later, with execution_successful false at the top level and in analysis_completeness, completeness status failed and is_complete false. v2.12.0 added SkillSpector's own bounded retry loop for transient provider failures such as rate limits. v2.9.1 to v2.11.2 used the same reason only for a connection error left after the provider SDK's retries, so their reports keep the generic error.
    • Every ledger exception is a fatal, failed llm_connection_retries_exhausted row in the semantic or meta phase, with a non-blank path and a message of at most 4096 characters. Its analyzers must be distinct LLM analyzers, and meta_analyzer must appear exactly in the meta phase. The only other row allowed is SkillSpector's run-level semantic_runtime_incomplete row on SKILL.md, matched field by field.
    • Exactly the analyzers named by those rows report failed, each with its own status entry, with no partial, skipped or unaccounted work and no other reason. Every other analyzer is completed or not_applicable, and every limitation names one of the failed analyzers.
    • No errors, failures or similar markers, and no *_truncated flag.
  • Anything else keeps today's message, such as skillspector-llm failed with unexpected exit code 2: scanner diagnostics were redacted. That covers mixed causes, partial rows, truncated or malformed reports, older SkillSpector and wrong field types. A wrong type never raises.
  • The new message is fixed text and quotes no report fields.
  • Gating does not change. The scan is still INCOMPLETE (skillspector-llm in incomplete_scans), and the command exits 1. Issues in the failed LLM report, including any AE1 finding caused by the outage, are still not converted. Static-stage findings are kept, and a High static finding still makes the result FAILED.
  • Adds a troubleshooting entry to docs/tier1-validation.mdx and a CHANGELOG entry under Unreleased > Fixed.

Why

With --llm, rate limits or a provider outage make SkillSpector v2.13.3 end the LLM stage as failed and exit 2. SkillEvaluator reported only skillspector-llm failed with unexpected exit code 2: scanner diagnostics were redacted, so users could not tell a provider problem that a rerun fixes from a scanner bug. SkillSpector already records the cause as llm_connection_retries_exhausted in its report. This change reads that cause and turns it into a clear, retriable message.

Not every provider failure gets this message. From v2.12.0, SkillSpector uses llm_connection_retries_exhausted only when its own retry logic gives up. A failure that the provider SDK's built-in retries handle is recorded under a different reason, and that report keeps the generic error.

Kept from public

  • The static-first, then LLM-enrichment stage order. The LLM stage still runs only after the static stage completes.
  • The exit-code and report checks in _run_skillspector_once and _validate_skillspector_report. The classifier only changes the error text after those checks have already decided the stage is incomplete.
  • Plain mark_scan_incomplete(stage_name) gating, and discarding every issue from a failed LLM report.
  • The run status order: a blocking finding gives FAILED over INCOMPLETE.
  • The existing ...; security scan did not complete and unexpected exit code messages for every case that is not a clear provider outage, including the static stage and exit codes other than 2.
  • No new metadata or JSON report field. Only the error text changes.

Tests

  • New TestSkillspectorProviderOutage in tests/validators/test_security.py (93 cases). It uses a SkillSpector v2.13.3 report whose only fatal cause is provider retry exhaustion, plus a variant with an extra failed SKILL.md row, an outage-derived AE1 finding and the run-level semantic_runtime_incomplete row:
    • a provider-only failure on exit 2 is INCOMPLETE with no findings and the retry message, in the result, the JSON report and the CLI report
    • a High static finding is kept and the overall status is failed
    • a report with execution_successful=false gets the same message after exit 0 or 1
    • the run-level runtime row may come with a helper-file or meta_analyzer outage
    • 39 report changes keep the generic error on exit 2 and exit 0, for example: mixed static or LLM causes, a partial runtime_limit row, a truncated ledger, a malformed row, a non-LLM or misplaced analyzer, older or missing versions, unexplained limitations or status messages, unfinished or unaccounted work, partial or skipped provider work, a moved or reworded runtime row, a runtime row with fatal 0, a provider analyzer that reports completed or has no status entry, a completeness status of partial, is_complete true, execution_successful true at the top level or in analysis_completeness, a provider row with outcome skipped, no analyzers, a blank path, or an empty message or one over 4096 characters, a ledger over 4096 rows, duplicate statuses, reported errors at the top level or in analysis_completeness and wrong field types
    • the non-LLM analyzer case is a consistent report in which only static_yara failed, so only the LLM-analyzer allowlist rejects it
    • a v2.11.2 report keeps the generic error and a v2.12.0 report gets the new message, on exit 2 and exit 0
    • the static stage and exit code 3 keep the generic unexpected exit code message
    • a runner error message on exit 2 is kept as is, even with an outage report
    • security-scan --llm exits 1, shows INCOMPLETE and gives the retry message
  • test_provider_outage_with_a_baseline_gets_only_the_retry_advice: SkillSpector exits 2 both for a provider outage and for rejected input such as an invalid --baseline file, so a provider outage with a valid baseline gets only the retry advice, not main's baseline hint. It fails when the two hints are applied together.
  • On src from the branch base on main with these tests: 10 failed and 83 passed (before the outage-with-baseline case was added). The 10 are every case that expects the new message. The 83 that pass assert the generic error or the runner error is kept.
  • On the branch's src before the version fix, the two v2.11.2 cases fail. Removing any one of five guards from the classifier (every row analyzer has a failed status, completeness status failed, is_complete false, a non-blank row path, the row message bound) fails its two new cases. Removing any one of twelve more guards fails its new cases: the LLM-analyzer allowlist, top-level failure markers, top-level and completeness execution_successful, the partial count, the skipped count, the row outcome, non-empty row analyzers, a non-empty row message, the 4096-row bound, the fatal is False check on the runtime row, and the exit 2 check that no runner error is set. The top-level markers and top-level execution_successful guards fail only their exit 2 case, because on exit 0 an earlier report check already rejects those reports. Before, the other cases passed with any of these guards removed.
  • On the branch, the modules that import the security validator, the reporting and CLI tests, and the CI, packaging, boundary and docs and CHANGELOG readers all pass: 2114 passed and 1 skipped. Those are tests/validators/test_security.py, test_security_validators.py, test_scan_incomplete.py, test_folder_validation.py, test_artifact_dir_exclusion.py, test_pii_grouping.py, test_private_plugin_composition.py, test_scanner_path_resolution.py, test_static_requirements_audit.py, test_target_dependencies.py, test_url_policy.py, tests/models/test_result.py, tests/reporting/test_incomplete_scans.py, tests/reporting/test_reporters.py, tests/test_cli.py, tests/test_skillspector_provenance.py, tests/test_publication_evidence.py, tests/ci/test_secret_redaction.py, tests/ci/test_image_build.py, tests/test_ci_workflows.py, tests/test_ci_change_classifier.py, tests/test_oss_packaging.py, tests/test_oss_source_hygiene.py and tests/test_oss_boundary.py.
  • A second run of tests/validators/test_security.py with the remaining docs readers (test_accuracy_arithmetic.py, test_benchmark_rollout_docs.py, test_tier3_public_runtime.py, test_harbor_adapter_safety.py, test_plugin_manifest.py, test_harbor_runtime_skill_isolation.py): 1798 passed and 3 skipped.
  • The new tests also pass with a clean environment, with COLUMNS=40 and FORCE_COLOR=1, and under -n 4.
  • ruff check is clean. ruff format --check reports no new changes in either file. Both files already fail it on main, and the branch adds no new hunks.
  • scripts/check_oss_boundary.py passed.

🤖 Generated with Claude Code

rng1995 and others added 2 commits November 5, 2026 00:51
When the --llm SkillSpector stage fails only because the LLM provider
kept failing after SkillSpector's bounded retries, report a fixed,
retriable message instead of the redacted unexpected-exit-code or
execution_successful=false error. The report is checked on the exit 2
path first and on the execution_successful=false path as a fallback.

A strict classifier requires SkillSpector 2.11.2+, only fatal
llm_connection_retries_exhausted rows on LLM analyzers (plus the
run-level semantic_runtime_incomplete row on SKILL.md), matching failed
analyzer statuses and explained limitations, and no error or truncation
markers. Anything else keeps the generic error. Gating is unchanged:
the stage stays INCOMPLETE and static findings still decide FAILED.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add a Tier 1 troubleshooting entry for the provider outage message and
an Unreleased > Fixed CHANGELOG entry.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: 2 findings (0 P1, 0 P2, 2 P3); 2 posted inline.

Comment thread tests/validators/test_security.py Resolved
rng1995 and others added 2 commits November 5, 2026 09:44
Five more report changes must keep the generic error:

- a provider row names an analyzer that has no status entry
- the completeness status is partial instead of failed
- the completeness says is_complete=true
- a provider row has a blank path
- a provider row message is longer than the 4096-character bound

Removing the matching guard from the classifier now fails each case on
both exit 2 and exit 0. Before, the existing cases passed with any one of
these guards removed.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
SkillSpector has recorded llm_connection_retries_exhausted since 2.9.1,
but until 2.11.2 only for an APIConnectionError left after the provider
SDK's own retries. 2.12.0 added its own bounded retry loop for transient
provider failures such as rate limits and records the reason when that
loop gives up. The new message and docs describe the 2.12.0 behavior, so
the classifier now needs SkillSpector 2.12.0 or later instead of an
unexplained 2.11.2. Reports from 2.11.2 and older keep the generic error.

The code comment, the docs and the CHANGELOG now say which release the
check reads and why, and a new test pins both sides of the boundary.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review November 5, 2026 18:29
rng1995 and others added 5 commits November 5, 2026 10:45
…list

The non_llm_analyzer case named static_yara on the provider row but left
static_yara completed and the LLM analyzers failed, so the classifier
rejected it at the analyzer status check and never used the LLM-analyzer
allowlist.

The case is now a consistent report: one provider-reason row and the
run-level runtime row, static_yara failed with one failed unit, the LLM
analyzers completed, and a single static_yara limitation. Only the
allowlist rejects it. Without the allowlist, both the exit 2 and the
exit 0 case now fail; before, all cases passed.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ten more report changes must keep the generic error, each built so that
only one guard rejects it:

- top-level errors
- top-level execution_successful=true
- analysis_completeness execution_successful=true
- a partial or a skipped count on a provider analyzer status
- a provider row with outcome skipped
- an extra provider row with no analyzers
- a provider row with an empty message
- a ledger one row over the 4096-row bound
- the run-level runtime row with fatal 0, which equals False

A new case also checks that a runner error message on exit 2 is kept
as is and is not replaced by the provider message.

Removing the matching guard now fails its exit 2 case, and its exit 0
case where the classifier decides on that path. Before, every case
passed with any one of these guards removed.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts: src/skillevaluator/validators/security.py. Kept both exit-code
hints: the provider-outage message and main's invalid --baseline hint.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
SkillSpector uses exit code 2 both for a provider outage and for rejected
input such as an invalid --baseline file. After main's baseline hint was
merged in, a provider outage with a valid baseline got the retry advice
followed by advice to check the baseline. A provider-outage report proves
SkillSpector accepted its input, so the baseline hint now applies only
when the error is not a provider outage.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 enabled auto-merge (squash) November 5, 2026 20:39
@rng1995
rng1995 merged commit 9bda66d into main Nov 5, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/port-skillspector-provider-outage branch November 5, 2026 21:13
@rng1995 rng1995 mentioned this pull request Nov 6, 2026
7 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant