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:
- The tool registry (
dagentos.providerkit.tools, shared with the PydanticAI harness). Tools are the operator's Python functions, each carrying anEffectClass. Agent JSON names them; it never contains code. Register yours with theagentos.toolsentry point (a callable returningIterable[ToolSpec]) and every inner harness offers them; this provider also still loads the originalagentos.openai_agents_toolsgroup for one release. Two harmless built-ins (utc_now,word_count, classcompute) ship for the quickstart. - 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_withheldin the output says which). A step declaring an approval-required class (spend,write_external, …) is suspended by the governor before this executor runs — nostep.started, no model call. Every tool the model actually called is reported as anEffect, 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_approvaltool (interruptions). Honouring that would mean persisting the SDKRunStateas a blob and a resume protocol. Until then, gate at step granularity (declare the class) and do not setneeds_approvalon 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.17.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 |
|---|---|---|---|---|
| agentos_provider_openai_agents-0.17.0.tar.gz | 17.6 kB | With provenance | Details for agentos_provider_openai_agents-0.17.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentos_provider_openai_agents-0.17.0-py3-none-any.whl | Python 3 | none | any | Details for agentos_provider_openai_agents-0.17.0-py3-none-any.whl |
Total release size: 32.1 kB
Release files / agentos_provider_openai_agents-0.17.0.tar.gz
| Download URL | agentos_provider_openai_agents-0.17.0.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4dfe4ceb4079131ff9e3ced5ddb3e227d9d063a4b0dd87b9b1b64e9d9e30f32
|
|
BLAKE2b-256 checksum How to use checksums |
44018085533b6b9736fcff6974cbc205e1a8c2c680dda5a0fa7a682595c9bba7
|
| 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 16, 2026.
Transparency logRelease files / agentos_provider_openai_agents-0.17.0-py3-none-any.whl
| Download URL | agentos_provider_openai_agents-0.17.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e40c5bd2b4a460de4c831d0067efa2dacfef0b5b663273931f34ef8c764ac57
|
|
BLAKE2b-256 checksum How to use checksums |
29e30b0c360da57565073d419f2d3fb3735bedbb9c9a3d2831359b9ed93612fa
|
| 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 16, 2026.
Transparency logSecurity for agentos-provider-openai-agents 0.17.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.
Attestation for agentos_provider_openai_agents-0.17.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 16, 2026.
Transparency logA 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.