laguagu/claude-code-nextjs-skills / skills/openai-agents-sdk
openai-agents-sdk
VerifiedOpenAI Agents SDK (Python) development. Use when building AI agents, multi-agent handoffs, function tools, guardrails, sessions, streaming, or tracing with the `openai-agents` / `agents` Python package — including Azure OpenAI through its native client or LiteLLM. Triggers on imports from `agents`, uses of `Runner.run_sync`/`Runner.run_streamed`, `@function_tool`, `AgentOutputSchema`, `SQLiteSession`, or questions about the openai-agents-python SDK. Python only — not the TypeScript `@openai/agents` SDK.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.9 KB |
| references/guardrails.md | markdown | 1.8 KB |
| references/handoffs.md | markdown | 1.4 KB |
| references/patterns.md | markdown | 1.5 KB |
| references/providers.md | markdown | 2.8 KB |
| references/sandbox.md | markdown | 1.5 KB |
| references/sessions.md | markdown | 1.6 KB |
| references/streaming.md | markdown | 1.5 KB |
| references/structured-output.md | markdown | 838 B |
| references/tools.md | markdown | 3.0 KB |
references/tools.md
View on GitHub# Tool execution boundaries and approvals
Use typed function tools for application operations; keep tenant/role checks,
input validation and idempotency in the executor. Model input/context is not
authorization. Tool errors returned to the model or UI need the app's safe
formatting policy. By default `@function_tool` catches exceptions.
Through 0.22.x the exception text reached the model; from 0.23 (first on PyPI as 0.23.1) the model gets
a fixed generic message. Return an error string or pass `failure_error_function`
for model-visible detail (from 0.24.0 also run-wide with `RunConfig(tool_error_formatter=...)` for `kind="tool_exception"`, where `args.error` is the raw exception and can hold sensitive data; return `None` to keep the default; explicit per-tool handlers override it, and `Agent.as_tool()` and local MCP-factory tools keep their own handlers); `failure_error_function=None` re-raises. `timeout=` bounds a call; it does not make side effects
transactional. `from agents.decorators import tool` is an alias in current
releases (verified in 0.24.0).
Hosted tools run under provider contracts; local tools execute in the app's
runtime or sandbox. Confirm installed tool types and endpoint support in
[tools docs](https://openai.github.io/openai-agents-python/tools/). Do not assume
function-tool guardrails cover hosted shell, computer, MCP or patch tools.
Tool execution limits and cancellation apply to real side effects too.
Ordinary function-call dict/Pydantic results, including a structured
`as_tool()` final output, default to `str(value)` in 0.24.0. Declared output
schemas serialize JSON; recognized `ToolOutputText`/image/file content retains
its structured format. Programmatic calls have separate JSON serialization.
Return JSON text or use `custom_output_extractor` when JSON formatting matters.
`tool_use_behavior="stop_on_first_tool"` or
`StopAtTools(stop_at_tool_names=[...])` returns a selected tool output as the
final result; `Agent.reset_tool_choice` defaults to `True` so a forced tool
choice does not force calls forever.
For model-written programmatic tool calling (`ProgrammaticToolCallingTool`, a
hosted Responses tool), verify the selected model and installed SDK
constraints, allowed callers and tool exposure before enabling it. A general
function-tool list is not automatically callable from model-generated code.
Use SDK human-in-the-loop interruption/resume state when the task needs approval.
Tie the decision to an authorized server-issued run/tool call and recheck
policy before executing it; do not trust client-edited run state.
`result.interruptions` contains approval items; use `state = result.to_state()`,
`state.approve(item)` / `state.reject(item)`, then resume with
`await Runner.run(original_agent, state)`. Restore serialized state with
`await RunState.from_string(original_agent, text)`; that method is async and
the serialized state includes run context. Pass `context_override=` to replace
that saved context with trusted server context; approval decisions and usage
still come from the string (verified in 0.24.0).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |