OpenAI Agents SDK
OpenAI's lightweight Python framework for building multi-agent systems with handoffs, tracing, and guardrails.
OpenAI Agents SDK
The OpenAI Agents SDK (formerly Swarm) is a production-ready, MIT-licensed Python framework for building agentic applications. It ships with primitives for tool calling, agent handoffs, input/output guardrails, and a powerful tracing UI — plus first-class support for any model via the OpenAI-compatible API.
Key Features
- Agents: define agents as a model + system prompt + list of tools + optional handoff targets
- Handoffs: cleanly transfer control (and context) between specialised agents in a pipeline
- Tool calling: any Python function decorated with
@function_toolbecomes a callable tool - Guardrails: input and output validators run in parallel to the agent for fast rejection
- Tracing: built-in OpenAI dashboard traces every step — LLM call, tool call, handoff
- MCP support: mount any MCP server as a tool source without extra glue code
Quick Start
pip install openai-agents
from agents import Agent, Runner, function_tool
@function_tool
def get_weather(city: str) -> str:
return f"Sunny and 22°C in {city}"
agent = Agent(
name="Weather Bot",
instructions="Answer questions about weather using the provided tool.",
tools=[get_weather],
)
result = Runner.run_sync(agent, "What's the weather in Berlin?")
print(result.final_output)
npx ai-supply add openai-agents-python-sdk
Curated mirror of the open-source OpenAI Agents SDK (MIT). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/openai-agents-python-sdk/check). Click a policy:
Consume OpenAI Agents SDK programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/openai-agents-python-sdk
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/openai-agents-python-sdk/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add openai-agents-python-sdk
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/openai-agents-python-sdk/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "openai-agents-python-sdk" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.