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 (fields that ended up different from the plan), unchecked (resources that could not be checked) 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.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 sealedplan-openai-agents 0.1.1
File Size Uploaded Provenance Actions
sealedplan_openai_agents-0.1.1.tar.gz 9.3 kB With provenance Details for sealedplan_openai_agents-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 20.4 kB

Release files / sealedplan_openai_agents-0.1.1.tar.gz

Download URL sealedplan_openai_agents-0.1.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
780d460458f12de601f88f45c773df842190a00294444e7f97142719bf7a8cbc
BLAKE2b-256 checksum
How to use checksums
6271151133dde2602d5c1fffc0a10e30061f42b0285147a6965c5879c6082b7f
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 30, 2026.

Transparency log

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

Download URL sealedplan_openai_agents-0.1.1-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
770c9cf0480d06df3cc13ee2e4c85a9798838d18027a117f4a400a4db94528bc
BLAKE2b-256 checksum
How to use checksums
e6a9af6bfdbb64e966533d8adfa2693255b32d86ff833a409df43573b626a146
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 30, 2026.

Transparency log

Security for sealedplan-openai-agents 0.1.1

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.1.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 30, 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.1 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