Observed since 21 Oct, 10:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A lightweight Python utility to prevent cloud cost landmines by monitoring and intercepting sudden HTTP request spikes.
A lightweight Python utility designed to prevent cloud cost landmines. It monitors HTTP requests and automatically intercepts and blocks sudden spikes or infinite loop request patterns (e.g., more than 50 calls to the same endpoint in 10 seconds), saving you from unexpected API bills.
urllib, urllib3, requests).HTTP_PROXY.pip install ai-cost-guardrail
Import ai_guardrail at the very beginning of your application entry point to intercept cost landmines:
import ai_guardrail
# Block requests if an endpoint is called more than 30 times in 10 seconds
ai_guardrail.enable(max_calls=30, window_seconds=10)
import requests
# Any HTTP requests made via urllib, urllib3, requests, etc., are now automatically protected!
If a loop triggers, a RuntimeError is raised, blocking the request from hitting the cloud API and saving your budget.
You can run the GuardRail proxy server locally and route any external application traffic through it.
Run via CLI:
ai-cost-guardrail-proxy --port 8090 --max-calls 50 --window 10
Or via Python:
import ai_guardrail
ai_guardrail.run_proxy_server(port=8090)
Then configure your environment variables to use the proxy:
export HTTP_PROXY="http://127.0.0.1:8090"
export HTTPS_PROXY="http://127.0.0.1:8090"
To run unit tests:
python -m unittest discover -s tests
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 29 Jun 2026 | 0 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 10:19 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:0738ebadcfde53343ad02dc17fdf6ca5d24ed5bca750331e6e67187f912c8fb2