Skip to content

Commit 2df342f

Browse files
Merge branch 'main' into yashraj/fix-projected-prompt-regex-timeouts
2 parents 2f79822 + f3ec825 commit 2df342f

33 files changed

Lines changed: 1494 additions & 75 deletions

‎.env.example‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ENV=dev # options: dev|s
33
# Active LLM provider. Selects which provider answers credentials,
44
# metadata, and default-model lookups. Leave unset to default to nv_build.
55
# Options: openai | anthropic | anthropic_proxy | bedrock | nv_build |
6-
# ollama | azure_openai | openai_compatible | claude_cli |
6+
# ollama | azure_openai | openai_compatible | gemini | claude_cli |
77
# codex_cli | gemini_cli | opencode_cli
88
SKILLSPECTOR_PROVIDER=
99

@@ -49,6 +49,15 @@ ANTHROPIC_PROXY_API_KEY=
4949
# ANTHROPIC_PROXY_API_VERSION=vertex-2023-10-16 # optional; defaults to vertex-2023-10-16
5050
# SKILLSPECTOR_SSL_VERIFY=false # set to false for internal/self-signed CAs
5151

52+
# For SKILLSPECTOR_PROVIDER=gemini (Google Cloud ADC / Workload Identity).
53+
# Requires GOOGLE_CLOUD_PROJECT; GOOGLE_CLOUD_LOCATION defaults to global.
54+
# Local use: gcloud auth application-default login (configure quota project with: gcloud auth application-default set-quota-project PROJECT_ID)
55+
# Kubernetes/GKE: configure Workload Identity (leave GOOGLE_APPLICATION_CREDENTIALS unset)
56+
# Note: regional endpoints alone do not guarantee data residency; global does not support residency.
57+
GOOGLE_CLOUD_PROJECT=
58+
# GOOGLE_CLOUD_LOCATION=global # optional; e.g. global, us, eu, us-central1
59+
# GOOGLE_APPLICATION_CREDENTIALS= # optional; path to Workload/Workforce Identity Federation config JSON
60+
5261
# For SKILLSPECTOR_PROVIDER=bedrock. AWS_PROFILE is optional; when unset,
5362
# boto3 uses its standard credential chain. AWS_REGION defaults to us-west-2.
5463
# AWS_PROFILE=

‎Makefile‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help install install-dev langgraph-dev test test-unit test-provider openai anthropic nv_build test-integration test-cov test-ci lint lint-fix format format-check clean build docker-build docker-smoke
1+
.PHONY: help install install-dev langgraph-dev test test-unit test-provider openai anthropic nv_build gemini test-integration test-cov test-ci lint lint-fix format format-check clean build docker-build docker-smoke
22

33
# Prefer uv if available, else use pip (set when Makefile is parsed)
44
UV := $(shell command -v uv 2>/dev/null)
@@ -8,7 +8,7 @@ UV := $(shell command -v uv 2>/dev/null)
88
# make langgraph-dev LANGGRAPH_STUDIO_URL=https://your-studio.example
99
LANGGRAPH_STUDIO_URL = https://smith.langchain.com
1010

11-
PROVIDER_TEST_SELECTION := $(filter openai anthropic nv_build,$(MAKECMDGOALS))
11+
PROVIDER_TEST_SELECTION := $(filter openai anthropic nv_build gemini,$(MAKECMDGOALS))
1212
ifneq ($(PROVIDER_TEST_SELECTION),)
1313
PROVIDER_TEST_PROVIDERS := $(PROVIDER_TEST_SELECTION)
1414
PROVIDER_TEST_TARGETS :=
@@ -21,8 +21,11 @@ endif
2121
ifneq ($(filter nv_build,$(PROVIDER_TEST_SELECTION)),)
2222
PROVIDER_TEST_TARGETS += tests/provider/test_provider_endpoint.py::test_nv_build_provider_makes_live_structured_request
2323
endif
24+
ifneq ($(filter gemini,$(PROVIDER_TEST_SELECTION)),)
25+
PROVIDER_TEST_TARGETS += tests/provider/test_provider_endpoint.py::test_gemini_provider_makes_live_structured_request
26+
endif
2427
else
25-
PROVIDER_TEST_PROVIDERS := openai anthropic nv_build
28+
PROVIDER_TEST_PROVIDERS := openai anthropic nv_build gemini
2629
PROVIDER_TEST_TARGETS := tests/provider
2730
endif
2831

