MrTechKing

7 min read

OpenAI Agents SDK: Build Multi-Agent Apps in Python (GitHub, Scanned)

OpenAI's free Python framework for AI agents that call tools, hand off to each other and work with 100+ models.

OpenAI Agents SDK logo
✅
Scan: safe. Nothing malicious. Two things to know: tracing uploads each run to your OpenAI account unless you turn it off, and the critical advisories sit in the optional LiteLLM extra's locked version, not in the core install. Scanned Nov 28, 2026; the full report is below.

The OpenAI Agents SDK is OpenAI's free Python framework for building AI agents: a model with instructions, tools it can call and guardrails that check what goes in and out. You describe an Agent in a few lines, give it Python functions or MCP servers as tools, and Runner.run_sync runs the loop of calling the model, running tools and feeding the results back. In the first ten minutes you can pip install it, set an OpenAI API key and have a hello-world agent answering in your terminal.

It earns its place for being small and practical. Agents can hand a conversation to another agent or call one as a tool, sessions keep the chat history for you, and human-in-the-loop approval pauses a run before a risky tool call. Newer parts add sandbox agents that work in a container or a local folder, realtime voice agents and voice pipelines. It is provider-agnostic: OpenAI's Responses and Chat Completions APIs by default, and 100+ other models through the optional LiteLLM or any-llm extras. Built-in tracing sends each run to the Traces dashboard on your OpenAI account, which helps with debugging and is worth knowing about.

It is MIT-licensed and maintained by OpenAI, with about 30,900 stars and around 400 contributors since March 2025; a JavaScript and TypeScript version lives in a separate repository. Pull requests are accepted from collaborators only. Version 0.26.0 came out on 24 November 2026, and releases are frequent, 131 so far.

Who it is for

Python developers building assistants, support bots, research or coding agents, teams who want handoffs and guardrails without a heavy framework, and people learning how agent loops work. You need Python 3.10 or newer and an API key for OpenAI or another provider; the local sandbox runs on macOS and Linux, and Windows uses Docker or a hosted sandbox.

Getting started

1. Create a virtual environment and install it

python -m venv .venv
source .venv/bin/activate
pip install openai-agents

2. Or with uv

uv init
uv add openai-agents

3. Set your API key

export OPENAI_API_KEY=sk-...

4. Save this as hello.py and run python hello.py

from agents import Agent, Runner

agent = Agent(name="Assistant", instructions="You are a helpful assistant")
result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")
print(result.final_output)

5. Turn off tracing to OpenAI, if you do not want runs stored there

export OPENAI_AGENTS_DISABLE_TRACING=1

pip installs the SDK and its core packages (openai, pydantic, requests, websockets, mcp and httpx) into the virtual environment and changes nothing else; extras such as [voice], [redis], [litellm] or [docker] add more. Tracing is on by default: each run, including model inputs and outputs and tool arguments, is uploaded to your OpenAI account's Traces dashboard with your API key. Set the variable above to stop it, or trace_include_sensitive_data=False in RunConfig to keep the contents out. The local sandbox client runs commands as ordinary processes on your machine with your full environment, so it is for trusted work only. Our scan covers the source, not the published package.

Safety scan

