OpenAI Agents SDK for Python 0.24
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
3prompts
- Python 3155 lines · 3.8K tokens
- OpenAI SDK for Python 3.656 lines · 1.4K tokens
- OpenAI Agents SDK for Python 0.2467 lines · 3.2K tokens
Total278 lines · 8.3K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 73
- 78
- 79
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 328
- 338
- 347
- 367
- 379
- 409
- 416
- 426
- 427
- 459
- 470
- 488
- 502
- 522
- 532
- 611
- 639
- 674
- 732
- 770
- 772
- 776
- 799
- 807
- 829
- 841
- 862
- 916
- 918
- 1104
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the included OpenAI SDK for Python and Python baselines first. These rules cover the OpenAI Agents SDK for Python 0.24 line, including Runner, tools, handoffs, approvals, sessions, tracing, and sandbox agents.
Prompt injection and agent boundaries
- Keep
Agent.instructions, dynamic instruction callbacks, tool registries, andRunConfigunder application control. Treat user messages, retrieved files, MCP responses, tool output, and sandbox memories as untrusted data; never promote them into instructions or permission grants. - Authorize handoff targets and
Agent.as_tool()delegates for the current principal. For model-supplied handoff metadata, use a narrowhandoff(input_type=...)schema and authorize parsed fields at the start ofon_handoff, before side effects; raise on denial because returning normally continues the transfer. A model-selected delegate must not acquire broader credentials. - Filter handoff history with
input_filterto the receiving agent's data scope, including text copied into summaries;nest_handoff_historyis not redaction. Server-managed conversations do not support these filters: start a separate run with explicitly selected input and without the originalconversation_idorprevious_response_idwhen isolation is required. - Use
input_guardrail(run_in_parallel=False)when rejection must precede model or tool execution. Input guardrails run on the first agent; the default parallel mode can already consume tokens and execute tools before rejection. - Place checks at each actual protected operation: handoffs, hosted tools,