Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
93abc9f
feat(providers): support Claude Opus and Sonnet 5.5 structured output…
rng1995 Oct 8, 2026
0c9ab3b
feat(providers): bind gateway Claude 5.5 IDs without a forced tool call
rng1995 Oct 8, 2026
8800d8c
feat(providers): reject controls GPT-6.1 Sol refuses before any request
rng1995 Oct 8, 2026
2b461b7
fix(providers): repair the Bedrock default to us.anthropic.claude-son…
rng1995 Oct 8, 2026
6c69e2c
feat(providers): default OpenAI to gpt-6.1-sol
rng1995 Oct 8, 2026
7b23977
feat(providers): default native Anthropic to Opus 5.5 analyzers and S…
rng1995 Oct 8, 2026
b10b674
refactor(providers): read Claude model names through one normalizer o…
rng1995 Oct 8, 2026
a1e6ffc
fix(providers): apply the control guard on every hosted provider
rng1995 Oct 8, 2026
c66504b
fix(cli): stop a scan before analysis when a model rejects a requeste…
rng1995 Oct 8, 2026
89d342b
test(semantic): name the OpenAI refusal test after the failed status …
rng1995 Oct 8, 2026
cd2d771
docs: say an unsupported Sol reasoning effort stops the scan
rng1995 Oct 8, 2026
5970cc0
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 8, 2026
901bc03
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 8, 2026
e03114b
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 8, 2026
8cd0d45
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 8, 2026
6939e9b
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
37963d6
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
54c48e9
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
10ea5f3
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
399d028
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
1c9b7b0
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
843d652
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 9, 2026
3eda133
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 12, 2026
3faace6
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 13, 2026
d0ebd25
Merge branch 'main' into naren/gpt-6-1-sol-claude-5-5-defaults
github-actions[bot] Oct 13, 2026
7837b33
fix(providers): address model compatibility and preflight review
rng1995 Oct 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,19 @@ OPENAI_BASE_URL=
# Optional provider- and model-dependent reasoning-effort setting. Non-empty values
# are trimmed and passed through unchanged. Unset or blank sends high for nv_build
# with z-ai/glm-5.3; other provider/model combinations keep their endpoint defaults.
# gpt-6.1-sol accepts only low, medium, high, xhigh or max; any other value stops
# a scan before analysis (exit code 2).
SKILLSPECTOR_REASONING_EFFORT=
# Optional language for human-readable LLM finding text. Machine-readable values
# such as rule IDs and severity values remain unchanged.
SKILLSPECTOR_OUTPUT_LANGUAGE=
# Optional sampling controls. Temperature is supported by hosted providers;
# seed is forwarded only to OpenAI-compatible and Azure OpenAI endpoints.
# Unset or blank values preserve provider defaults.
# Unset or blank values preserve provider defaults. gpt-6.1-sol rejects every
# explicit temperature. claude-opus-5-5 and claude-sonnet-5-5 accept only 1.0
# on the native Anthropic endpoint; other routes reject every explicit value.
# Unsupported settings on active LLM slots stop the scan before analysis.
# Static scans (--no-llm) skip provider initialization and these checks.
SKILLSPECTOR_TEMPERATURE= # range: 0..1
SKILLSPECTOR_SEED= # integer

Expand Down
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ inference gateways.

