Skip to content

[BUG] SkillSpector adapter fails without LLM API key -- needs --no-llm support #1640

@sergio-sisternes-epam

Description

@sergio-sisternes-epam

Describe the bug
The SkillSpector CLI adapter (src/apm_cli/security/external/skillspector.py) fails with "SkillSpector output is not valid JSON SARIF" when no LLM API key (e.g. OPENAI_API_KEY) is configured. The adapter builds the command without --no-llm, and SkillSpector writes its error to stdout (not stderr), which APM tries to parse as SARIF JSON.

To Reproduce

  1. Install SkillSpector v2.0.0 (pip install -e . from github.com/NVIDIA/SkillSpector)
  2. Enable the feature flag: apm experimental enable external-scanners
  3. Unset all LLM keys: unset OPENAI_API_KEY NVIDIA_INFERENCE_KEY ANTHROPIC_API_KEY
  4. Run: apm audit --external skillspector
  5. See error: [x] External scanner 'skillspector' failed: SkillSpector output is not valid JSON SARIF

Expected behavior
The adapter should either pass --no-llm by default (for headless/CI use) or gracefully handle stdout containing non-JSON content by checking stderr and exit code first.

Environment (please complete the following information):

Logs

[i] Running external scanner: skillspector
[x] External scanner 'skillspector' failed: SkillSpector output is not valid JSON SARIF: Expecting value: line 1 column 1 (char 0)

Additional context

  • Root cause: skillspector.py line 61 builds [binary, "scan", "--format", "sarif", *targets] without --no-llm
  • SkillSpector writing errors to stdout is arguably an upstream bug, but APM should be resilient
  • Workaround: generate SARIF separately with skillspector scan --format sarif --no-llm . > report.sarif then apm audit --external sarif --external-sarif report.sarif
  • Found during E2E testing of PR feat(audit): vendor-agnostic external SARIF scanner ingestion (experimental) #1579 (external scanners feature)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/audit-policyapm-policy.yml schema, custom_checks, install-time enforcement.area/content-securityUnicode scanning, Glassworm, apm audit content checks, SARIF output.area/securitypriority/highShips in current or next milestonestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions