Skip to content

Commit e3aa8bc

Browse files
Merge pull request #12 from openclaw/pe/aig-local-scanner
feat: use local aig skill scanner
2 parents a7ecc98 + 0bbed6e commit e3aa8bc

16 files changed

Lines changed: 527 additions & 753 deletions

File tree

.github/workflows/run-clawscan-benchmark.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ on:
121121
required: false
122122
default: ""
123123
secrets:
124-
AIG_API_KEY:
124+
LLM_API_KEY:
125125
required: false
126-
AIG_BASE_URL:
126+
DEFAULT_MODEL:
127127
required: false
128-
AIG_MODEL:
128+
DEFAULT_BASE_URL:
129129
required: false
130-
AIG_MODEL_API_KEY:
130+
DEFAULT_MODEL_CONTEXT_WINDOW:
131131
required: false
132-
AIG_MODEL_BASE_URL:
132+
LOG_LEVEL:
133133
required: false
134134
ANTHROPIC_API_KEY:
135135
required: false
@@ -194,11 +194,11 @@ jobs:
194194
OUTPUT_PATH: ${{ inputs.output_path }}
195195
CLAWSCAN_SANDBOX: ${{ inputs.sandbox }}
196196
CLAWSCAN_SANDBOX_IMAGE: ${{ inputs.sandbox_image }}
197-
AIG_API_KEY: ${{ secrets.AIG_API_KEY }}
198-
AIG_BASE_URL: ${{ secrets.AIG_BASE_URL }}
199-
AIG_MODEL: ${{ secrets.AIG_MODEL }}
200-
AIG_MODEL_API_KEY: ${{ secrets.AIG_MODEL_API_KEY }}
201-
AIG_MODEL_BASE_URL: ${{ secrets.AIG_MODEL_BASE_URL }}
197+
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
198+
DEFAULT_MODEL: ${{ secrets.DEFAULT_MODEL }}
199+
DEFAULT_BASE_URL: ${{ secrets.DEFAULT_BASE_URL }}
200+
DEFAULT_MODEL_CONTEXT_WINDOW: ${{ secrets.DEFAULT_MODEL_CONTEXT_WINDOW }}
201+
LOG_LEVEL: ${{ secrets.LOG_LEVEL }}
202202
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
203203
CODEX_API_KEY: ${{ secrets.CODEX_API_KEY || secrets.OPENAI_API_KEY }}
204204
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