We cloned openai/openai-agents-python at commit 6afdd47 on Nov 28, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.

  • 0 secret hits and no committed binaries across 1,705 files and about 603,000 lines, mostly Python: the SDK itself is about 135,000 lines, and the rest is tests, examples and documentation in several languages.
  • 1 pattern hit, at tests/extensions/sandbox/test_rclone.py line 62: a test asserting that the sandbox's rclone setup does not use curl https://rclone.org/install.sh | bash. It guards against pipe-to-shell rather than using it; the setup downloads rclone 1.74.4 from downloads.rclone.org and checks it runs before moving it into place, inside the sandbox. The four scripts listed as installers are a repo skill's verification scripts and CI helpers that run tests and examples.
  • No install script or install hooks. It is an ordinary PyPI package that the release workflow builds and publishes with trusted publishing, so no upload token is stored in the repository.
  • 32 advisories in uv.lock, 3 critical and 10 high, none in the core install. All sit in optional extras: 16 in LiteLLM 1.83.0, including the 3 critical ones, which are in LiteLLM's proxy server endpoints (sign-in bypass, SQL injection, template injection), a server the SDK never runs, since it uses LiteLLM only as a client library; pyproject asks for 1.83.0 or newer, so a fresh install gets the current release. The other 16 are in filelock (via the LiteLLM extra and Hugging Face Hub), dnspython (the MongoDB extra) and wcmatch (the E2B extra).
  • The SDK calls the model provider you configure (api.openai.com by default) and, unless disabled, api.openai.com/v1/traces/ingest for tracing; we found no other analytics. The many example.test and example.invalid hosts are test fixtures. 10 workflows, no pull_request_target, and all 21 third-party actions are pinned to commits; the release jobs that hold write tokens run only on published releases and the main branch, never on pull request code. Security policy, Dependabot and CodeQL present.

What the scanner counted

CheckResult
SecretsNone found.
Suspicious code1 pattern hit found and read; every one is listed under the raw findings.
Install-time code4 installer scripts
Committed binariesNone.
CI workflows10 workflows. None use pull_request_target. 0 of 21 third-party actions pinned to a tag rather than a commit.
Network hosts40 distinct hosts referenced from source; most often example.test, api.openai.com, platform.openai.com, github.com. No URLs to bare IP addresses.
Known vulnerabilities32 advisories across 213 pinned packages: 3 critical, 10 high, 15 moderate, 4 low. uv.lock: 213 packages, 32 advisories.
Project hygieneHas security policy, automated dependency updates, CodeQL, licence file, contributing guide.
OpenSSF ScorecardNot scored: the project is not in Scorecard's weekly index.

The raw findings

Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.