| Provider (`SKILLSPECTOR_PROVIDER`) | Credential env var | Endpoint | Default model |
| ---------- | ---- | ---- | ---- |
| `openai` | `OPENAI_API_KEY` (+ optional `OPENAI_BASE_URL`) | api.openai.com (or any OpenAI-compatible URL) | `gpt-5.4` |
| `anthropic` | `ANTHROPIC_API_KEY` | api.anthropic.com | `claude-opus-4-6` |
| `openai` | `OPENAI_API_KEY` (+ optional `OPENAI_BASE_URL`) | api.openai.com (or any OpenAI-compatible URL) | `gpt-6.1-sol` |
| `anthropic` | `ANTHROPIC_API_KEY` | api.anthropic.com | `claude-opus-5-5` (`meta_analyzer`: `claude-sonnet-5-5`) |
| `anthropic_proxy` | `ANTHROPIC_PROXY_API_KEY` + `ANTHROPIC_PROXY_ENDPOINT_URL` | Any Vertex-style raw-predict proxy | `claude-sonnet-4-6` |
| `bedrock` | `AWS_PROFILE` (optional) + `AWS_REGION` — SigV4 via boto3 | AWS Bedrock Runtime | `us.anthropic.claude-sonnet-4-6-20250915-v1:0` |
| `bedrock` | `AWS_PROFILE` (optional) + `AWS_REGION` — SigV4 via boto3 | AWS Bedrock Runtime | `us.anthropic.claude-sonnet-4-6` |
| `nv_build` | `NVIDIA_INFERENCE_KEY` | build.nvidia.com | `z-ai/glm-5.3` |
| `gemini` | `GOOGLE_CLOUD_PROJECT` (+ optional `GOOGLE_CLOUD_LOCATION`) via ADC | Google Cloud OpenAI-compatible Gemini endpoint | `gemini-3.8-flash` |
| `ollama` | _(none)_ | `OLLAMA_BASE_URL` (default `http://localhost:11434/v1`) | `llama3.1:8b` |
Expand All @@ -310,8 +310,9 @@ The default is client-specific: `ChatOpenAI` uses `json_schema`, while other
clients may use tool calling. Some models reject a forced tool call with
HTTP 400 (`tool_choice: type "tool" and "any" are not supported for this
model`). The `anthropic` and `anthropic_proxy` providers route those models
(`claude-fable-5-1`, `claude-mythos-5-1`, or any registry entry with
`structured_output: json_schema`) to the native JSON-schema response format.
(`claude-opus-5-5`, `claude-sonnet-5-5`, `claude-fable-5-1`, `claude-mythos-5-1`,
or any registry entry with `structured_output: json_schema`) to the native
JSON-schema response format.
Bedrock has no JSON-schema output for them, so the `bedrock` provider leaves
`toolChoice` at `auto`, asks for the tool call in the prompt, and retries a
prose answer; it recognises the model from the model ID, a geo/global
Expand All @@ -321,6 +322,12 @@ registry (`SKILLSPECTOR_MODEL_REGISTRY`) with `tool_choice: auto`.
The `openai_compatible` provider honours the same `tool_choice: auto` entry
for endpoints that ignore both `response_format` and a forced `tool_choice`
and answer in prose (for example iFlytek's `spark-x2.5`, which is bundled).
The `anthropic`, `anthropic_proxy`, `openai`, and `openai_compatible` providers
also recognise those Claude models inside gateway model IDs such as
`anthropic/claude-opus-5-5` or `aws/anthropic/bedrock-claude-opus-5-5`. Some
OpenAI-compatible gateways turn a `json_schema` response format for Claude into
a forced tool call, so the `openai` and `openai_compatible` providers bind the
schema as a tool with `tool_choice` left at `auto` and retry a prose answer.
`SKILLSPECTOR_STRUCTURED_OUTPUT_METHOD=json_schema|function_calling`
overrides the method for any provider.
The method precedence is `SKILLSPECTOR_STRUCTURED_OUTPUT_METHOD`, the provider's
Expand Down Expand Up @@ -354,10 +361,11 @@ export SKILLSPECTOR_PROVIDER=bedrock
# boto3 credential chain (env vars, instance metadata, SSO, etc.) resolves.
# export AWS_PROFILE=my-profile
export AWS_REGION=us-west-2 # default if unset
# Default model: us.anthropic.claude-sonnet-4-6-20250915-v1:0
# Default model: us.anthropic.claude-sonnet-4-6
# Override with any Bedrock model ID, cross-region inference-profile
# ID, or your own application-inference-profile ARN:
# export SKILLSPECTOR_MODEL=us.anthropic.claude-opus-4-6-20250915-v1:0
# ID, or your own application-inference-profile ARN. Claude 5.5 is opt-in:
# us./eu. profiles keep requests in that geography, global. routes worldwide.
# export SKILLSPECTOR_MODEL=us.anthropic.claude-sonnet-5-5
skillspector scan ./my-skill/

# NVIDIA build.nvidia.com
Expand Down Expand Up @@ -724,12 +732,12 @@ Issues (2)
| `GOOGLE_CLOUD_LOCATION` | Google Cloud location for the `gemini` provider endpoint (e.g. `global`, `us`, `eu`, `us-central1`). Defaults to `global`. | Optional (used when `SKILLSPECTOR_PROVIDER=gemini`) |
| `GOOGLE_APPLICATION_CREDENTIALS` | Optional path to ADC credential/config file (e.g. Workload or Workforce Identity Federation config; exported service account keys are discouraged). For local development, use `gcloud auth application-default login`; for GKE, use Workload Identity. | Optional (used when `SKILLSPECTOR_PROVIDER=gemini`) |
| `NVIDIA_INFERENCE_KEY` | Credential for the `nv_build` provider (build.nvidia.com). | Required for LLM analysis when `SKILLSPECTOR_PROVIDER=nv_build` |
| `OPENAI_API_KEY` | Credential for the OpenAI provider (`SKILLSPECTOR_PROVIDER=openai`). Also serves as the tier-2 fallback in the credential waterfall when the active provider returns no credentials. | Required for LLM analysis when `SKILLSPECTOR_PROVIDER=openai` |
| `OPENAI_API_KEY` | Credential for the OpenAI provider (`SKILLSPECTOR_PROVIDER=openai`). Also serves as the tier-2 fallback in the credential waterfall when the active provider returns no credentials; the fallback then uses the `openai` default model (`gpt-6.1-sol`) for any slot without a model override. Claude Opus or Sonnet 5.5 gateway IDs are not supported through the fallback, because it keeps the active provider's structured-output method; select `SKILLSPECTOR_PROVIDER=openai` for them. | Required for LLM analysis when `SKILLSPECTOR_PROVIDER=openai` |
| `OPENAI_BASE_URL` | Override the OpenAI endpoint (e.g. point at Ollama). | Optional |
| `SKILLSPECTOR_REASONING_EFFORT` | Optional provider- and model-dependent reasoning-effort setting. Non-empty values are trimmed and passed through unchanged. When unset or blank, SkillSpector sends `high` for `nv_build` with `z-ai/glm-5.3`; other provider/model combinations keep their endpoint defaults. | Optional |
| `SKILLSPECTOR_REASONING_EFFORT` | Optional provider- and model-dependent reasoning-effort setting. Non-empty values are trimmed and passed through unchanged. When unset or blank, SkillSpector sends `high` for `nv_build` with `z-ai/glm-5.3`; other provider/model combinations keep their endpoint defaults (`medium` for `gpt-6.1-sol` and `claude-opus-5-5`, `high` for `claude-sonnet-5-5`). The value applies to every model slot, so the `anthropic` `meta_analyzer` default receives the same effort as the analyzers. `gpt-6.1-sol` accepts only `low`, `medium`, `high`, `xhigh`, or `max`; any other value stops a scan before analysis (exit code 2). | Optional |
| `SKILLSPECTOR_OUTPUT_LANGUAGE` | Short, single-line language label (letters, numbers, spaces, `_`, or `-`; maximum 64 characters) for human-readable LLM finding text such as messages, explanations, and remediation. Rule IDs, severity values, paths, code, and other machine-readable values remain unchanged. Unset, blank, or invalid values preserve the default output language. | Optional |
| `SKILLSPECTOR_TEMPERATURE` | Optional sampling temperature from `0` to `1` for hosted providers. Unset or blank preserves the provider default. Lower values can reduce run-to-run variation but do not guarantee identical output. | Optional |
| `SKILLSPECTOR_SEED` | Optional integer sampling seed for OpenAI-compatible and Azure OpenAI providers. Other hosted providers and CLI providers do not receive it. Provider support remains model-dependent. | Optional |
| `SKILLSPECTOR_TEMPERATURE` | Optional sampling temperature from `0` to `1` for hosted providers. Unset or blank preserves the provider default. Lower values can reduce run-to-run variation but do not guarantee identical output. `gpt-6.1-sol` rejects every explicit temperature, including `1`. `claude-opus-5-5` and `claude-sonnet-5-5` accept only `1.0` on the native Anthropic endpoint ([API compatibility rule](https://platform.claude.com/docs/en/api/messages/create)); gateways, proxies, and Bedrock still reject every explicit value for these models. Unsupported settings on active LLM slots stop a scan before analysis (exit code 2). Static scans (`--no-llm`) skip provider initialization and control validation. A Bedrock application-inference-profile ARN hides the model name, so declare `sampling: rejected` for it in the model registry. With the previous `gpt-5.4` and `claude-opus-4-6` defaults a temperature was accepted; unset it, or pin the older model with `SKILLSPECTOR_MODEL`. | Optional |
| `SKILLSPECTOR_SEED` | Optional integer sampling seed for OpenAI-compatible and Azure OpenAI providers. Other hosted providers and CLI providers do not receive it. Provider support remains model-dependent; `gpt-6.1-sol` receives it, but OpenAI treats `seed` as best-effort, so output can still differ between runs. | Optional |
| `SKILLSPECTOR_COMPACT_PROMPTS` | Opt-in compact line numbering in LLM prompts: numbered lines render as `L1:`, `L2:` instead of zero-padded `L01:`, `L02:`. Accepted truthy values are `1`, `true`, and `yes` (case-insensitive; surrounding whitespace is trimmed). Unset or any other value keeps the default zero-padded format. | Optional |
| `ANTHROPIC_API_KEY` | Credential for the Anthropic provider (`SKILLSPECTOR_PROVIDER=anthropic`). | Required for LLM analysis when `SKILLSPECTOR_PROVIDER=anthropic` |
| `ANTHROPIC_BASE_URL` | Override the native Anthropic endpoint (default: `https://api.anthropic.com`). | Optional |
Expand All @@ -747,6 +755,7 @@ Issues (2)
| `SKILLSPECTOR_COMPAT_API_KEY` | API key for a generic OpenAI-compatible provider. | Required when `SKILLSPECTOR_PROVIDER=openai_compatible` |
| `SKILLSPECTOR_COMPAT_BASE_URL` | Base URL for a generic OpenAI-compatible provider. | Required when `SKILLSPECTOR_PROVIDER=openai_compatible` |
| `SKILLSPECTOR_MODEL` | Override the active provider model. For hosted providers, this replaces the bundled default from the LLM Analysis table. For CLI providers, this is forwarded as `--model` instead of using the local runtime fallback. | Optional |
| `SKILLSPECTOR_MODEL_<SLOT>` | Override the model for one analyzer slot (for example `SKILLSPECTOR_MODEL_META_ANALYZER`). It takes precedence over `SKILLSPECTOR_MODEL`, which in turn replaces provider slot defaults such as the `anthropic` `meta_analyzer` default. See [model provenance](docs/INFERENCE_USAGE.md#model-provenance) for the full precedence. | Optional |
| `SKILLSPECTOR_MODEL_REGISTRY` | Override the bundled per-provider YAML registry (`src/skillspector/providers/<provider>/model_registry.yaml`) with a custom path. | Optional |
| `SKILLSPECTOR_LOG_LEVEL` | Log level: `DEBUG`, `INFO`, `WARNING`, `ERROR` (default: `WARNING`). | Optional |
| `SKILLSPECTOR_MAX_DEPENDENCY_SOURCE_ANALYSIS_SECONDS` | Ceiling for the dependency-source analysis pass, in seconds. Defaults to `5.0`, which is the historical value. Raise it on slow or heavily loaded machines so the same unchanged tree does not come back partially inspected, which would set `safe_to_install` to false and record `runtime_limit`. The remaining aggregate workflow time (`SKILLSPECTOR_MAX_WORKFLOW_SECONDS`, 600 seconds by default) still caps the effective value; values above that remaining time have no effect. Invalid, zero, negative, infinite, and NaN values keep the 5-second default. The setting is resolved when the module is imported, so a new process is required after changing it. See [analysis resource bounds](docs/ANALYSIS_RESOURCE_BOUNDS.md#configuring-the-dependency-source-deadline). | Optional |
Expand Down
6 changes: 3 additions & 3 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ make install-dev
- **Provider credential**: depends on the active provider. Hosted providers use the matching variables in [.env.example](../.env.example); Ollama and CLI providers do not require an API key. See [providers/](../src/skillspector/providers/).
- **`OPENAI_BASE_URL`**: Override the OpenAI endpoint (e.g. point at Ollama).
- **`SKILLSPECTOR_MODEL`**: Override default model; see [constants.py](../src/skillspector/constants.py).
- **`SKILLSPECTOR_TEMPERATURE`**: Optional hosted-provider sampling temperature from `0` to `1`.
- **`SKILLSPECTOR_TEMPERATURE`**: Optional hosted-provider sampling temperature from `0` to `1`. `gpt-6.1-sol` rejects every explicit value. `claude-opus-5-5` and `claude-sonnet-5-5` accept only `1.0` on the native Anthropic endpoint; other routes reject every explicit value. Unsupported settings on active LLM slots stop the scan before analysis. Static scans skip provider initialization and control validation.
- **`SKILLSPECTOR_SEED`**: Optional integer seed for OpenAI-compatible and Azure OpenAI providers.

- **Logging**: Internal/operational logging uses the stdlib `logging` module. User-facing output (report body, errors, progress) uses Rich `console.print()`.
Expand Down Expand Up @@ -300,9 +300,9 @@ Copy [.env.example](../.env.example) to `.env` in the project root and set value
| `NVIDIA_INFERENCE_KEY` | Credential for `nv_build`. | `nvapi-...` |
| `OPENAI_API_KEY` | Credential for `SKILLSPECTOR_PROVIDER=openai`. Also tier-2 fallback for non-OpenAI providers. | `sk-...` |
| `OPENAI_BASE_URL` | Override the OpenAI endpoint (e.g. point at Ollama). | `http://localhost:11434/v1` |
| `SKILLSPECTOR_REASONING_EFFORT` | Optional provider- and model-dependent reasoning-effort setting. Non-empty values are trimmed and passed through unchanged. When unset or blank, SkillSpector sends `high` for `nv_build` with `z-ai/glm-5.3`; other provider/model combinations keep their endpoint defaults. | `high` |
| `SKILLSPECTOR_REASONING_EFFORT` | Optional provider- and model-dependent reasoning-effort setting. Non-empty values are trimmed and passed through unchanged. When unset or blank, SkillSpector sends `high` for `nv_build` with `z-ai/glm-5.3`; other provider/model combinations keep their endpoint defaults. `gpt-6.1-sol` accepts only `low`, `medium`, `high`, `xhigh`, or `max`; any other value stops a scan before analysis (exit code 2). | `high` |
| `SKILLSPECTOR_OUTPUT_LANGUAGE` | Optional short, single-line language label (letters, numbers, spaces, `_`, or `-`; maximum 64 characters) for human-readable LLM finding text. Rule IDs, severity values, paths, code, and other machine-readable values remain unchanged. Unset, blank, or invalid values preserve the default output language. | `Japanese` |
| `SKILLSPECTOR_TEMPERATURE` | Optional sampling temperature from `0` to `1` for hosted providers. Unset or blank preserves provider defaults. Lower values reduce variation but do not guarantee identical output. | `0` |
| `SKILLSPECTOR_TEMPERATURE` | Optional sampling temperature from `0` to `1` for hosted providers. Unset or blank preserves provider defaults. Lower values reduce variation but do not guarantee identical output. `gpt-6.1-sol` rejects every explicit value. `claude-opus-5-5` and `claude-sonnet-5-5` accept `1.0` on the native Anthropic endpoint only ([API compatibility rule](https://platform.claude.com/docs/en/api/messages/create)). Unsupported settings on active LLM slots stop a scan before analysis (exit code 2); static scans skip provider initialization and these checks. Leave it unset to preserve the default models’ endpoint defaults. | `0` |
| `SKILLSPECTOR_SEED` | Optional integer sampling seed for OpenAI-compatible and Azure OpenAI providers. Provider/model support is best-effort; CLI providers ignore it. | `42` |
| `ANTHROPIC_API_KEY` | Credential for `SKILLSPECTOR_PROVIDER=anthropic`. | `sk-ant-...` |
| `OLLAMA_BASE_URL` | Optional Ollama endpoint override. | `http://localhost:11434/v1` |
Expand Down
13 changes: 13 additions & 0 deletions src/skillspector/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
inspection_work_id,
ledger_event,
)
from skillspector.llm_utils import unsupported_control_error
from skillspector.logging_config import get_logger, set_level
from skillspector.mcp_registry import scan_registry
from skillspector.models import OCCURRENCE_FINDING_ID_KEY, Finding
Expand Down Expand Up @@ -372,6 +373,16 @@ def _write_result(
print(report_body)


def _exit_on_unsupported_llm_controls(no_llm: bool) -> None:
"""Exit 2 before any analysis when a configured model rejects a requested control."""
if no_llm:
return
error = unsupported_control_error()
if error is not None:
err_console.print(f"[red]Error:[/red] {error}")
raise typer.Exit(code=2)


def _validate_min_coverage(value: float | None) -> float | None:
"""Accept only finite percentage thresholds in the CLI's supported range."""
if value is not None and (not math.isfinite(value) or not 0 <= value <= 100):
Expand Down Expand Up @@ -735,6 +746,7 @@ def scan(
except ValueError as exc:
err_console.print(f"[red]Error:[/red] invalid transitive prefix: {exc}")
raise typer.Exit(code=2) from exc
_exit_on_unsupported_llm_controls(no_llm)
yara_dir = str(yara_rules_dir.resolve()) if yara_rules_dir else None
pre_scan_ledger_events: list[dict[str, object]] = []
discovery_console = (
Expand Down Expand Up @@ -3450,6 +3462,7 @@ def baseline(
skillspector baseline ./my-skill/ -o team-baseline.yaml --no-llm
skillspector scan ./my-skill/ --baseline .skillspector-baseline.yaml
"""
_exit_on_unsupported_llm_controls(no_llm)
result = None
try:
if verbose:
Expand Down
Loading
Loading