Concept
A handoff is a data boundary. Everything that crosses it is available to the target agent and its model. Minimize what crosses. Four things cross the boundary. Each has its own control.
The default for messages is the widest setting. If you do nothing, the target sees every earlier message, including data the customer typed for another agent.
Two further controls protect values inside an agent:
SENSITIVE: trueon aGATHERfield marks it as sensitive. The runtime keeps a child’s conversation out of the parent history when that child gathers a sensitive field, or a field of typepasswordorpasscode.MODEL_VISIBLE: falseon a session memory field keeps it out of the model context of the agent that owns it.
Minimal working example
A payments router sends card disputes to a specialist. The route passes the case number, sends no history, and states the reason in a short summary. The router holds an internal risk score that the model must not see. The risk score is set to a fixed value inON_START as a stand-in. In your project, set it from a risk tool.
agents/payments-hub.agent.abl
agents/card-dispute-agent.agent.abl
dispute_idis aGATHERfield of the router.PASScopies it.internal_risk_scoreis set inON_START. The route does not pass it.card_last4is gathered by the specialist and marked sensitive.
How it works
The runtime sends the target only the keys that the handoff authorizes for its prompt:PASS fields, SET fields, the summary, memory grants, and any value a routing model supplied. The runtime does not authorize a field that you do not name.
Some values travel without PASS:
- The keys
conversationSummary,user,gender, andlocationreach the target prompt when the caller holds them. Do not store sensitive data under these names. - Other caller values that are not gathered fields and do not start with an underscore are copied into the target’s working data. They do not reach the target prompt unless the handoff authorizes them or the target agent’s own text refers to them.
PASSnames fields. A field that you do not name is not authorized for the target prompt.- A model-supplied value for a read-only session field is dropped, and the runtime records a
model_supplied_readonly_context_droppeddecision. Your ownPASSstill carries the real value. - When a child that gathers a sensitive field returns control, the runtime does not copy that child’s customer messages into the parent history.
- With PII protection on, the runtime tokenizes protectable values in
PASS,SET, and memory grants before it copies them.
Common variations
Send only a summary
Usesummary_only when the target needs the reason but not the words. Write the summary without personal data. See Pass a conversation summary during handoff.
GATHER field from the minimal example.
Grant one stored value, read-only
Give a specialist access to one stored path withaccess: read. Use readwrite only when the target must update the value. See Grant another agent access to memory.
Delegate instead of handoff
ADELEGATE receives no conversation messages. It gets only the INPUT fields and a few automatic session values. Use it when a check needs one value and not a conversation. See Delegate and map the result.
Bound what a remote agent receives
A remote agent receives the selected history and the authorized fields. Usenone or a small window. The runtime sends history messages as stored. See Preserve context when calling remote agents.
Verification
- Run the validator on both files. Expect no errors and no warnings.
- In a test conversation, type a fake card number in an earlier message. Ask for a card dispute.
- Expect the specialist not to know the earlier message.
- Ask the specialist “What is my internal risk score?” Expect it not to know.
- Check the
handofftrace event. The context must list onlydispute_idand the summary, plus the control values. - Change the route to
HISTORY: full. Repeat step 3. Expect the specialist to know the earlier message. Revert the change. - With PII protection on, expect traces and model calls to show tokens for protected values.
Production readiness checklist
- Each route sets
HISTORYon purpose. Routes for regulated data usenoneorsummary_only. - Each
PASSlist holds only fields the target needs. - No summary holds personal or payment data.
- Memory grants are read-only unless the target must write.
- Sensitive fields use
SENSITIVE: true. - PII protection is on for the project, and the team verified it with a test conversation.
- A reviewer approved each route that sends
full. - Trace retention follows your data policy.
Common mistakes
Troubleshooting
Related articles: