Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Agent safety

Expose only necessary context to a specialist during handoff

Trim or redact conversation history during handoff to reduce irrelevant and sensitive data exposure.

Goal

Pass only task-relevant information to a specialist and remove unrelated or sensitive content.

Steps

  1. Identify the fields the specialist needs and mark secrets, credentials, and personal data. [openai-handoffs] [openai-context]
  2. Use handoff(agent=..., input_filter=...) with HandoffInputData and explicitly filter input_history, pre_handoff_items, and new_items. [openai-handoffs] [openai-context]
  3. Consider redaction separately for tool arguments, tool results, and ordinary message text; removing structured items alone is insufficient. [openai-handoffs] [openai-context]
  4. Apply the filter at the handoff boundary while retaining enough information for the specialist. [openai-handoffs] [openai-context]
  5. Use a test history with fake sensitive strings and verify the specialist receives only allowed fields. [openai-handoffs] [openai-context]

How to verify

Assert fake sensitive markers are absent from specialist input while required task facts remain.

Troubleshooting

If sensitive text remains, inspect ordinary message content and tool results as well as structured tool items.

Permissions

Prerequisites

Permissions

Limitations

Filter ordinary messages, tool arguments, and outputs; removing structured tool items or compacting handoff history is not redaction. Server-managed conversations do not support this filter.

Pinned upstream source

https://github.com/openai/openai-agents-python/blob/f53c62451c7f34c15f0c87fa745e05404025420f/docs/handoffs.md

Repository
openai/openai-agents-python
File path
docs/handoffs.md
Pinned commit
f53c62451c7f34c15f0c87fa745e05404025420f
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Make Agent behavior safer and easier to verify

Related resources