Skip to main content

maigp-openai

AIGP governance for direct OpenAI Chat Completions calls.

Part of MAIGP — the Mediated AI Governance Protocol: a runtime consent / scope / evidence layer for AI systems. Every governed call is CHECKed before it runs (policy, scope, jurisdiction, circuit-breaker) and RECORDed + TRACEd as tamper-evident evidence after.

What it governs

Governs raw openai client calls (Chat Completions API).

Governance model

This adapter maps the framework's lifecycle onto the AIGP agent-governance loop provided by maigp-agent-core:

Framework event AIGP action
run / invocation start CHECK (pre_invoke) — allowed? under what authority?
each model reply token accounting (on_model_call)
each tool / function call tool governance (on_tool_call)
run complete RECORD + TRACE (post_invoke)
failure on_error (recorded, then re-raised)

Install

pip install maigp-openai

Pulls in maigp-agent-core (shared lifecycle) and, transitively, maigp-client.

Quick start

from openai import OpenAI
from aigp_openai import GovernedOpenAI

governed = GovernedOpenAI(client=OpenAI(),
                          gov_url="https://gov.example.com",
                          app_id="my-openai-app", hmac_secret="secret")
response = governed.chat("gpt-4o", [{"role": "user", "content": "Hello"}])

Raw API vs agent loop

This wraps single Chat Completions calls. To govern the OpenAI Agents SDK agent loop (Runner, tools, handoffs), use maigp-openai-agents.

Links


License: Proprietary. © Kanjani AI Research & Causum.

Metadata

Release files for maigp-openai 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maigp-openai 1.0.1
File Size Uploaded
maigp_openai-1.0.1.tar.gz 2.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for maigp-openai 1.0.1
File Interpreter ABI Platform
maigp_openai-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.2 kB

Release files / maigp_openai-1.0.1.tar.gz

Download URL maigp_openai-1.0.1.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c3a75bc1266121a88e80ad6cb5b8ad098809f519d0fb3509a63634eeb6a577f5
BLAKE2b-256 checksum
How to use checksums
9e44a5763aa537ff6cbbedbffdeae963a5c1779ed40721514198b0dec82d5f87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / maigp_openai-1.0.1-py3-none-any.whl

Download URL maigp_openai-1.0.1-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ec951246ff96dabf72249cc84932bea2aba970f139a3220c5decf14620c2d22
BLAKE2b-256 checksum
How to use checksums
e838f59ebb357cc2c5b1e396c1d749e516e3913b2c4a280214228214bc6c0c04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page