Governance enforcement for AI agents - Prevent cost explosions, ensure safety measures, and enforce access control before deployment.
Project description
release-gate
๐ช Governance enforcement for AI agents โ Prevent cost explosions, ensure safety measures, and enforce access control before deployment.
The Problem It Solves
Your AI agent costs you $50,000 in a single day. No warning. No limit. No questions.
This happens because:
- โ No cost limits are set
- โ No one validates agent configuration
- โ Request volumes spiral unexpectedly
- โ Token usage balloons with complex prompts
- โ One retry loop = 10x cost multiplier
release-gate stops this before it happens.
What It Does (The 4 Checks)
release-gate sits between testing and deployment, validating agents against 4 critical checks:
๐ฏ PRIMARY CHECK: ACTION_BUDGET (NEW v0.3)
Prevents cost explosions โ The hero feature that stops $50K mistakes.
checks:
action_budget:
enabled: true
max_daily_cost: 100 # Sets the limit
What happens:
Agent estimated to cost $250/day
Budget set to $100/day
Status: โ FAIL - Deployment blocked
Remediation:
Option 1: Use cheaper model (gpt-4-turbo saves 70%)
Option 2: Reduce daily request volume
Option 3: Increase budget to $250/day
Cost Calculation (Full Transparency):
Model: GPT-4-Turbo
Daily requests: 500
Input tokens/request: 800
Output tokens/request: 400
Estimated daily cost: $12.50
Monthly cost: $375.00
Safety margin: 8x (well under $100 budget)
Status: โ
PASS
Supporting Checks (Existing v0.2)
๐ INPUT_CONTRACT
Ensures request schemas are defined and tested.
- โ Schema explicitly defined
- โ Valid inputs pass validation
- โ Invalid inputs fail validation
- Prevents input-based failures
โน FALLBACK_DECLARED
Ensures agent can be stopped if something goes wrong.
- โ Kill switch defined (feature flag)
- โ Fallback mode exists (escalate to human)
- โ Team ownership clear
- โ Runbook provided
๐ IDENTITY_BOUNDARY
Enforces access control and rate limiting.
- โ Authentication required
- โ Rate limits configured
- โ Data isolation defined
- Prevents unauthorized access
Quick Start (5 Minutes)
1. Install
pip install release-gate
2. Create governance.yaml
project:
name: my-agent
agent:
model: gpt-4-turbo
daily_requests: 500
avg_input_tokens: 800
avg_output_tokens: 400
retry_rate: 1.1
checks:
action_budget:
enabled: true
max_daily_cost: 100
3. Run Validation
release-gate check --config governance.yaml
4. See Decision
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ช release-gate: All 4 Checks โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
๐ฐ ACTION_BUDGET: โ PASS
Daily Cost: $12.50
Budget: $100.00
Safety Margin: 8.0x
๐ INPUT_CONTRACT: โ PASS
Schema defined
โน FALLBACK_DECLARED: โ PASS
Kill switch configured
๐ IDENTITY_BOUNDARY: โ PASS
Authentication required
โ
FINAL DECISION: PASS (Safe to deploy)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Real-World Example: The $50K Mistake
Scenario
You deploy a customer support agent without checking costs:
agent:
model: gpt-4 # Expensive model
daily_requests: 5000 # High volume
avg_input_tokens: 2000 # Long context
avg_output_tokens: 1000
Without release-gate:
Day 1: Agent costs $250
Day 2: No one notices
Day 3: Cost spike warning
...
Week 2: You've spent $50,000
With release-gate:
$ release-gate check --config governance.yaml
โ FAIL - Cost Control: Budget Exceeded
Daily cost: $250.00
Budget: $100.00
Daily overage: $150.00
Monthly overage: $4,500.00
โ BLOCKED: Cannot deploy without fixing cost configuration
Remediation Options:
Option 1: Use gpt-4-turbo (3.3x cheaper)
New cost: $75.88/day โ PASS โ
Option 2: Reduce daily requests to 1000
New cost: $50/day โ PASS โ
Option 3: Increase budget to $250/day
Then re-run validation
Result: Deployment blocked. Problem caught before it costs you $50K.
Key Features
๐ฐ ACTION_BUDGET: Cost Control (v0.3 New)
Automatic Cost Estimation
# Reads agent config
agent:
model: gpt-4-turbo
daily_requests: 500
avg_input_tokens: 800
avg_output_tokens: 400
retry_rate: 1.1
# Automatically calculates:
# Input cost: $0.00001 ร 800 รท 1000 ร 500 ร 1.1 = $4.40/day
# Output cost: $0.00003 ร 400 รท 1000 ร 500 ร 1.1 = $6.60/day
# Total: $11.00/day
Smart Thresholds
checks:
action_budget:
max_daily_cost: 100
auto_approve_threshold: 10 # < $10 = instant PASS
manual_approval_threshold: 50 # $10-$50 = needs review
# $50+ = approval routing
Approval Routing (Future)
approval_routes:
- type: slack
channel: "#ai-governance"
mentions: ["@platform-leads"]
- type: email
to: ["ai-team@company.com"]
cc: ["security@company.com"]
๐ Dynamic Pricing
No Hardcoding
# Instead of hardcoded enums:
# - Supports ANY model (past, present, future)
# - Auto-detects from code
# - User-extensible via JSON
Auto-Detection
# Code:
client = OpenAI(model="gpt-4o")
response = client.chat.completions.create(model="gpt-4o")
# release-gate automatically detects: gpt-4o
# Looks up pricing
# Estimates cost
# All automatic
Custom Models
{
"models": {
"my-internal-llama": {
"input": 0.0001,
"output": 0.0002,
"provider": "Internal"
}
}
}
Add a custom model. No code changes. Instant support.
Installation
Via pip
pip install release-gate
From source
git clone https://github.com/VamsiSudhakaran1/release-gate.git
cd release-gate
pip install -e .
Requirements
- Python 3.8+
- PyYAML >= 6.0
- jsonschema >= 4.0
Configuration
Minimal (Cost Control Only)
project:
name: my-agent
agent:
model: gpt-4-turbo
daily_requests: 100
avg_input_tokens: 500
avg_output_tokens: 300
checks:
action_budget:
enabled: true
max_daily_cost: 50
Complete (All 4 Checks)
project:
name: customer-support-agent
version: 1.0.0
agent:
model: gpt-4-turbo
daily_requests: 500
avg_input_tokens: 800
avg_output_tokens: 400
retry_rate: 1.1
checks:
action_budget:
enabled: true
max_daily_cost: 100
auto_approve_threshold: 10
manual_approval_threshold: 50
input_contract:
enabled: true
schema:
type: object
required: [user_query]
properties:
user_query:
type: string
fallback_declared:
enabled: true
kill_switch:
type: feature_flag
name: disable_agent
fallback:
mode: escalate_to_human
ownership:
team: support-team
oncall: "oncall@company.com"
identity_boundary:
enabled: true
authentication: required
rate_limit: 10
data_isolation:
- customer_data_only
Usage
Command Line
# Simple validation
release-gate check --config governance.yaml
# JSON output (for CI/CD)
release-gate check --config governance.yaml --output json
# YAML output (save to repo)
release-gate check --config governance.yaml --output yaml > audit.yaml
GitHub Actions
name: Governance Gate
on: [pull_request, push]
jobs:
governance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: pip install release-gate
- run: release-gate check --config governance.yaml
Python API
from release_gate.checks.action_budget import ActionBudgetCheck
import yaml
with open('governance.yaml') as f:
config = yaml.safe_load(f)
check = ActionBudgetCheck()
result = check.evaluate(config)
if result['status'] == 'PASS':
print("โ
Safe to deploy")
else:
print("โ Fix cost configuration")
for step in result.get('remediation_steps', []):
print(f" - {step}")
Exit Codes
- 0 = PASS (all checks passed, safe to deploy)
- 10 = WARN (manual review recommended)
- 1 = FAIL (deployment blocked, fix issues)
Perfect for CI/CD pipelines.
Roadmap
v0.3 (Current) โ
- ACTION_BUDGET check (cost control)
- Dynamic pricing system
- Auto-model detection
- Custom model support
- All 4 checks working together
v0.4 (Planned)
- GitHub Actions marketplace integration
- Web dashboard
- Advanced approval workflows
- Enterprise SSO/RBAC
v1.0 (Vision)
- Real-time pricing API integration
- Advanced policy templates
- Multi-agent governance
- Analytics & reporting
Supported Models
OpenAI
- GPT-4
- GPT-4 Turbo
- GPT-4o
Anthropic
- Claude 3 Opus
- Claude 3 Sonnet
- Claude 3.5 Sonnet
Open Source
- Llama 70B
- Mistral Large
Custom
- Any model (add to pricing.json)
Examples
See examples/ directory:
governance-simple.yaml- Minimal setupgovernance-complete.yaml- Full setuppricing.json- All supported modelstest_action_budget.py- Test suite
Architecture
4 Independent Checks
Each check validates independently:
- ACTION_BUDGET validates cost
- INPUT_CONTRACT validates schema
- FALLBACK_DECLARED validates safety
- IDENTITY_BOUNDARY validates access
No cross-dependencies. Easy to extend.
Decision Logic
If ANY check FAILS โ FAIL (deployment blocked)
Else if ANY check WARNS โ WARN (manual review)
Else โ PASS (all good)
All 4 checks are equal partners in the decision.
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
Support
- ๐ Documentation
- ๐ Issues
- ๐ฌ Discussions
- ๐ Website
License
MIT โ See LICENSE for details.
The Vision
Every AI agent should have cost limits, safety measures, and access controls before deployment.
release-gate makes this simple, automatic, and transparent.
Prevent cost explosions. Enforce governance. Deploy with confidence. ๐
Built by Vamsi โข release-gate.com
Project details
Release history Release notifications | RSS feed
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 release_gate-0.3.1.tar.gz.
File metadata
- Download URL: release_gate-0.3.1.tar.gz
- Upload date:
- Size: 91.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e46dacf4db809d29b63c3c66314a49ae7390e95c3e9eb7db51fbbd71696717ea
|
|
| MD5 |
163868acb7430bf1fa186449a7cdec7d
|
|
| BLAKE2b-256 |
e98ca1f0947c81ade38feabe40e498508dfdf2e8a4bcc454006f38c4b87db46c
|
File details
Details for the file release_gate-0.3.1-py3-none-any.whl.
File metadata
- Download URL: release_gate-0.3.1-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
340fdc3f91ecacfec9c87066c113f0657b409d552d501dc46f38f48369cb84d6
|
|
| MD5 |
61b37777d21dbcbfc550fde842cf7808
|
|
| BLAKE2b-256 |
d2b3c83b871dc7df19d543732af33b8ab3335347be69386032ca7a140213dcf6
|