Skip to main content

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.

Sample agent-guard PR comment showing risk score, severity tally, and grouped findings

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-scan because agent-guard was already taken by an unrelated project. The CLI command and GitHub Action are still named agent-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

ag_scan-0.1.4.tar.gz (193.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ag_scan-0.1.4-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file ag_scan-0.1.4.tar.gz.

File metadata

  • Download URL: ag_scan-0.1.4.tar.gz
  • Upload date:
  • Size: 193.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ag_scan-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8e461ab4d5aaa96419633c23f2795d3d139830fcd5ba7f2f7d2ebedf0e3aa62c
MD5 b0157177b9a8ec80ae8d60e4dacd75c7
BLAKE2b-256 0ff0dc3e0825b952d76939a850cae43e5adc189be5319ccee9ff990b6cc8840c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ag_scan-0.1.4.tar.gz:

Publisher: release.yml on tasnuvaleeya/agent-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ag_scan-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ag_scan-0.1.4-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

Hashes for ag_scan-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ad9bc6cee0ad0d62c3fd9fd3d5dab8dd1d2a0786c0247357174589e873e845
MD5 b3ef69314aa64e8a821fef1598e601f1
BLAKE2b-256 cde40fa960efdfd74b954375716468b08226ed8bd6a79b4945cd9542997c54a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ag_scan-0.1.4-py3-none-any.whl:

Publisher: release.yml on tasnuvaleeya/agent-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page