code-scanner

A lightweight pattern-based security scanner for Bash and Python source code. It returns structured JSON with a verdict, matched findings, severity, evidence, language, and scan details.

In plain words
What is it for?
Use it to scan Bash or Python snippets for security risks and to consume the results programmatically through the scan command.
Why use it?
It provides a quick check for known risky code patterns before scripts are run or shared. Its results distinguish warnings from risks that should block execution.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/alibaba/anolisa/code-scanner
Any agent
npx skills add alibaba/anolisa --skill code-scanner
Clone the repo
git clone --depth 1 https://github.com/alibaba/anolisa

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.00501
Opus 5 $0.00017 $0.00251
Sonnet 5 $0.00007 $0.00100
Haiku 4.5 $0.00003 $0.00050

Measured 2d ago against content hash a9280e7e7598, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-scanner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/agent-sec-core/skills/code-scanner/SKILL.md · 56 lines

What it actually says

Code Scanner

基于正则的轻量级代码安全扫描引擎,支持 Bash 和 Python,内置 25 条检测规则。

调用方式

agent-sec-cli scan-code --code '<source_code>' --language <bash|python>

输入

参数 类型 必选 说明
code string 待扫描的源代码字符串,支持多行
language string 编程语言,取值:bashpython

输出

返回 JSON 格式的 ScanResult 对象:

字段 类型 说明
ok bool 扫描是否正常完成(无内部错误)
verdict string 最终判定,见下方 Verdict 说明
summary string 人类可读的扫描摘要
findings Finding[] 命中的规则列表,无命中时为空数组
language string 输入的语言
engine_version string 与 agent-sec-cli 版本一致
elapsed_ms int 扫描耗时(毫秒)

Finding 结构

字段 类型 说明
rule_id string 规则 ID,如 shell-recursive-delete
severity string 严重级别:warn / deny
desc_zh string 中文描述
desc_en string 英文描述
evidence string[] 匹配到的代码片段列表

Verdict 说明

含义
pass 未检测到安全风险
warn 存在告警级风险,建议关注
deny 存在阻断级风险,应阻止执行
error 扫描引擎内部错误
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 56 lines · 34 tokens per session scan A a9280e7e7598

Subscribe to this mod's changes

code-scanner is a skill published in the GitHub repository alibaba/anolisa (614 stars, last pushed 3d ago), licensed Apache-2.0. It adds 34 tokens to every session and 501 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

beevibe-team-mesh-negotiation

Multi-round negotiation protocol — covers both initiator and peer roles. Use when about to call negotiate(), when receiving a intent block as a peer, or when receiving an 'escalated' sentinel from a blocked respondnegotiate. Covers proposal crafting, counter-strategy, deadlock detection, when to accept early…

beevibe-ai/beevibe · 112 tokens

beevibe-verify-pr

CI verification before marking a PR-bearing task done. Use BEFORE calling mcpbeevibeupdateprogress(done) on any session whose deliverable is a pull request — including the first dispatch (you opened the PR with gh pr create) and any revision dispatch (you pushed new commits to an existing PR). Watches the PR's…

beevibe-ai/beevibe · 172 tokens

beevibe-pre-task-setup

Cold-start git workspace setup for a fresh beevibe task. Use at the start of a session whose intent has a block but NO or block — i.e. the first dispatch of this task. Checks for an existing repo clone, pulls the base branch if present (clone if missing), prunes any per-task worktrees from earlier tasks whose work has…

beevibe-ai/beevibe · 198 tokens

beevibe-use-repo

You are the child agent inside a fresh Docker sandbox. Borrow the given GitHub repo, produce a real artifact for the goal, and export it. Do not review the repo. The proof is that it works.

beevibe-ai/beevibe · 50 tokens

spec-converge

Iteratively review an instar-development spec with multi-angle internal reviewers (security, scalability, adversarial, integration, decision-completeness, lessons-aware) and real cross-model external reviewers routed through the agent's own installed CLIs (codex → GPT-tier, gemini → Gemini-tier; one pass per available…

JKHeadley/instar · 135 tokens

beevibe-discover-repo

Find the best GitHub repo for a goal, then call userepo to run it in a sandbox. Use whenever the user's goal requires a capability you don't have natively and you haven't been given a specific repo.

beevibe-ai/beevibe · 51 tokens