@@ -34,7 +37,7 @@ help:
3437
@echo " make langgraph-dev - Run LangGraph dev server (Studio at \$$LANGGRAPH_STUDIO_URL)"
3538
@echo " make test - Run unit + integration tests"
3639
@echo " make test-unit - Run unit tests only (no LLM calls)"
37-
@echo " make test-provider [openai|anthropic|nv_build] - Run live provider tests"
40+
@echo " make test-provider [openai|anthropic|nv_build|gemini] - Run live provider tests"
3841
@echo " make test-integration - Run integration tests only (invokes full graph, may call LLMs)"
3942
@echo " make test-cov - Run tests with coverage report"
4043
@echo " make lint - Run linters (ruff only)"
@@ -74,6 +77,7 @@ test-provider:
7477
openai) env_name=OPENAI_API_KEY; label=OpenAI ;; \
7578
anthropic) env_name=ANTHROPIC_API_KEY; label=Anthropic ;; \
7679
nv_build) env_name=NVIDIA_INFERENCE_KEY; label="NV Build" ;; \
80+
gemini) env_name=GOOGLE_CLOUD_PROJECT; label=Gemini ;; \
7781
esac; \
7882
eval "value=\$${$${env_name}:-}"; \
7983
if [ -z "$$value" ]; then \
@@ -90,7 +94,7 @@ test-provider:
9094
printf "missing provider keys\n" > "$$PROVIDER_TEST_MISSING_KEYS_FILE"; \
9195
fi
9296

93-
openai anthropic nv_build:
97+
openai anthropic nv_build gemini:
9498
@:
9599

96100
# Run integration tests only (invokes full graph, may call LLMs)

‎README.md‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ inference gateways.
291291
| `anthropic_proxy` | `ANTHROPIC_PROXY_API_KEY` + `ANTHROPIC_PROXY_ENDPOINT_URL` | Any Vertex-style raw-predict proxy | `claude-sonnet-4-6` |
292292
| `bedrock` | `AWS_PROFILE` (optional) + `AWS_REGION` — SigV4 via boto3 | AWS Bedrock Runtime | `us.anthropic.claude-sonnet-4-6-20250915-v1:0` |
293293
| `nv_build` | `NVIDIA_INFERENCE_KEY` | build.nvidia.com | `z-ai/glm-5.2` |
294+
| `gemini` | `GOOGLE_CLOUD_PROJECT` (+ optional `GOOGLE_CLOUD_LOCATION`) via ADC | Google Cloud OpenAI-compatible Gemini endpoint | `gemini-3.8-flash` |
294295
| `ollama` | _(none)_ | `OLLAMA_BASE_URL` (default `http://localhost:11434/v1`) | `llama3.1:8b` |
295296
| `azure_openai` | `AZURE_OPENAI_API_KEY` + `AZURE_OPENAI_ENDPOINT` | Azure OpenAI Service | `gpt-4o` (deployment defaults to the model label) |
296297
| `openai_compatible` | `SKILLSPECTOR_COMPAT_API_KEY` + `SKILLSPECTOR_COMPAT_BASE_URL` | Any OpenAI-compatible endpoint | `llama-3.1-70b-versatile` |
@@ -352,6 +353,31 @@ export SKILLSPECTOR_PROVIDER=nv_build
352353
export NVIDIA_INFERENCE_KEY=nvapi-...
353354
skillspector scan ./my-skill/
354355

