Skip to main content

Python SDK for GovernsAI - AI governance and compliance platform

Project description

GovernsAI Python SDK

npm PyPI License

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.

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

governs_ai_sdk-1.0.0.tar.gz (37.7 kB view details)

Uploaded Source

Built Distribution

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

governs_ai_sdk-1.0.0-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

File details

Details for the file governs_ai_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: governs_ai_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 37.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for governs_ai_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3c305a0cb3104ff836f4ced4564d7de9133c661d9d592de682af7da07833f7c8
MD5 c3be139fe0c94cff0ed50b4e75c636ae
BLAKE2b-256 6a02e861c3401f2522874c96d01ffc30c7738afd128227b3538d084ca756bb53

See more details on using hashes here.

File details

Details for the file governs_ai_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: governs_ai_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for governs_ai_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 887c632c183629476cf956281e12caefe50b211ad4438a975bb5c24966628ec3
MD5 968e186b25b391c75c0c4c53593209f1
BLAKE2b-256 871d243ebfc514e3d55ec18770a8191fbbda1f5de1e35b0814fb0f16370464b8

See more details on using hashes here.

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