Skip to content

fix(security): make the SkillSpector timeout configurable - #271

Merged
rng1995 merged 7 commits into
mainfrom
naren/port-skillspector-timeout
Nov 2, 2026
Merged

rng1995 merged 7 commits into
mainfrom
naren/port-skillspector-timeout

Conversation

@rng1995

@rng1995 rng1995 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hard-coded 300-second SkillSpector subprocess timeout with a watchdog that defaults to 1,200 seconds and can be set through SKILLEVALUATOR_SKILLSPECTOR_TIMEOUT_SECONDS. Both the static stage and the --llm stage get the full value.
  • Accept only a positive integer. A blank value uses the default. A non-integer, zero or negative value logs a warning and uses the default. A value above 86,400 is capped with a warning: on macOS, subprocess.run raises an uncaught OverflowError from about 10^7 seconds, which would crash validation.
  • Forward SKILLSPECTOR_MAX_WORKFLOW_SECONDS to both SkillSpector stages through the credential-isolated child environment, so users can raise SkillSpector's own deadline along with the watchdog. The watchdog setting itself is read from the parent environment and is never forwarded.
  • Record the timeout that was used as skillspector_timeout_seconds in the security result, next to skillspector_model, skillspector_reasoning_effort and skillspector_version.
  • Docs: add a row for each variable in docs/environment-variables.mdx (Tier 1 table and SkillSpector bridge table), and add a "SkillSpector times out" troubleshooting entry with an example in docs/tier1-validation.mdx. CHANGELOG entry under Unreleased / Fixed.

Why