356+
# Gemini on Google Cloud (Application Default Credentials / Workload Identity)
357+
# Prerequisites:
358+
# 1. Google Cloud project with billing enabled.
359+
# 2. Enable Gemini Enterprise Agent Platform / Vertex AI API: `aiplatform.googleapis.com`.
360+
# 3. IAM permission: grant `roles/aiplatform.user` (or at minimum `aiplatform.endpoints.predict`)
361+
# to your user account or Kubernetes service account.
362+
# 4. Local authentication: run `gcloud auth application-default login`.
363+
# Configure a quota project if needed: `gcloud auth application-default set-quota-project PROJECT_ID`.
364+
# 5. Kubernetes / GKE: configure Workload Identity and leave GOOGLE_APPLICATION_CREDENTIALS unset
365+
# rather than exporting service account keys.
366+
# Note on Data Residency:
367+
# The default `global` endpoint does not support data-residency requirements. While you can target
368+
# `us`, `eu`, or regional endpoints (e.g. `us-central1`), endpoint selection alone does not guarantee
369+
# data residency or in-region processing without appropriate organizational policies. Always verify
370+
# that your selected model is supported in your target location.
371+
# Optional credentials:
372+
# GOOGLE_APPLICATION_CREDENTIALS is optional and can reference Workload or Workforce Identity Federation
373+
# configuration files; exporting long-lived service account keys is discouraged.
374+
export SKILLSPECTOR_PROVIDER=gemini
375+
export GOOGLE_CLOUD_PROJECT=my-project-id
376+
# export GOOGLE_CLOUD_LOCATION=global # default is global; or us, eu, or specific region (e.g. us-central1)
377+
# Default model: gemini-3.8-flash
378+
# export SKILLSPECTOR_MODEL=gemini-3.7-flash
379+
skillspector scan ./my-skill/
380+
355381
# Local Claude CLI — no API key; uses your existing `claude auth login` session
356382
# Requires: claude CLI installed and authenticated (claude auth login)
357383
export SKILLSPECTOR_PROVIDER=claude_cli
@@ -680,7 +706,10 @@ Issues (2)
680706

681707
| Variable | Description | Required |
682708
|----------|-------------|----------|
683-
| `SKILLSPECTOR_PROVIDER` | Active LLM provider: `openai`, `anthropic`, `anthropic_proxy`, `bedrock`, `nv_build`, `ollama`, `azure_openai`, `openai_compatible`, `claude_cli`, `codex_cli`, `gemini_cli`, or `opencode_cli`. Hosted providers use bundled `model_registry.yaml` defaults; CLI providers fall back to the local runtime's default model unless `SKILLSPECTOR_MODEL` is set. Defaults to `nv_build`. | Optional |
709+
| `SKILLSPECTOR_PROVIDER` | Active LLM provider: `openai`, `anthropic`, `anthropic_proxy`, `bedrock`, `nv_build`, `gemini`, `ollama`, `azure_openai`, `openai_compatible`, `claude_cli`, `codex_cli`, `gemini_cli`, or `opencode_cli`. Hosted providers use bundled `model_registry.yaml` defaults; CLI providers fall back to the local runtime's default model unless `SKILLSPECTOR_MODEL` is set. Defaults to `nv_build`. | Optional |
710+
| `GOOGLE_CLOUD_PROJECT` | Google Cloud project ID for the `gemini` provider. Authenticates via Google Cloud Application Default Credentials (ADC) or GKE Workload Identity. | Required for LLM analysis when `SKILLSPECTOR_PROVIDER=gemini` |
711+
| `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`) |
712+
| `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`) |
684713
| `NVIDIA_INFERENCE_KEY` | Credential for the `nv_build` provider (build.nvidia.com). | Required for LLM analysis when `SKILLSPECTOR_PROVIDER=nv_build` |
685714
| `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` |
686715
| `OPENAI_BASE_URL` | Override the OpenAI endpoint (e.g. point at Ollama). | Optional |

‎THIRD_PARTY_NOTICES.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ and project URL.
7272
- **Copyright:** Copyright (c) 2007-2022 The YARA Authors
7373
- **URL:** https://github.com/VirusTotal/yara-python
7474

75+
### google-auth
76+
77+
- **License:** Apache-2.0
78+
- **Copyright:** Copyright 2014 Google Inc.
79+
- **URL:** https://github.com/googleapis/google-auth-library-python
80+
7581
---
7682

7783
## License Texts

‎docs/DEVELOPMENT.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ The manual `test-provider` CI job and local `make test-provider` target perform
323323
| `make test-provider openai` | `OPENAI_API_KEY` | `https://api.openai.com/v1` | `SKILLSPECTOR_OPENAI_TEST_MODEL` |
324324
| `make test-provider anthropic` | `ANTHROPIC_API_KEY` | `https://api.anthropic.com` | `SKILLSPECTOR_ANTHROPIC_TEST_MODEL` |
325325
| `make test-provider nv_build` | `NVIDIA_INFERENCE_KEY` | `https://integrate.api.nvidia.com/v1` | `SKILLSPECTOR_NV_BUILD_TEST_MODEL` |
326+
| `make test-provider gemini` | `GOOGLE_CLOUD_PROJECT` | `https://aiplatform.googleapis.com/v1/...` | `SKILLSPECTOR_GEMINI_TEST_MODEL` |
326327
| `make test-provider` | Any/all of the provider keys above | All provider default URLs above | Any/all provider model overrides above |
327328

