CI/CD safety and risk analysis for AI-assisted coding workflows.
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ag_scan-0.1.2.tar.gz.
File metadata
- Download URL: ag_scan-0.1.2.tar.gz
- Upload date:
- Size: 193.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e431879799aea0758f25d6b3d835205382a9a31c8dbee8ac96c3440d1e3161ff
|
|
| MD5 |
6b944088cf4a0564c6092ac90c291d75
|
|
| BLAKE2b-256 |
a409afdb0ab051085ade1fe6b4ea8bd4c38ac108d8d11855ce63907697ff941b
|
Provenance
The following attestation bundles were made for ag_scan-0.1.2.tar.gz:
Publisher:
release.yml on tasnuvaleeya/agent-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ag_scan-0.1.2.tar.gz -
Subject digest:
e431879799aea0758f25d6b3d835205382a9a31c8dbee8ac96c3440d1e3161ff - Sigstore transparency entry: 1633000293
- Sigstore integration time:
-
Permalink:
tasnuvaleeya/agent-guard@fc141aecaf175e3639762f9690141541ca746fce -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/tasnuvaleeya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc141aecaf175e3639762f9690141541ca746fce -
Trigger Event:
push
-
Statement type:
File details
Details for the file ag_scan-0.1.2-py3-none-any.whl.
File metadata
- Download URL: ag_scan-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f38458b12bd15fe3673145e867f9ba0e6fd03136bb29e9c252d8944df5add349
|
|
| MD5 |
f5d99e3df247fc7c0ec5e9f994d378c2
|
|
| BLAKE2b-256 |
827ad26c293c8b9efd793dacf7a45fdfafbb5f87dd3201bbef3d80263cd26805
|
Provenance
The following attestation bundles were made for ag_scan-0.1.2-py3-none-any.whl:
Publisher:
release.yml on tasnuvaleeya/agent-guard
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ag_scan-0.1.2-py3-none-any.whl -
Subject digest:
f38458b12bd15fe3673145e867f9ba0e6fd03136bb29e9c252d8944df5add349 - Sigstore transparency entry: 1633000308
- Sigstore integration time:
-
Permalink:
tasnuvaleeya/agent-guard@fc141aecaf175e3639762f9690141541ca746fce -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/tasnuvaleeya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@fc141aecaf175e3639762f9690141541ca746fce -
Trigger Event:
push
-
Statement type: