Skip to main content

gaas-openai-agents

GaaS (Governance as a Service) integration for the OpenAI Agents SDK.

Every function tool call is governed before it executes: the adapter submits a governance intent to GaaS, and only an APPROVE (or an approved escalation) lets the tool run. A BLOCK verdict raises GovernanceBlockedError out of Runner.run() — the run halts; the error is never converted into text the model can route around.

pip install gaas-openai-agents[openai-agents]

Quickstart

from agents import Agent, Runner, function_tool
from gaas_openai_agents import govern_tools, GaaSGovernanceConfig

@function_tool
def send_email(to: str, subject: str, body: str) -> str:
    """Send an email."""
    ...

config = GaaSGovernanceConfig(api_key="gsk_...", agent_id="my-agent")
agent = Agent(
    name="assistant",
    instructions="You are a helpful assistant.",
    tools=govern_tools([send_email], config=config),
)

result = await Runner.run(agent, "Email the Q3 report to finance@acme.com")

Verdict flow

tool call → GaaS intent → ┌─────────┐
                          │ APPROVE │ → tool executes
                          │ BLOCK   │ → GovernanceBlockedError raised out of Runner.run()
                          │ ESCALATE│ → raises by default; hold-and-poll optional (below)
                          └─────────┘

Only governance blocks halt the run. Errors inside your tool function keep the framework's default behaviour (formatted for the model; the run continues).

Configuration

from gaas_openai_agents import GaaSGovernanceConfig

config = GaaSGovernanceConfig(
    api_url="https://api.gaas.is",    # GaaS API endpoint
    api_key="gsk_...",                # Your API key
    agent_id="my-agent",              # Agent identifier (appears in audit trail)
    block_on_escalate=True,           # Raise GovernanceBlockedError on ESCALATE
    timeout_seconds=5.0,              # Governance check timeout (fail open on timeout)
    sensitivity="INTERNAL",           # Default sensitivity level for tool inputs
    raise_on_governance_error=False,  # Fail open if GaaS API is unreachable
    extra_regulatory_domains=["HIPAA"],   # Additional domains for all intents
    extra_data_categories=["PHI"],        # Additional data categories for all intents
    hold_on_escalate=False,           # Wait for the human decision on ESCALATE
    escalation_poll_seconds=5.0,      # Poll interval while holding
    escalation_max_wait_seconds=600.0,  # Give up (treat as timeout) after this
)

Hold-and-Poll on ESCALATE

With hold_on_escalate=True, an ESCALATE verdict no longer raises immediately. The tool call holds while GaaS routes the escalation to a human reviewer, polling the escalation status until it is decided:

  • approve / modify — the tool executes.
  • deny — raises GovernanceBlockedError with verdict ESCALATE_DENY.
  • timeout — raises GovernanceBlockedError with verdict ESCALATE_TIMEOUT.

hold_on_escalate takes precedence over block_on_escalate. Transient polling errors are retried until the deadline.

Handling blocked runs

from gaas_openai_agents import GovernanceBlockedError

try:
    result = await Runner.run(agent, "wire $250k to the new vendor")
except GovernanceBlockedError as err:
    print(err.verdict)                  # BLOCK / ESCALATE / ESCALATE_DENY / ESCALATE_TIMEOUT
    print(err.decision_id)              # audit reference
    print(err.blocking_policies)        # policy IDs that triggered the block
    print(err.governance_proof_token)   # GPT token ID for the legal audit trail

GovernanceBlockedError subclasses agents.exceptions.AgentsException, so the openai-agents runner propagates it unchanged.

Notes

  • Only FunctionTool instances (e.g. from @function_tool) can be governed. Hosted tools (web search, code interpreter) execute on OpenAI's side and are out of client-side governance reach.
  • Tool metadata (name, description, JSON schema, guardrails, approval config) is preserved by wrapping.
  • Fail-open by default: if the GaaS API is unreachable the tool proceeds. Set raise_on_governance_error=True to fail closed.

Release files for gaas-openai-agents 0.1.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 gaas-openai-agents 0.1.1
File Size Uploaded
gaas_openai_agents-0.1.1.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gaas-openai-agents 0.1.1
File Interpreter ABI Platform
gaas_openai_agents-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / gaas_openai_agents-0.1.1.tar.gz

Download URL gaas_openai_agents-0.1.1.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4d418d5cbc394d691ad5423d8e084c6c839e1dc7ea311a1e19b37d0c7ecc63d0
BLAKE2b-256 checksum
How to use checksums
72f44cf50b6e239fc5f510b6ae793b96b3e58a0dc81e74fd02b2c72539541388
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / gaas_openai_agents-0.1.1-py3-none-any.whl

Download URL gaas_openai_agents-0.1.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bc23d3bc29a08eed8cf4be6da20c91764d594c512a96ad2d72b3fb401e030ce
BLAKE2b-256 checksum
How to use checksums
a309142a56c762109698948ac1e0cd545ff71075f1f9eb0ba10bf00d3c61634b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.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