agent-guard
CI/CD safety and risk analysis for AI-assisted coding workflows (Claude Code, Codex, Cursor, Copilot, …).
agent-guard scans pull request diffs for the patterns that AI coding assistants tend to slip into your repo: hallucinated imports, dangerous calls, missing tests, infra/auth changes, and leaked secrets. It runs deterministically (no LLM required), in <10s on typical diffs, and posts a single sticky comment on your PR.
Status
Milestone 1 — MVP. Python only for hallucinated-import detection; all other analyzers are language-agnostic. See features/agent-guard-feature-plan.md for the full roadmap.
For the full reference — every CLI flag, every rule, every config key, CI recipes, troubleshooting, and FAQ — see docs/USER_MANUAL.md.
Quickstart
As a GitHub Action
# .github/workflows/agent-guard.yml
name: agent-guard
on: pull_request
permissions:
contents: read
pull-requests: write
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tasnuvaleeya/agent-guard@v0.1
Locally
pip install ag-scan # PyPI distribution name
git diff main...HEAD | agent-guard scan --format md
Note: the PyPI distribution name is
ag-scanbecauseagent-guardwas already taken by an unrelated project. The CLI command and GitHub Action are still namedagent-guard.
What it flags
| Analyzer | Detects |
|---|---|
secrets |
AWS, GCP, Slack, GitHub PAT, OpenAI/Anthropic API keys, high-entropy strings in .env* |
hallucinated_imports |
Python imports not in stdlib, requirements.txt, pyproject.toml, or local modules |
dangerous_patterns |
eval, exec, shell=True, pickle.loads, yaml.load w/o SafeLoader, verify=False, 0.0.0.0 binds |
missing_tests |
Source-file changes without corresponding test changes |
infra_changes |
Edits to .github/workflows, Dockerfiles, Terraform, k8s manifests, .env* |
Each finding gets a severity (low/medium/high/critical); the report includes an aggregate risk score (0–100).
Configuration
Drop a .agent-guard.yml in your repo root. All keys are optional.
analyzers:
secrets: { enabled: true }
missing_tests: { enabled: true, min_added_lines: 30 }
fail_above: 60
exclude:
- "vendor/**"
- "**/*.generated.py"
Development
pip install -e ".[dev]"
pytest
ruff check .
mypy src
License
Apache-2.0
Release files for ag-scan 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ag_scan-0.1.5.tar.gz | 193.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ag_scan-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 218.1 kB
Release files / ag_scan-0.1.5.tar.gz
| Download URL | ag_scan-0.1.5.tar.gz |
|---|---|
| Size | 193.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ad2d79656a038dfb89bda5acbc1c856f13abc5392dfa276e46f435cd82b99fc
|
|
BLAKE2b-256 checksum How to use checksums |
99f0863af40d5d02c7ed1f94a2b29d6bccd6e6c2563fea8a83b03ed1fb71cc23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 26, 2026.
Transparency logRelease files / ag_scan-0.1.5-py3-none-any.whl
| Download URL | ag_scan-0.1.5-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c9cade22b9497789172eef83f51232a745c78e3e9e92961a0ca18064e931ea0
|
|
BLAKE2b-256 checksum How to use checksums |
5bdce486d91376e712b7e0cea435c846fb9a88c6ae82f232d7e4da99e6fbc622
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 26, 2026.
Transparency log