Skip to main content

sealedplan-openai-agents

Use a sealedplan runtime's actions as tools in an OpenAI Agents SDK agent. A tool call builds a plan; if a person must approve it, the run stops on the SDK's tool approval, and continues only once the plan is approved in the runtime's store. Needs openai-agents 0.26.

pip install sealedplan-openai-agents
from agents import Agent
from sealedplan_openai_agents import sealedplan_tools

tools = sealedplan_tools(rt, agent=AGENT)  # rt: a Runtime with actions registered
assistant = Agent(name="ops", instructions="...", tools=tools)

Each registered action becomes one tool. sql.update_row becomes sql_update_row, and its arguments are the action's plan() parameters. A call never changes the target system directly.

What a tool call does

Policy decision Result
auto The change is drift-checked and applied; the tool returns the outcome.
approve, two_person The run stops with the call in result.interruptions.
deny The tool returns state: DENIED with the plan hash. Nothing is written.

The tool returns a JSON object to the model: state, plan_hash, summary, message, and where they apply applied, failed_preconditions (drift), deviation and error.

Approving and resuming

from agents import Runner
from sealedplan_openai_agents import resolve_approvals

result = await Runner.run(assistant, "Upgrade customer 1 to gold")
state = result.to_state()
for plan in resolve_approvals(rt, state):  # the plans waiting for a person
    print(plan["plan_hash"], plan["summary"])

A person approves the plan out of band, for example:

sealedplan --db plans.db approve <hash prefix> --as dana --issuer https://idp.example.com

Then the application copies the store's decisions onto the run and resumes it:

resolve_approvals(rt, state)
result = await Runner.run(assistant, state)

resolve_approvals approves the calls whose plan was approved, rejects those whose plan was rejected or expired (the model sees why), and leaves the rest waiting; a resumed run stops on those again. Do not call state.approve() on these calls yourself: the SDK's approval only lets the run continue. The tool reads approval from the store, and a call approved in the run but not in the store writes nothing. If the system changed after approval, the tool returns DRIFTED and nothing is written.

One tool call, one plan

The SDK asks whether a call needs approval before it runs the tool. The adapter makes the plan at that point and uses the call's id as the plan's idempotency key (KEY_PREFIX + call id), so the approval check, resolve_approvals and the tool itself all find the same plan.

Who is the agent

agent= is the principal recorded as the plan's agent, and sponsor= optionally the person on whose behalf it acts.

Metadata

Release files for sealedplan-openai-agents 0.1.0

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

Source distribution (sdist)

Source distribution for sealedplan-openai-agents 0.1.0
File Size Uploaded Provenance Actions
sealedplan_openai_agents-0.1.0.tar.gz 9.3 kB With provenance Details for sealedplan_openai_agents-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sealedplan-openai-agents 0.1.0
File Interpreter ABI Platform Actions
sealedplan_openai_agents-0.1.0-py3-none-any.whl Python 3 none any Details for sealedplan_openai_agents-0.1.0-py3-none-any.whl

Total release size: 20.2 kB

Release files / sealedplan_openai_agents-0.1.0.tar.gz

Download URL sealedplan_openai_agents-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5ef374f687090a8d2ed9e15ee8909a4cfb94894e95853bcaa5c1e7fa5eed3d20
BLAKE2b-256 checksum
How to use checksums
e4e736d1ba9d4ea3df9419979e4e599c522de954169d8040282cadee27d92316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Release files / sealedplan_openai_agents-0.1.0-py3-none-any.whl

Download URL sealedplan_openai_agents-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
557aa3aec5f3bbd673e7466fe423bfab00cb606bbdea8da9e8cff6e75d9bd5bd
BLAKE2b-256 checksum
How to use checksums
fb74233cec5ececd66a9372fd1b911e3c0ecb49f9fa40dd9db589de40a6035ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for sealedplan-openai-agents 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sealedplan_openai_agents-0.1.0.tar.gz

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 Nov 29, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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