Observed since 21 Oct, 10:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Run Bandit and Semgrep, normalize findings, and produce deterministic security audit reports.
ai-code-sec-audit is a lightweight Python package and CLI that runs Bandit and Semgrep,
normalizes findings into a stable JSON schema, computes a deterministic score, and writes a
reproducible report.
pip install ai-code-sec-audit
ai-code-sec-audit audit path/to/file.py -o report.json
ai-code-sec-audit audit path/to/dir -o report.json -f high
Options use short flags:
-o: output JSON path (required)-p: profile (default: default)-f: fail threshold (critical|high|medium|low|info)-P: pretty-print JSONfrom ai_code_sec_audit import audit_path
report = audit_path("path/to/file.py", profile="default", fail_on="high")
print(report.summary.score)
Canonical JSON report fields:
meta: tool_version, timestamp, target, profile, how_to_reproducesummary: score, total_findings, counts, should_failfindings[]: tool, rule_id, title, description, severity, confidence, cwe, file,
start_line, end_line, fingerprint, referencesmeta.how_to_reproduce contains the exact command with resolved target/output paths and selected
flags to reproduce the same report.
{
"meta": {
"tool_version": "0.1.0",
"target": "/abs/path/examples/vuln_python/app.py",
"profile": "default",
"how_to_reproduce": "ai-code-sec-audit audit /abs/path/examples/vuln_python/app.py -o /abs/path/report.json -p default"
},
"summary": {
"score": 86,
"total_findings": 2,
"counts": {
"critical": 0,
"high": 1,
"medium": 1,
"low": 0,
"info": 0
},
"should_fail": true
}
}
Score starts at 100 and deducts:
2010410Final score is clamped to 0..100.
critical: fail if any critical findingshigh: fail if any critical/highmedium: fail if any critical/high/mediumlow: fail if any critical/high/medium/lowinfo: fail if any finding existsCLI exits with status code 2 when threshold is met.
bandit -r <target> -f jsonbandit <target> -f jsonsemgrep --config auto --json <target>This repository includes sample-run inputs and outputs:
examples/vuln_python/app.pyexamples/safe_python/app.pyexamples/sample_runs/run_samples.shexamples/sample_runs/vuln_run.txt, examples/sample_runs/safe_run.txtexamples/sample_runs/vuln_report.json, examples/sample_runs/safe_report.jsonRun from repo root:
./examples/sample_runs/run_samples.sh
This project is now configured for PyPI publishing with:
pyproject.tomlsdist + wheel builds via hatchling.github/workflows/publish.yml that uploads on releaseai-code-sec-audit..github/workflows/publish.yml.project.urls in pyproject.toml if your repository URL differs.src/ai_code_sec_audit/version.py.python -m pip install --upgrade build twine
python -m build
twine check dist/*
twine upload dist/*
ruff check .
ruff format .
mypy src
pytest
python -m build
twine check dist/*
MIT.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 14 Feb 2026 | 6 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 10:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:b28f5e43d0f209c263cac41a268b10859786ac9cb827e663c8ec2f0b100446fb