Prevent surprise $5,000 LLM API bills and leaked keys before merge.
Try the live interactive demo on Hugging Face Spaces: 👉 https://huggingface.co/spaces/snsnshnwh/ai-pr-cost-guard
Run directly against your repo or staged git changes with uvx — no installation required:
# Scan a directory or file uvx ai-pr-cost-guard ./src # Scan staged git changes before committing uvx ai-pr-cost-guard --git-diff --format text # Emit a Markdown summary report uvx ai-pr-cost-guard --git-diff --markdown GitHub Action Drop this 6-line GitHub Action into any repository using OpenAI, Anthropic, or Gemini SDKs:
name: AI Cost Guard on: [pull_request] jobs: cost-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: andrejpimenov122-lab444/ai-pr-cost-guard@v1 Pre-commit Hook Add to .pre-commit-config.yaml to scan staged Python, TypeScript, and JavaScript files:
repos: - repo: https://github.com/andrejpimenov122-lab444/ai-pr-cost-guard rev: v0.2.1 hooks: - id: ai-pr-cost-guard What It Catches COST-001 (HIGH): Exposed OpenAI, Anthropic, and Google Gemini API keys (redacted; including .env and .ipynb outputs). COST-002 (HIGH): LLM SDK calls inside unbounded while/for loops or unbounded retry decorators. COST-003 (MEDIUM): Endpoint-aware missing, invalid, or policy-exceeding output token caps (max_tokens / max_output_tokens). COST-004 (LOW): Missing finite timeout on SDK client or per-request calls. Local CLI Usage python3 cost_guard.py ./src License MIT
llm finops openai anthropic gemini static-analysis ast pre-commit cost-guard
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 21, 2026 2 release files No provenance