Pattern hits (1)
WhereRuleMatch
tests/extensions/sandbox/test_rclone.py:62download-piped-to-shell (test/example)assert "curl -fsSL https://rclone.org/install.sh | bash" not in command
Installer scripts (4)
Worst known vulnerabilities (24 of 32)
AdvisorySeverityPackageSummary
GHSA-4xpc-pv4p-pm3wcriticallitellm@1.83.0LiteLLM: Authentication Bypass via Host Header Injection
GHSA-6wvf-77m9-58rmcriticallitellm@1.83.0LiteLLM vulnerable to server-side template injection in the /prompts/test endpoint
GHSA-r75f-5x8p-qvmccriticallitellm@1.83.0LiteLLM has SQL Injection in Proxy API key verification
GHSA-45c3-73f7-pv4mhighdnspython@2.8.0dnspython dns.name.from_wire_parser() excessive CPU use
GHSA-vvf4-9x63-8xvvhighdnspython@2.8.0dnspython has excessive memory and CPU use
GHSA-v4x8-3wr5-3wq8highfilelock@4.0.12filelock ReadWriteLock: SQLite reopens the lock database by name, so a planted symlink or journal file makes the lock us…
GHSA-7488-6r32-c95qhighlitellm@1.83.0LiteLLM: MCP Authentication Bypass via OAuth2 Passthrough Fallback
GHSA-g5ff-637f-6q2mhighlitellm@1.83.0LiteLLM: internal_user_viewer arbitrary local file read via `vertex_ai_credentials`
GHSA-qrc4-49gv-mv9mhighlitellm@1.83.0LiteLLM allows an authenticated internal_user to create API keys with access to routes that their role does not permit
GHSA-v4p8-mg3p-g94ghighlitellm@1.83.0LiteLLM: Authenticated command execution via MCP stdio test endpoints
GHSA-wpfp-gwwc-vwq6highlitellm@1.83.0LiteLLM allows a user to modify their own user_role via the /user/update endpoint
GHSA-wxxx-gvqv-xp7phighlitellm@1.83.0LiteLLM has a sandbox escape in custom-code guardrail
GHSA-xqmj-j6mv-4862highlitellm@1.83.0LiteLLM: Server-Side Template Injection in /prompts/test endpoint
GHSA-6627-m3xw-93mpmoderatefilelock@4.0.12filelock: StrictSoftFileLock creates its claim directories without the lock mode, so another local user with a write bit…
GHSA-69hj-f68j-2879moderatefilelock@4.0.12filelock: UnixFileLock truncates and chmods any regular file another user renames or hard-links onto the lock path
GHSA-8mx5-7m5m-r77gmoderatefilelock@4.0.12filelock: WindowsFileLock ignores mode: a 0o600 lock file and the ReadWriteLock database inherit the directory ACL
GHSA-9c4x-gm8v-wgc4moderatefilelock@4.0.12filelock: StrictSoftFileLock and SoftReadWriteLock adopt a protocol directory another user created first, losing mutual …
GHSA-cwqr-hh33-gh44moderatefilelock@4.0.12filelock ReadWriteLock: a crafted lock database makes every acquire stall or hang regardless of timeout
GHSA-fj95-fr6c-h845moderatefilelock@4.0.12filelock: SoftReadWriteLock holder refresh writes through a hard link and hangs on a named pipe that another local user …
GHSA-fq56-3cx3-fjxpmoderatefilelock@4.0.12filelock: SoftFileLock stale-lock break removes a live lock file on a reused inode number and admits two holders
GHSA-m462-7rxw-wvpgmoderatefilelock@4.0.12filelock: StrictSoftFileLock follows a symbolic link swapped in at <path>.filelock and creates claim files in a director…
GHSA-rfpc-qcw5-3pc4moderatefilelock@4.0.12filelock: SoftFileLock removes a live holder's marker when another user forges the PID in a writable marker
GHSA-3cv6-jpf6-8222moderatelitellm@1.83.0LiteLLM: Authenticated SSRF and provider-credential exfiltration via unvalidated request-body routing parameters
GHSA-4jcj-7x88-m979moderatelitellm@1.83.0LiteLLM: MCP Proxy Has Improper Authentication

By the numbers

Stars30.9K
Forks5,128
Contributors407
Commits2,637
Open issues56
Open pull requests32
Releases131
Latest releasev0.26.0
LicenceMIT
Main languagePython
Project age1 year
Last pushNov 28, 2026
Tracked files1,705
Lines of code603.3K
Checkout size27 MB

Lines by language: Python 491.3K, Markdown 55.2K, JSON 51.3K, JavaScript 1,700, YAML 1,640, CSS 808.

Questions

Is OpenAI Agents SDK free?

Yes. The SDK is MIT-licensed and free. You pay for the model calls: OpenAI's API is billed per token and other providers set their own prices, while a local model behind an OpenAI-compatible server costs nothing beyond your hardware.

OpenAI Agents SDK or LangChain?

The Agents SDK for a small, readable core built around agents, tools, handoffs and guardrails, with tracing included. LangChain for its much larger catalogue of integrations, retrievers and document loaders. Both work with many model providers.

Does the OpenAI Agents SDK send my data anywhere?

Yes, to your model provider, and by default a trace of each run goes to your OpenAI account's Traces dashboard. Set OPENAI_AGENTS_DISABLE_TRACING=1 to stop that; tracing is not available to Zero Data Retention organisations anyway.

Can I use it without OpenAI?

Yes. Install the litellm or any-llm extra to use Anthropic, Gemini, Mistral and others, or point it at any OpenAI-compatible endpoint. Turn tracing off or add your own trace processor, since the default one uploads to OpenAI.

Do I need to know how to code?

Yes. It is a Python library and you write the agents in code. For a visual agent builder, n8n and Dify on this list need far less of it.


This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.