.github/workflows/runtime-tool-updates.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
run: |
4444
docker run --rm clawscan-runtime:candidate codex --help >/dev/null
4545
docker run --rm clawscan-runtime:candidate claude --help >/dev/null
46+
docker run --rm clawscan-runtime:candidate aig-skill-scan --help >/dev/null
4647
docker run --rm clawscan-runtime:candidate skillspector --help >/dev/null
4748
docker run --rm clawscan-runtime:candidate snyk-agent-scan --help >/dev/null
4849
docker run --rm clawscan-runtime:candidate socket --help >/dev/null

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,22 @@ clawscan scanners skillspector
143143
| ID | Name | Repo | Description | Required env vars | Local dependency setup |
144144
| --- | --- | --- | --- | --- | --- |
145145
| `agentverus` | AgentVerus | [repo](https://github.com/agentverus/agentverus-scanner) | Local file or directory scanner invoked through agentverus-scanner. | none | `npm install --save-dev agentverus-scanner` |
146-
| `aig` | Tencent AI-Infra-Guard | [repo](https://github.com/Tencent/AI-Infra-Guard) | API-backed MCP Server & Agent Skills scan through a running local or private A.I.G service. Upstream defaults to `http://localhost:8088` and currently lacks built-in authentication, so do not expose it on public networks. | none<br><details><summary>Optional config</summary><code>AIG_BASE_URL</code>, <code>AIG_API_KEY</code>, <code>AIG_MODEL</code>, <code>AIG_MODEL_API_KEY</code>, <code>AIG_MODEL_BASE_URL</code>, <code>AIG_USERNAME</code>, <code>AIG_SCAN_LANGUAGE</code>, <code>AIG_SCAN_PROMPT</code>, <code>AIG_SCAN_THREAD_COUNT</code>, <code>AIG_POLL_INTERVAL_MS</code>, <code>AIG_POLL_MAX_ATTEMPTS</code>.<br><br><code>AIG_BASE_URL</code> defaults to <code>http://localhost:8088</code>; upstream model config is optional and can fall back to the A.I.G service defaults.</details> | run the A.I.G Docker/API service separately |
146+
| `aig` | Tencent AI-Infra-Guard | [repo](https://github.com/Tencent/AI-Infra-Guard/tree/main/skill-scan) | Tencent Zhuque Lab's local directory scanner invoked through `aig-skill-scan`. Produces SARIF 2.1.0 with SkillTrustBench T01-T09 evidence. | `LLM_API_KEY` or `OPENAI_API_KEY`<br><details><summary>Optional config</summary><code>DEFAULT_MODEL</code>, <code>DEFAULT_BASE_URL</code>, <code>DEFAULT_MODEL_CONTEXT_WINDOW</code>, <code>LOG_LEVEL</code>.</details> | `pip install aig-skill-scan` |
147147
| `cisco` | Cisco AI Defense skill-scanner | [repo](https://github.com/cisco-ai-defense/skill-scanner) | Local file or directory scanner invoked through `skill-scanner` with JSON report output. Optional upstream env vars enable LLM, VirusTotal, and Cisco AI Defense analyzers. | none<br><details><summary>Optional config</summary><code>SKILL_SCANNER_LLM_API_KEY</code>, <code>SKILL_SCANNER_LLM_PROVIDER</code>, <code>SKILL_SCANNER_LLM_MODEL</code>, <code>SKILL_SCANNER_LLM_BASE_URL</code>, <code>SKILL_SCANNER_LLM_USER</code>, <code>SKILL_SCANNER_LLM_API_VERSION</code>, <code>SKILL_SCANNER_LLM_FORCE_JSON_OBJECT</code>, <code>SKILL_SCANNER_META_LLM_API_KEY</code>, <code>SKILL_SCANNER_META_LLM_MODEL</code>, <code>SKILL_SCANNER_META_LLM_BASE_URL</code>, <code>SKILL_SCANNER_META_LLM_API_VERSION</code>, <code>AWS_PROFILE</code>, <code>AWS_REGION</code>, <code>GOOGLE_APPLICATION_CREDENTIALS</code>, <code>VIRUSTOTAL_API_KEY</code>, <code>AI_DEFENSE_API_KEY</code>, <code>AI_DEFENSE_API_URL</code>.</details> | `uv pip install cisco-ai-skill-scanner` |
148148
| `clawscan-static` | ClawScan Static | [repo](https://github.com/openclaw/clawscan) | Built-in deterministic text scanner for high-signal risky skill patterns. | none | skipped; built in |
149149
| `skillspector` | NVIDIA SkillSpector | [repo](https://github.com/NVIDIA/skillspector) | Local file or directory scanner. Uses LLM mode when provider env vars are set; otherwise runs with `--no-llm`. | none<br><details><summary>Optional config</summary><code>SKILLSPECTOR_PROVIDER</code>, <code>SKILLSPECTOR_MODEL</code>, <code>SKILLSPECTOR_MODEL_REGISTRY</code>, <code>SKILLSPECTOR_LOG_LEVEL</code>, <code>SKILLSPECTOR_SSL_VERIFY</code>, <code>NVIDIA_INFERENCE_KEY</code>, <code>OPENAI_API_KEY</code>, <code>OPENAI_BASE_URL</code>, <code>ANTHROPIC_API_KEY</code>, <code>ANTHROPIC_PROXY_ENDPOINT_URL</code>, <code>ANTHROPIC_PROXY_API_KEY</code>, <code>ANTHROPIC_PROXY_API_VERSION</code>.</details> | `uv tool install git+https://github.com/NVIDIA/skillspector.git` |
150150
| `snyk` | Snyk Agent Scan | [repo](https://github.com/snyk/agent-scan) | Local skill scanner invoked through `uvx snyk-agent-scan`. | `SNYK_TOKEN` | verifies `uvx` launcher |
151151
| `socket` | Socket CLI | [repo](https://github.com/SocketDev/socket-cli) | Local file or directory scanner using Socket's public CLI full-scan path. | `SOCKET_CLI_API_TOKEN` | `npm install -g socket` |
152152
| `virustotal` | VirusTotal API | [docs](https://docs.virustotal.com/reference/file) | API-backed single local file hash lookup. Directories return a skipped result. | `VIRUSTOTAL_API_KEY` | skipped; API-backed |
153153

154+
Starting in `v0.1.2`, the built-in `aig` scanner uses Tencent's local
155+
`aig-skill-scan` package instead of the legacy A.I.G Docker/API service.
156+
Replace `AIG_MODEL` with `DEFAULT_MODEL`, `AIG_MODEL_BASE_URL` with
157+
`DEFAULT_BASE_URL`, and `AIG_MODEL_API_KEY` with `LLM_API_KEY` (or
158+
`OPENAI_API_KEY`). `AIG_BASE_URL` and `AIG_API_KEY` are no longer used.
159+
The local scanner accepts directory targets only; materialize URL or file inputs
160+
as a skill directory before scanning them with `aig`.
161+
154162
## Profiles
155163

156164
`--profile` runs a saved scanner and judge configuration, such as the built-in

cmd/clawscan/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ Built-in profiles:
610610
%s
611611
612612
Required environment variables:
613-
aig: no ClawScan-required env vars; AIG_BASE_URL defaults to http://localhost:8088. Use "clawscan scanners aig" for optional service/model vars and the private-network warning.
613+
aig: LLM_API_KEY or OPENAI_API_KEY. Use "clawscan scanners aig" for local scanner details and optional model configuration.
614614
socket: SOCKET_CLI_API_TOKEN
615615
snyk: SNYK_TOKEN
616616
virustotal: VIRUSTOTAL_API_KEY

cmd/clawscan/main_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestRunCommandPrintsHelp(t *testing.T) {
5353
"Accepted scanner IDs:",
5454
"agentverus, aig, cisco, clawscan-static, skillspector, snyk, socket, virustotal",
5555
"Required environment variables:",
56-
"aig: no ClawScan-required env vars",
56+
"aig: LLM_API_KEY or OPENAI_API_KEY",
5757
"SOCKET_CLI_API_TOKEN",
5858
"SNYK_TOKEN",
5959
"VIRUSTOTAL_API_KEY",
@@ -136,12 +136,12 @@ func TestRunCommandScannerDetailPrintsHumanReadableInfo(t *testing.T) {
136136
for _, want := range []string{
137137
"Tencent AI-Infra-Guard",
138138
"ID: aig",
139-
"Repository: https://github.com/Tencent/AI-Infra-Guard",
140-
"Description: API-backed MCP Server & Agent Skills scan",
141-
"Required env vars: none",
142-
"Optional env vars: AIG_BASE_URL, AIG_API_KEY, AIG_MODEL, AIG_MODEL_API_KEY, AIG_MODEL_BASE_URL, AIG_USERNAME, AIG_SCAN_LANGUAGE, AIG_SCAN_PROMPT, AIG_SCAN_THREAD_COUNT, AIG_POLL_INTERVAL_MS, AIG_POLL_MAX_ATTEMPTS",
139+
"Repository: https://github.com/Tencent/AI-Infra-Guard/tree/main/skill-scan",
140+
"Description: Tencent Zhuque Lab's local directory scanner invoked through aig-skill-scan",
141+
"Required env vars: LLM_API_KEY",
142+
"Optional env vars: OPENAI_API_KEY, DEFAULT_MODEL, DEFAULT_BASE_URL, DEFAULT_MODEL_CONTEXT_WINDOW, LOG_LEVEL",
143143
"Install:",
144-
"Run the A.I.G Docker/API service separately",
144+
"pip install aig-skill-scan",
145145
} {
146146
if !strings.Contains(stdout, want) {
147147
t.Fatalf("scanner detail missing %q:\n%s", want, stdout)

docker/clawscan-runtime/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM python:3.12-slim
22

33
ARG SKILLSPECTOR_REF=78be329a7ea9749842e335598132ce171b8717d4
4+
ARG AIG_SKILL_SCAN_VERSION=0.2.1
45
ARG CISCO_AI_SKILL_SCANNER_VERSION=2.0.12
56
ARG SNYK_AGENT_SCAN_VERSION=0.5.12
67
ARG CLAUDE_CODE_VERSION=2.1.193
@@ -22,9 +23,12 @@ RUN python -m pip install --no-cache-dir --upgrade pip uv \
2223
&& python -m pip install --no-cache-dir \
2324
"git+https://github.com/NVIDIA/skillspector.git@${SKILLSPECTOR_REF}" \
2425
"cisco-ai-skill-scanner==${CISCO_AI_SKILL_SCANNER_VERSION}" \
26+
&& uv tool install "aig-skill-scan==${AIG_SKILL_SCAN_VERSION}" \
2527
&& uv tool install "snyk-agent-scan==${SNYK_AGENT_SCAN_VERSION}" \
2628
&& ln -sf /root/.local/bin/snyk-agent-scan /usr/local/bin/snyk-agent-scan
2729

30+
RUN ln -sf /root/.local/bin/aig-skill-scan /usr/local/bin/aig-skill-scan
31+
2832
RUN npm install -g \
2933
"@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}" \
3034
"@openai/codex@${OPENAI_CODEX_VERSION}" \

docs/scanners.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,21 @@ clawscan scanners skillspector
2424
| ID | Name | Repo | Description | Required env vars | Local dependency setup |
2525
| --- | --- | --- | --- | --- | --- |
2626
| `agentverus` | AgentVerus | [repo](https://github.com/agentverus/agentverus-scanner) | Local file or directory scanner invoked through agentverus-scanner. | none | `npm install --save-dev agentverus-scanner` |
27-
| `aig` | Tencent AI-Infra-Guard | [repo](https://github.com/Tencent/AI-Infra-Guard) | API-backed MCP Server & Agent Skills scan through a running local or private A.I.G service. Upstream defaults to `http://localhost:8088` and currently lacks built-in authentication, so do not expose it on public networks. | none<br><details><summary>Optional config</summary><code>AIG_BASE_URL</code>, <code>AIG_API_KEY</code>, <code>AIG_MODEL</code>, <code>AIG_MODEL_API_KEY</code>, <code>AIG_MODEL_BASE_URL</code>, <code>AIG_USERNAME</code>, <code>AIG_SCAN_LANGUAGE</code>, <code>AIG_SCAN_PROMPT</code>, <code>AIG_SCAN_THREAD_COUNT</code>, <code>AIG_POLL_INTERVAL_MS</code>, <code>AIG_POLL_MAX_ATTEMPTS</code>.<br><br><code>AIG_BASE_URL</code> defaults to <code>http://localhost:8088</code>; upstream model config is optional and can fall back to the A.I.G service defaults.</details> | run the A.I.G Docker/API service separately |
27+
| `aig` | Tencent AI-Infra-Guard | [repo](https://github.com/Tencent/AI-Infra-Guard/tree/main/skill-scan) | Tencent Zhuque Lab's local directory scanner invoked through `aig-skill-scan`. Produces SARIF 2.1.0 with SkillTrustBench T01-T09 evidence. | `LLM_API_KEY` or `OPENAI_API_KEY`<br><details><summary>Optional config</summary><code>DEFAULT_MODEL</code>, <code>DEFAULT_BASE_URL</code>, <code>DEFAULT_MODEL_CONTEXT_WINDOW</code>, <code>LOG_LEVEL</code>.</details> | `pip install aig-skill-scan` |
2828
| `cisco` | Cisco AI Defense skill-scanner | [repo](https://github.com/cisco-ai-defense/skill-scanner) | Local file or directory scanner invoked through `skill-scanner` with JSON report output. Optional upstream env vars enable LLM, VirusTotal, and Cisco AI Defense analyzers. | none<br><details><summary>Optional config</summary><code>SKILL_SCANNER_LLM_API_KEY</code>, <code>SKILL_SCANNER_LLM_PROVIDER</code>, <code>SKILL_SCANNER_LLM_MODEL</code>, <code>SKILL_SCANNER_LLM_BASE_URL</code>, <code>SKILL_SCANNER_LLM_USER</code>, <code>SKILL_SCANNER_LLM_API_VERSION</code>, <code>SKILL_SCANNER_LLM_FORCE_JSON_OBJECT</code>, <code>SKILL_SCANNER_META_LLM_API_KEY</code>, <code>SKILL_SCANNER_META_LLM_MODEL</code>, <code>SKILL_SCANNER_META_LLM_BASE_URL</code>, <code>SKILL_SCANNER_META_LLM_API_VERSION</code>, <code>AWS_PROFILE</code>, <code>AWS_REGION</code>, <code>GOOGLE_APPLICATION_CREDENTIALS</code>, <code>VIRUSTOTAL_API_KEY</code>, <code>AI_DEFENSE_API_KEY</code>, <code>AI_DEFENSE_API_URL</code>.</details> | `uv pip install cisco-ai-skill-scanner` |
2929
| `clawscan-static` | ClawScan Static | [repo](https://github.com/openclaw/clawscan) | Built-in deterministic text scanner for high-signal risky skill patterns. | none | skipped; built in |
3030
| `skillspector` | NVIDIA SkillSpector | [repo](https://github.com/NVIDIA/skillspector) | Local file or directory scanner. Uses LLM mode when provider env vars are set; otherwise runs with `--no-llm`. | none<br><details><summary>Optional config</summary><code>SKILLSPECTOR_PROVIDER</code>, <code>SKILLSPECTOR_MODEL</code>, <code>SKILLSPECTOR_MODEL_REGISTRY</code>, <code>SKILLSPECTOR_LOG_LEVEL</code>, <code>SKILLSPECTOR_SSL_VERIFY</code>, <code>NVIDIA_INFERENCE_KEY</code>, <code>OPENAI_API_KEY</code>, <code>OPENAI_BASE_URL</code>, <code>ANTHROPIC_API_KEY</code>, <code>ANTHROPIC_PROXY_ENDPOINT_URL</code>, <code>ANTHROPIC_PROXY_API_KEY</code>, <code>ANTHROPIC_PROXY_API_VERSION</code>.</details> | `uv tool install git+https://github.com/NVIDIA/skillspector.git` |
3131
| `snyk` | Snyk Agent Scan | [repo](https://github.com/snyk/agent-scan) | Local skill scanner invoked through `uvx snyk-agent-scan`. | `SNYK_TOKEN` | verifies `uvx` launcher |
3232
| `socket` | Socket CLI | [repo](https://github.com/SocketDev/socket-cli) | Local file or directory scanner using Socket's public CLI full-scan path. | `SOCKET_CLI_API_TOKEN` | `npm install -g socket` |
3333
| `virustotal` | VirusTotal API | [docs](https://docs.virustotal.com/reference/file) | API-backed single local file hash lookup. Directories return a skipped result. | `VIRUSTOTAL_API_KEY` | skipped; API-backed |
34+
35+
### AIG migration
36+
37+
Starting in `v0.1.2`, the built-in `aig` scanner uses Tencent's local
38+
`aig-skill-scan` package instead of the legacy A.I.G Docker/API service.
39+
Replace `AIG_MODEL` with `DEFAULT_MODEL`, `AIG_MODEL_BASE_URL` with
40+
`DEFAULT_BASE_URL`, and `AIG_MODEL_API_KEY` with `LLM_API_KEY` (or
41+
`OPENAI_API_KEY`). `AIG_BASE_URL` and `AIG_API_KEY` are no longer used.
42+
43+
The local scanner accepts directory targets only. Materialize URL or file inputs
44+
as a skill directory before scanning them with `aig`.

0 commit comments

Comments
 (0)