Summary
LLMAnalyzerBase and its subclasses (semantic_security_discovery.py,semantic_quality_policy.py, semantic_developer_intent.py) hardcode ANALYZER_PROMPT as module-level Python string constants, and BASE_ANALYSIS_PROMPT in llm_analyzer_base.py has no language directive.
There's currently no way to make the free-text finding fields (message, explanation, remediation) come back in a language other than English without forking the package and editing prompt strings directly.
For non-English-speaking teams reviewing scan output (e.g. in CI comments,SARIF annotations shown to reviewers), this is a real friction point —every finding has to be manually translated or read through an LLM before it's usable internally.
Proposed change
Add a SKILLSPECTOR_OUTPUT_LANGUAGE (name open to bikeshedding) environment variable, following the same pattern as the existing
SKILLSPECTOR_MAX_LLM_CONCURRENCY:
def resolve_output_language() -> str | None:
"""Resolve the desired output language from SKILLSPECTOR_OUTPUT_LANGUAGE.
Defaults to None (model's natural choice, currently English). When set,
an instruction is appended to BASE_ANALYSIS_PROMPT telling the model to
write message/explanation/remediation fields in the given language,
while keeping rule_id values (e.g. SSD-1, SQP-3) untranslated.
"""
return os.environ.get("SKILLSPECTOR_OUTPUT_LANGUAGE", "").strip() or None
And in BASE_ANALYSIS_PROMPT / LLMAnalyzerBase.build_prompt
Summary
LLMAnalyzerBaseand its subclasses (semantic_security_discovery.py,semantic_quality_policy.py,semantic_developer_intent.py) hardcodeANALYZER_PROMPTas module-level Python string constants, andBASE_ANALYSIS_PROMPTinllm_analyzer_base.pyhas no language directive.There's currently no way to make the free-text finding fields (
message,explanation,remediation) come back in a language other than English without forking the package and editing prompt strings directly.For non-English-speaking teams reviewing scan output (e.g. in CI comments,SARIF annotations shown to reviewers), this is a real friction point —every finding has to be manually translated or read through an LLM before it's usable internally.
Proposed change
Add a
SKILLSPECTOR_OUTPUT_LANGUAGE(name open to bikeshedding) environment variable, following the same pattern as the existingSKILLSPECTOR_MAX_LLM_CONCURRENCY:And in
BASE_ANALYSIS_PROMPT/LLMAnalyzerBase.build_prompt