GovernsAI Python SDK
A comprehensive Python SDK for integrating AI governance capabilities into your applications. Provides secure control over AI interactions, budget management, policy enforcement, and compliance monitoring.
Features
- Request Prechecking: Validate AI requests against governance policies
- Budget Management: Track and enforce usage budgets
- Confirmation Workflows: WebAuthn-based approval processes
- Tool Management: Register and execute tools with governance
- Analytics: Comprehensive usage and decision analytics
- Multi-User Support: Organization-level context with user-specific operations
Installation
pip install governs-ai-sdk
Quick Start
from governs_ai import GovernsAIClient
# Create client with organization context
client = GovernsAIClient(
api_key="your-api-key",
base_url="https://api.governsai.com",
org_id="org-456" # Organization context (static)
)
# Test connection
is_connected = await client.test_connection()
print(f"Connected: {is_connected}")
# Precheck a request for a specific user (userId is dynamic)
user_id = "user-123"
precheck_response = await client.precheck_request(
tool="model.chat",
scope="net.external",
raw_text="Hello, how are you?",
payload={"messages": [{"role": "user", "content": "Hello"}]},
tags=["demo", "chat"],
user_id=user_id
)
print(f"Decision: {precheck_response.decision}")
if precheck_response.decision == "deny":
print(f"Blocked: {precheck_response.reasons}")
elif precheck_response.decision == "confirm":
print("Confirmation required")
Documentation
For complete documentation, see docs/README.md.
License
MIT License - see LICENSE file for details.
Metadata
Release files for governs-ai-sdk 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| governs_ai_sdk-1.0.0.tar.gz | 37.7 kB | Without provenance | Details for governs_ai_sdk-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| governs_ai_sdk-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for governs_ai_sdk-1.0.0-py3-none-any.whl |
Total release size: 82.0 kB
Release files / governs_ai_sdk-1.0.0.tar.gz
| Download URL | governs_ai_sdk-1.0.0.tar.gz |
|---|---|
| Size | 37.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c305a0cb3104ff836f4ced4564d7de9133c661d9d592de682af7da07833f7c8
|
|
BLAKE2b-256 checksum How to use checksums |
6a02e861c3401f2522874c96d01ffc30c7738afd128227b3538d084ca756bb53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / governs_ai_sdk-1.0.0-py3-none-any.whl
| Download URL | governs_ai_sdk-1.0.0-py3-none-any.whl |
|---|---|
| Size | 44.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
887c632c183629476cf956281e12caefe50b211ad4438a975bb5c24966628ec3
|
|
BLAKE2b-256 checksum How to use checksums |
871d243ebfc514e3d55ec18770a8191fbbda1f5de1e35b0814fb0f16370464b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for governs-ai-sdk 1.0.0
Provenance
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
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.