SkillSpector ends a scan at its own workflow deadline (SKILLSPECTOR_MAX_WORKFLOW_SECONDS): 600 seconds in v2.12.0, which this PR was written against, and 1,080 seconds in v2.13.3, which main now pins (#292). The docs and comments name the deadline as SkillSpector's own and cite 1,080 seconds for v2.13.3 instead of a fixed 600. SkillEvaluator killed the process at 300 seconds, before that deadline. Slow --llm scans, such as those using a local OpenAI-compatible model, always ended as skillspector timed out after 300 seconds, and Tier 1 reported the security scan as INCOMPLETE. Users had no way to allow more time. The new default lets SkillSpector's own deadline stop a slow scan first. Users who need longer can raise both limits.

The 1,200-second default still sits above the 1,080-second deadline in v2.13.3, so SkillSpector's own deadline still ends a slow scan first on both releases. Each stage gets the full watchdog, so if both stages stall, a scan can take up to twice the value before it is reported. The docs say this. A timeout still fails closed as INCOMPLETE. Only the time limit changes.

This implements the request in #155 (now closed): an environment variable for the timeout and the effective value recorded in the scanner evidence. The default is 1,200 seconds rather than the 300 seconds the issue suggested, because 300 seconds is below SkillSpector's own deadline.

Kept from public

  • The credential-isolated SkillSpector child environment (replace_env=True with an allowlist) is unchanged. The one new forwarded name, SKILLSPECTOR_MAX_WORKFLOW_SECONDS, is a non-secret numeric setting. SKILLEVALUATOR_* settings still never reach the child.
  • The two-stage structure is unchanged: the static stage always runs, and LLM enrichment adds to it. So is the fail-closed handling of timeouts, crashes and partial reports.
  • Public's Mapping-typed helpers and its existing metadata conventions are used for the new parser and the new metadata field.
  • Beyond a plain configurable timeout, this adds the upper cap on the value, forwarding of SkillSpector's own deadline (needed because the child environment is an allowlist), and checks that both stages get the timeout and the forwarded deadline.

Tests

  • New test_skillspector_timeout_configuration (parametrized, 12 cases): default, blank, whitespace, valid, padded, cap boundary, over-cap, zero, negative, float and non-numeric values, and whether each one logs a warning.
  • New test_skillspector_stages_use_configured_timeout_and_workflow_deadline: with --llm, both SkillSpector calls get the configured timeout and the forwarded SKILLSPECTOR_MAX_WORKFLOW_SECONDS. The watchdog setting is not forwarded, and the result metadata records the value.
  • New test_skillspector_static_stage_defaults_to_1200_second_timeout: the default applies to a static-only run, and nothing is forwarded when the deadline is unset.
  • Both integration tests fail on unmodified main (assert 300 == 2400, assert 300 == 1200).
  • Before the merges described below, pytest tests/validators/ tests/reporting/ tests/utils/test_tool_runner.py tests/test_oss_packaging.py tests/test_cli.py tests/test_provider_config.py: 3944 passed, 1 skipped.
  • Checked against SkillSpector v2.13.3 (DEFAULT_MAX_WORKFLOW_SECONDS = 1080.0 in skillspector/state.py). Commit 39f1b7701 rewords the changelog, both docs and a source comment accordingly; no behavior changes. The 15 timeout tests pass.
  • Merged current main into the branch. CHANGELOG.md and docs/environment-variables.mdx conflicted with the fix(quality): report the 5,000-token skill budget as advisory #272 and fix(security): keep SkillSpector's nv_build model registry for Build scans #288 changes; both sides are kept. The changelog entry follows the new fix(quality): report the 5,000-token skill budget as advisory #272 and fix(security): keep SkillSpector's nv_build model registry for Build scans #288 entries, and the SkillSpector bridge paragraph keeps main's nv_build wording plus this PR's mention of the forwarded deadline setting. After that merge, tests/validators/test_security.py and tests/test_oss_packaging.py: 525 passed, 1 skipped; ruff check clean. A later merge picked up the v2.13.3 pin from chore(deps): pin SkillSpector to v2.13.3 #292 with no conflicts, and the timeout, workflow-deadline, install-pin and captured-report tests pass on it (20 passed).
  • ruff check passes on the changed Python files. ruff format --check reports only formatting differences that were already in both files on main; the added lines are formatted. scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

Every SkillSpector run was killed after a hard-coded 300 seconds. That is
shorter than SkillSpector's own 600-second workflow deadline, so slow
`--llm` scans (for example with a local OpenAI-compatible model) were cut
off before they could finish or end gracefully, and Tier 1 reported the
security scan as INCOMPLETE with no way to allow more time.

Each SkillSpector run (the static stage and, with --llm, the LLM stage)
now gets a 1200-second watchdog by default, which keeps SkillSpector's own
deadline as the normal stopping point. SKILLEVALUATOR_SKILLSPECTOR_TIMEOUT_SECONDS
overrides it with a positive integer; invalid values fall back to the
default with a warning, and values above 86400 are capped so the wait
cannot overflow the platform timeout range.

SkillSpector's credential-isolated environment now forwards
SKILLSPECTOR_MAX_WORKFLOW_SECONDS to both stages, so its deadline can be
raised along with the watchdog. The security result records the effective
skillspector_timeout_seconds.

Refs #155

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.

Review summary: no findings (no P1/P2/P3).

Checked: timeout parsing (blank, non-integer, zero/negative, 86400 cap), that both stages read the value, that SKILLSPECTOR_MAX_WORKFLOW_SECONDS is forwarded through the allowlisted child env while SKILLEVALUATOR_SKILLSPECTOR_TIMEOUT_SECONDS is not, the skillspector_timeout_seconds metadata, docs rows and the troubleshooting entry, and the CHANGELOG placement. No other code path still hard-codes the 300 s timeout.

Local verification (head f27bd63): ruff check clean; pytest tests/validators/test_security.py: 476 passed.

Reviewed with Claude Code.

SkillSpector v2.13.3 raised its default workflow deadline from 600 to 1080
seconds. The 1,200-second watchdog default still sits above it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995
rng1995 enabled auto-merge (squash) November 2, 2026 18:23
rng1995 and others added 5 commits November 2, 2026 10:33
Resolve CHANGELOG and docs/environment-variables.mdx conflicts by keeping
both sides: main's nv_build bridge wording plus this branch's forwarded
deadline setting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Conflicts: CHANGELOG.md, docs/environment-variables.mdx.

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

Conflicts: CHANGELOG.md (kept the remote branch's line wrapping).

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts in src/skillevaluator/validators/security.py and
tests/validators/test_security.py: kept main's provider_id/LLM provenance
recording and early JSON parse together with this PR's configurable
SkillSpector watchdog; kept both sides' tests and imports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995
rng1995 merged commit 54fff6b into main Nov 2, 2026
21 checks passed
@rng1995
rng1995 deleted the naren/port-skillspector-timeout branch November 2, 2026 19:48
rng1995 added a commit that referenced this pull request Nov 2, 2026
Clean merge of the newer main (#281, #271, #293); CHANGELOG.md and
docs/agents-and-sandboxes.mdx auto-merged with no conflicts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 2, 2026
Resolve conflicts with #271: keep both SkillSpector Fixed entries in the
CHANGELOG (the timeout entry first) and import both
_skillspector_incomplete_analysis_error and _skillspector_timeout_seconds
in the security tests. Update the runtime-limit troubleshooting text to
SkillSpector v2.13.3's 1,080-second default scan deadline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995 added a commit that referenced this pull request Nov 6, 2026
* docs(changelog): move entries released in 0.7.0-0.7.2 out of Unreleased

0.7.0 (#314) and 0.7.1 (#327) never cut their sections on main, and 0.7.2
(#335) added its section below the whole Unreleased block, so Unreleased
still listed work that had already shipped.

Place each Unreleased entry under the release that shipped the PR that
added it:

- 0.7.0: the published section from the 0.7.0 tag, verbatim. It already
  holds the six entries that main had filed under 0.6.0, so 0.6.0 again
  matches the v0.6.0 tag, including the original run_config.json entry.
- 0.7.1: #264 #271 #274 #281 #284 #289 #293 #299 #316 #317 #318 #323
  #324 #326 #327, plus the #320 wording of the Windows Git-root entry,
  since #320 changed that 0.7.0 fix in 0.7.1.
- 0.7.2: #263 #265 #269 #270 #276 #279 #287 #290 #296 #309 #328 #330
  merged with the existing #335 entries.

Only post-v0.7.2 entries stay under Unreleased, with one heading per
subsection. Entry text is unchanged, apart from the published tag wording
in 0.7.0 and 0.6.0.

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

* chore(release): prepare v0.8.0

Set the package, fallback, lock, citation and developer-guide versions to
0.8.0 and move every entry merged since v0.7.2 under
'## 0.8.0 - 2026-11-05', leaving Unreleased empty.

The refusal-fallback documentation test now reads the release section
that names CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, requires it to be 0.8.0,
and requires exactly one entry there to name the switch.

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

* chore(release): pin the verified 0.8.0 Tier 1 image and add its CI bundle

Pin onboarding to the Tier 1 image published by the reviewed main revision
55d2d04 in "Build and publish Tier 1 image" run 42158955180:
ghcr.io/nvidia/skillevaluator-tier1@sha256:9d5483243918937be4f2178f74cf7c622a531dee41e3176906994d52fa14950a
(config sha256:d17d6f5105ec5f1bf0cbe4dff0d693aae4ecf01e9c1c6a6ddb7830518acace33).
The workflow and publisher refs both move to 55d2d04.

ci/bundles/0.8.0 mirrors the 0.7.2 bundle. The templates, README and
release.json are the run's github-actions-onboarding artifact and match
ci/render_templates.py output for these pins byte for byte. The scanner
inventory and verification receipt come from the build's runtime-stage
version step, the five-case smoke receipt, the onboarding job's anonymous
pull, and the public manifest, whose config digest equals the smoke-tested
image ID. The ZIP uses the 0.7.2 layout (sorted members, inner checksums,
1980 timestamps, 0644, deflate level 9) and rebuilds to identical bytes.

Point the current-bundle links at 0.8.0 and list 0.7.2 as historical.

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

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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