OpenAI Agents SDK
In-app harness SDK — not the managed Agents API
The OpenAI Agents SDK is a TypeScript and Python library for building agents in your application: agent loop, tools, handoffs, guardrails, sessions, and tracing. OpenAI’s docs contrast three runtimes: Responses API (you own the loop), Agents SDK (the SDK runs the loop in your process), and Agents API (a managed harness in OpenAI’s service). Use it when your server owns deployment, tool implementations, state, and approval decisions — the same “permission outside the agent” split as the Muse/Sentinel playbook, implemented in your own harness rather than Meta’s VM.
Use Cases
- Run an agent loop in your own process with typed tools
- Handoffs between specialists you define in code
- Guardrails and human-review pauses you resume from application state
- Sessions and tracing without moving the harness to a managed Agents API
- Sandbox/workspace agents when the task needs isolated files
Key Features
In-app agent loop
The SDK runner performs tool calls, handoffs, and stops when the run finishes or pauses for approval. Your app hosts it.
Not the Agents API
OpenAI documents the Agents API as a managed harness in OpenAI’s service. The SDK is the self-hosted / in-app path.
Tools, MCP, handoffs
Function tools, hosted OpenAI tools, local MCP connections, and agents-as-tools.
Guardrails and interruptions
Input/output/tool guardrails plus resumable approval flows via run state.
Python and TypeScript
pip install openai-agents; npm install @openai/agents. Docs: developers.openai.com agents SDK guide.