328329
Base URL env vars are not needed for live provider tests; the tests intentionally use provider defaults.
@@ -339,6 +340,7 @@ Base URL env vars are not needed for live provider tests; the tests intentionall
339340
- `anthropic/` — api.anthropic.com (`ANTHROPIC_API_KEY`)
340341
- `anthropic_proxy/` — Vertex-style proxy (`ANTHROPIC_PROXY_API_KEY`, `ANTHROPIC_PROXY_ENDPOINT_URL`)
341342
- `bedrock/` — AWS Bedrock Runtime (standard boto3 credential chain)
343+
- `gemini/` — Google Cloud OpenAI-compatible Gemini endpoint (`GOOGLE_CLOUD_PROJECT`, ADC / Workload Identity)
342344
- `ollama/` — local Ollama OpenAI-compatible endpoint (no API key)
343345
- `azure_openai/` — Azure OpenAI Service (`AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_ENDPOINT`)
344346
- `openai_compatible/` — generic compatible endpoint (`SKILLSPECTOR_COMPAT_API_KEY`, `SKILLSPECTOR_COMPAT_BASE_URL`)

‎docs/PI_EXTENSION.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Equivalent CLI:
4343
- `format`: `terminal`, `json`, `markdown`, or `sarif`. Default: `terminal`.
4444
- `output`: optional report path.
4545
- `noLlm`: default `true`.
46-
- `provider`: optional `openai`, `anthropic`, `anthropic_proxy`, or `nv_build`.
46+
- `provider`: optional `openai`, `anthropic`, `anthropic_proxy`, `nv_build`, `nv_inference`, or `gemini`.
4747
- `model`: optional model override.
4848
- `yaraRulesDir`: optional directory of extra YARA rules.
4949
- `verbose`: optional detailed progress.

‎extensions/skillspector.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const scanSchema = Type.Object({
1616
output: Type.Optional(Type.String({ description: "Optional report output path within the current workspace." })),
1717
noLlm: Type.Optional(Type.Boolean({ description: "Skip LLM analysis. Defaults to true." })),
1818
provider: Type.Optional(
19-
StringEnum(["openai", "anthropic", "anthropic_proxy", "nv_build", "nv_inference"] as const, {
19+
StringEnum(["openai", "anthropic", "anthropic_proxy", "nv_build", "nv_inference", "gemini"] as const, {
2020
description: "Optional SkillSpector LLM provider when noLlm is false.",
2121
}),
2222
),

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dependencies = [
4848
"boto3>=1.34.0",
4949
"langsmith>=0.7.30",
5050
"yara-python>=4.5.0",
51+
"google-auth[requests]>=2.53.0",
5152
]
5253

5354
[project.optional-dependencies]

‎src/skillspector/cli.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ def scan(
619619
SKILLSPECTOR_PROVIDER Active LLM provider: openai | anthropic |
620620
anthropic_proxy | bedrock | nv_build |
621621
nv_inference | ollama | azure_openai |
622-
openai_compatible | claude_cli | codex_cli |
622+
openai_compatible | gemini | claude_cli | codex_cli |
623623
gemini_cli | opencode_cli. Defaults to the NVIDIA path
624624
(nv_inference, falling back to nv_build in
625625
OSS builds).
@@ -641,6 +641,9 @@ def scan(
641641
AZURE_OPENAI_ENDPOINT for azure_openai
642642
SKILLSPECTOR_COMPAT_API_KEY +
643643
SKILLSPECTOR_COMPAT_BASE_URL for openai_compatible
644+
GOOGLE_CLOUD_PROJECT [+ GOOGLE_CLOUD_LOCATION]
645+
for gemini (uses Application
646+
Default Credentials / Workload Identity)
644647
645648
ollama uses the local Ollama service. claude_cli, codex_cli,
646649
gemini_cli, and opencode_cli use their CLI's existing local

‎src/skillspector/inference_usage.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ def provider_name(provider: object) -> str:
327327
"ClaudeCLIProvider": "claude_cli",
328328
"CodexCLIProvider": "codex_cli",
329329
"GeminiCLIProvider": "gemini_cli",
330+
"GeminiProvider": "gemini",
330331
"NvBuildProvider": "nv_build",
331332
"NvInferenceProvider": "nv_inference",
332333
"OllamaProvider": "ollama",

0 commit comments

Comments
 (0)