/security-engineering:banned-api-auditfrom security-engineering
Scans source code for banned or forbidden APIs against a project banlist, reporting violations with file paths, line numbers, and recommended replacements. Supports multiple languages, SARIF output, and CI integration.
Ships in security-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are the Banned API Auditor — scan source code for prohibited functions and APIs declared in the project banlist, report violations with full context, and exit with a CI-suitable status code.
"Eliminate CVE classes by construction." Banning a dangerous API is cheaper than vigilance. The audit makes the ban enforceable: every CI run rejects any new occurrence; existing violations are tracked until remediated or explicitly excepted.
--starter <language> (optional)Use a bundled starter banlist instead of (or in addition to) the project banlist. Useful for a first-time audit before the project has its own banned-apis.yaml. Valid: c, cpp, python, node, go, rust.
--fail-on-violation (optional)Exit non-zero when ANY violation is found. Default: exit 0 always (report-only mode for first runs and migration audits).
--paths <glob>... (optional)Limit the scan to these paths. Overrides paths: declarations in the banlist. Useful for scoped PR audits.
--format text|json|both|sarif (default both)text to stdout, json to .aiwg/security/banned-api-audit/, or both.
--sarif (optional)Also emit SARIF 2.1.0 to .aiwg/security/banned-api-audit/ for code-scanning ingest.
Look for .aiwg/security/banned-apis.yaml.
If --starter <lang> is set, merge the bundled starter into the active banlist (project banlist wins on pattern conflict).
If neither exists, emit a guided message:
No banlist found. Bootstrap with:
aiwg run skill banned-api-audit -- --starter c
Or seed your own at .aiwg/security/banned-apis.yaml
Default exclusions (always applied unless --paths overrides):
test/**, tests/**, **/*_test.*, **/*.test.*vendor/**, node_modules/**, target/**, dist/**, build/**.git/**, .aiwg/**, .claude/**, .codex/**, .factory/**Project banlist paths: declarations narrow further (e.g., src/** only).
For each (language, pattern) pair:
# Word-boundary literal pattern
rg -n --type <lang> -w '<pattern>' <paths>
# Regex pattern (when prefixed re:)
rg -n --type <lang> '<regex>' <paths>
Language → ripgrep --type mapping:
c → ccpp → cpppython → pynode → js,ts,tsx,jsxgo → gorust → rustFor each candidate violation, check the source line and the preceding 2 lines for:
AIWG-allow:banned-apis reason="..."
When present, classify as excepted (not a violation). Record the reason in the report so security reviewers can grep all exceptions periodically.
Text report format:
Banned API Audit — 2026-05-21T17:30:00Z
Banlist: .aiwg/security/banned-apis.yaml (24 patterns across 3 languages)
Paths: src/, lib/
Excluded: test/, tests/, vendor/, node_modules/
VIOLATIONS (3)
src/auth/token.c:42: strcpy(buf, user_input);
pattern: strcpy (language: c)
reason: Unbounded copy — buffer overflow vector
replacement: strncpy_s, strlcpy, or snprintf with bounds
src/parser/json.c:118: sprintf(out, "%s/%s", base, path);
pattern: sprintf (language: c)
reason: Unbounded format expansion — overflow + format-string risk
replacement: snprintf with explicit buffer size
src/util/legacy.py:7: user = pickle.loads(payload)
pattern: re:pickle\.loads?\b (language: python)
reason: Arbitrary code execution on untrusted input
replacement: json, msgpack, or signed pickle with integrity check
EXCEPTIONS (1)
src/compat/curses_wrapper.c:33: char *tok = strtok(buf, " ");
pattern: strtok
reason: curses interop requires strtok per legacy API contract
SUMMARY
Violations: 3
Exceptions: 1
Patterns: 24
Files scanned: 184
JSON report (machine-readable, suitable for SARIF conversion or CI dashboard ingest):
{
"schemaVersion": "1",
"auditedAt": "2026-05-21T17:30:00Z",
"banlistPath": ".aiwg/security/banned-apis.yaml",
"patterns": 24,
"filesScanned": 184,
"violations": [
{
"file": "src/auth/token.c",
"line": 42,
"column": 5,
"match": "strcpy(buf, user_input);",
"pattern": "strcpy",
"language": "c",
"reason": "Unbounded copy — buffer overflow vector",
"replacement": "strncpy_s, strlcpy, or snprintf with bounds",
"severity": "HIGH"
}
],
"exceptions": [ /* same shape, plus exceptionReason */ ]
}
0 — no violations, OR violations present but --fail-on-violation not set1 — banlist missing AND no --starter flag2 — violations present AND --fail-on-violation set3 — ripgrep not installed or other tooling failureGitea Actions:
- name: Banned-API audit
run: aiwg run skill banned-api-audit -- --fail-on-violation
GitHub Actions:
- name: Banned-API audit
run: aiwg run skill banned-api-audit -- --fail-on-violation
Bundled at banlists/:
c.yaml — C dangerous functions (strcpy, sprintf, gets, strtok, atoi)cpp.yaml — C++ overlay (auto_ptr, gets, strcpy)python.yaml — eval, exec, pickle.loads, subprocess shell=Truenode.yaml — eval, new Function, child_process.execgo.yaml — shell-string commands, weak hashes, HTML templating footgunsrust.yaml — unsafe/transmute/unwrap review gates, shell-string commandsUsers seed their project banlist via --starter <lang> and customize.
The CRITICAL applied-cryptography rules (no-unauthenticated-encryption, no-adhoc-kdf, no-key-reuse-across-purposes) are enforced separately by their own audit paths. This skill does not replace them; it complements them with HIGH-severity language-level policy.
Cycle 2 adds:
scripts/audit.sh / scripts/audit.mjs reference implementation.schema.json documenting the banlist YAML shape.0 clean/report-only, 1 banlist/schema problem, 2 violations with --fail-on-violation, 3 tooling failure..aiwg/security/curl-checklist-gap-analysis.md row 2 — Audit contextbanlists/c.yaml (opens in a new tab)banlists/cpp.yaml (opens in a new tab)banlists/go.yaml (opens in a new tab)banlists/node.yaml (opens in a new tab)banlists/python.yaml (opens in a new tab)banlists/rust.yaml (opens in a new tab)schema.json (opens in a new tab)scripts/audit.mjs (opens in a new tab)scripts/audit.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
banned-apis, security-audit, code-scanning, banlist, ci-integration
28 skills in this plugin
/auth-factor-designDecision aid for authentication factor architecture — have/know/are mapping, coercion resistance, FIDO2 PIN/UV policy, and PRF hot-path anti-patterns./binary-blob-auditScan tracked repository files for committed binary blobs and report reviewability/provenance exceptions/bun-release-age-gateConfigure Bun's install.minimumReleaseAge gate (7-day default, 10-day high-sensitivity) for JavaScript projects on Bun. Includes Corepack-equivalent version detection and lockfile-caveat warning./cargo-supply-chain-auditAudit Rust/Cargo crates for supply-chain exposure: crates.io metadata + checksum verification against Cargo.lock, .crate tarball hash and .cargo_vcs_info.json provenance, previous-vs-patched .crate source diff, Cargo.toml dependency + build-script review, cargo audit / cargo deny / cargo vet trust policy, and publisher / trusted-publishing / yank / release-anomaly checks./chain-of-trust-designDecision aid for bootstrap and verification chains — forces the 'what authenticates the authenticator' question; patterns for signed bootstrap, measured boot, recovery./ci-workflow-auditAudit CI workflow files for supply-chain risk — unpinned actions, unpinned container images, pull_request-triggered jobs with secret access, curl-pipe-shell installers, and bare :latest tags. Produces a structured markdown report with file:line refs.npx claudepluginhub jmagly/aiwg --plugin security-engineeringOther plugins' skills for the same job