OpenAI Agents + Grantex

Authorization for OpenAI Agents SDK

Verify scoped Grantex grants before OpenAI Agents SDK tools execute, and add audit recording where required.

The Problem

Without Grantex

Your OpenAI agents operate with full API access. No scoping, no audit trail, no revocation. You can't tell which agent did what or limit what it can do.

With Grantex

Each agent gets a scoped, time-limited JWT. Tools enforce scope checks, optional audit wrappers record calls, and grants remain centrally managed.

How Grantex Works with OpenAI Agents SDK

Install the integration

pip install grantex-openai-agents — wraps OpenAI agent tools with authorization.

Register your agent

Create an agent identity with scopes matching its capabilities.

Get user approval

Obtain a scoped grant through the application's configured authorization and consent flow.

Agent operates with JWT

Configured tool wrappers verify the grant and required scope before executing.

Optional audit trail

Use the audit wrapper to record tool invocations with agent identity, scopes, and timestamps.

Quick Start

pip install grantex-openai-agents grantex
from agents import Agent
from grantex_openai_agents import create_grantex_tool

search = create_grantex_tool(
    name='search',
    description='Search approved sources',
    grant_token=token,
    required_scope='search:read',
    func=search_tool,
)

email = create_grantex_tool(
    name='send_email',
    description='Send an approved email',
    grant_token=token,
    required_scope='email:send',
    func=email_tool,
)

agent = Agent(
    name='assistant',
    tools=[search, email],
)

Why Grantex for OpenAI Agents SDK

OpenAI Agents SDK Integration

Wrap every protected OpenAI Agents SDK tool and handle verification failures explicitly.

Scoped Tool Access

Define which tools each agent can use and with what parameters. Enforced at the protocol level.

Enterprise Audit Support

Use the audit wrapper to record tool calls with agent identity and scope context.

Multi-Agent Pipelines

Parent agents delegate narrower access to sub-agents. Full delegation chain tracking.

Budget Controls

Enforce per-agent spending limits in the trusted service before executing a metered action.

Compliance Support

Optional audit logging plus SCIM and SSO controls for enterprise identity workflows.

Verification, revocation, and audit boundary

This integration enforces authorization only where its wrapper or middleware is installed. Local JWT verification checks signatures and claims after JWKS retrieval; it does not prove current revocation unless the verifier performs an online state check or synchronizes revocation data.

Token verification does not create a consent record or prove that a tool executed. Use the configured authorization flow for grant decisions and add an audit integration at the execution boundary when action records are required.

Ready to secure your OpenAI Agents agents?

Follow the integration guide and verify the package version before deployment. Apache 2.0.