openai-agentlock
AgentLock authorization middleware for the OpenAI Agents SDK.
Wraps FunctionTool instances so every tool call passes through an
AuthorizationGate before the tool body runs. Denials are returned to the
model as plain strings; allowed calls receive a single-use execution token,
optional output transforms, and provenance tracking.
Install
pip install openai-agentlock
Minimal usage
from agents import Agent, function_tool
from agentlock import AuthorizationGate, AgentLockPermissions
from openai_agentlock import lock_agent
gate = AuthorizationGate()
@function_tool
def read_record(record_id: str) -> str:
return f"record {record_id}"
agent = Agent(name="demo", tools=[read_record])
lock_agent(
agent,
gate,
permissions={
"read_record": AgentLockPermissions(
allowed_roles=["reader"],
requires_auth=True,
),
},
)
Pass an identity object through RunContextWrapper.context that exposes
user_id, role, and (optionally) session_id so the gate can evaluate
role and scope.
License
Apache 2.0.
Metadata
Release files for openai-agentlock 0.1.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 |
|---|---|---|---|---|
| openai_agentlock-0.1.0.tar.gz | 7.7 kB | Without provenance | Details for openai_agentlock-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openai_agentlock-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for openai_agentlock-0.1.0-py3-none-any.whl |
Total release size: 15.3 kB
Release files / openai_agentlock-0.1.0.tar.gz
| Download URL | openai_agentlock-0.1.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9037153dd9c65b2b3f89b4cc08a049d8a800c502870087b451d92a3311c2c728
|
|
BLAKE2b-256 checksum How to use checksums |
717af8841c2716e8999212ecad991547b331ccf7975d7c7e3f941e8267d930b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / openai_agentlock-0.1.0-py3-none-any.whl
| Download URL | openai_agentlock-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fd6dabc207d6ea011125e52d1fa4182c9ccb3d14122f7d57b2b7ce10b9f3bdf
|
|
BLAKE2b-256 checksum How to use checksums |
cdf4ef18652db26e67d0dc617ab98b48fd59e53e222ccccafbbab4bf780330d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for openai-agentlock 0.1.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.