Skip to main content

agentos-provider-openai-agents

Run an OpenAI Agents SDK agent as one governed AgentOS step. The SDK owns the agent loop — model, tools, turns. AgentOS owns the ledger and the authority: which tools the model is even offered, whether the step may run at all, what it cost, and a hash-chained record of what happened.

pip install -e . -e providers/openai-agents      # from a checkout; restart the API and worker

Zero-config default: the SDK's chat-completions model against a local Ollama (http://127.0.0.1:11434/v1), no API key. GET /executors shows it as openai-agents.

An agent

{
  "name": "editor", "type": "llm", "executor": "openai-agents",
  "declared_effects": ["compute"],
  "config": {
    "model": "chat.default",
    "instructions": "Count the words in the text with the word_count tool, then reply with the number.",
    "prompt": "Text: {write.text}",
    "tools": ["word_count", "utc_now"],
    "max_turns": 4
  }
}

instructions (or system), prompt with {dotted.inputs}, model (alias or id), tools (registered names), max_turns (default 6), temperature, json_output, output_schema (a JSON Schema object; below).

Where the seam is

Temporal's Agent Harness describes "a seam between the model deciding to use a capability and that capability actually executing". Here it is two things you already have:

  1. The tool registry (dagentos.providerkit.tools, shared with the PydanticAI harness). Tools are the operator's Python functions, each carrying an EffectClass. Agent JSON names them; it never contains code. Register yours with the agentos.tools entry point (a callable returning Iterable[ToolSpec]) and every inner harness offers them; this provider also still loads the original agentos.openai_agents_tools group, kept for compatibility (tools.py, LEGACY_ENTRY_POINT_GROUP). Two harmless built-ins (utc_now, word_count, class compute) ship for the quickstart.
  2. The core's declared-effects gate. At dispatch the model is offered only the tools whose class the AgentOS agent declared. An undeclared tool is not offered-and-refused; it is not there (tools_withheld in the output says which). A step declaring an approval-required class (spend, write_external, …) is suspended by the governor before this executor runs — no step.started, no model call. Every tool the model actually called is reported as an Effect, so the governor's post-step check is the backstop.

What lands in the log

One step.completed per SDK run: text (final output), turns (model calls), tool_calls (name, call id, SHA-256 of arguments and of output — the trajectory without inlining large outputs), tools_offered / tools_withheld, usage, and a Cost metered from the SDK's summed usage through the bundled pricing table (model_requests as an extra meter). Provenance carries the model, alias and a prompt hash over instructions, input and offered tool names.

Typed output (output_schema)

Replace json_output: true with a JSON Schema object under config.output_schema. The SDK sends it to the model as response_format (strict: false — operator schemas are rarely OpenAI-strict, and a local Ollama ignores strictness) and calls validate_json on the reply; that call is answered by agentos_provider_openai_agents.output_schema.KitOutputSchema, a thin adapter over dagentos.providerkit.schema, the same validator the PydanticAI harness uses. A violation is a ModelBehaviorError → BadResponse naming the first failing path; a valid reply lands in output["json"] with schema_sha256, the contract hash a downstream step pins to. Remote $refs are refused at first use; format is never enforced; the schema is part of prompt_hash.

Not in this slice (ROADMAP ⏭)

  • Mid-step approval. The SDK can pause on a needs_approval tool (interruptions). Honouring that would mean persisting the SDK RunState as a blob and a resume protocol. Until then, gate at step granularity (declare the class) and do not set needs_approval on registry tools; a run that comes back paused raises rather than auto-approving.
  • Token-level streaming of SDK events into progress().
  • MCP servers as registry entries.

Environment

Variable Default
AGENTOS_OPENAI_AGENTS_BASE_URL http://127.0.0.1:11434/v1
AGENTOS_OPENAI_AGENTS_API_KEY unset (falls back to OPENAI_API_KEY)
AGENTOS_OPENAI_AGENTS_ALIASES {"chat.fast": "qwen2.5:0.5b", "chat.default": "llama3.2:3b"}
AGENTOS_OPENAI_AGENTS_PRICING bundled pricing.json
AGENTOS_OPENAI_AGENTS_TIMEOUT 60

Invalid values fail at startup naming the variable.

Tests

providers/openai-agents/tests drives every run through the SDK's own ScriptedModel — no network, no cassettes — and one test goes through the core to prove the gate suspends a spend-declaring step before the SDK is invoked. Live: the quickstart's poet and critic were run on this executor against a local Ollama; note that a 0.5B model does not reliably emit tool calls — use a tool-capable model (chat.default) for tool steps.

Metadata

Release files for agentos-provider-openai-agents 0.18.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 agentos-provider-openai-agents 0.18.0
File Size Uploaded Provenance Actions
agentos_provider_openai_agents-0.18.0.tar.gz 17.8 kB With provenance Details for agentos_provider_openai_agents-0.18.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agentos-provider-openai-agents 0.18.0
File Interpreter ABI Platform Actions
agentos_provider_openai_agents-0.18.0-py3-none-any.whl Python 3 none any Details for agentos_provider_openai_agents-0.18.0-py3-none-any.whl

Total release size: 32.6 kB

Release files / agentos_provider_openai_agents-0.18.0.tar.gz

Download URL agentos_provider_openai_agents-0.18.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c4435800bb7e5e5e2ae2afe9d9dab2bd16f42bad32e01d3c76b2f5c2e10a8588
BLAKE2b-256 checksum
How to use checksums
d287925ac505e4d1799308c4395ab5ddc9b2d71c6e34360160f5bee2c1ac0029
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 18, 2026.

Transparency log

Release files / agentos_provider_openai_agents-0.18.0-py3-none-any.whl

Download URL agentos_provider_openai_agents-0.18.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6aad9ae8679da65f645671bd8e43f5d3b3f6122f281f48b2480ecd604218111f
BLAKE2b-256 checksum
How to use checksums
378edc655e4c95fd6e61b4ed33d8fabafbfa58b47d6343e7a5c67263147cf775
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 18, 2026.

Transparency log

Security for agentos-provider-openai-agents 0.18.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 agentos_provider_openai_agents-0.18.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 18, 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.

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