Concept
A remote agent has no ABL definition in your project. The platform cannot seed itsGATHER fields or read its memory. It receives one A2A message. That message carries the customer’s text, the history you select, and a bounded context.
Context for a remote agent is a controlled export. Whatever you authorize leaves your platform.
Use a
HANDOFF for a remote agent. A DELEGATE needs a local target. At run time a DELEGATE to a remote name fails with “Agent not found”, and the delegate ON_FAILURE policy runs.
Minimal working example
An intake router sends fraud reviews to a partner fraud service. The route passes the transaction ID, a short summary, and the last four messages. It sets a failure reply. The partner endpoint is a project-local assumption. Replace the URL with your partner’s A2A endpoint. The platform adds the credentials from your external agent registration.transaction_idis aGATHERfield of the router.PASScopies it into the remote context.Partner_Fraud_Servicehas no file in your project. TheENDPOINTline defines it.
How it works
- The router selects the route and builds the context.
PASS,SET, the summary, and memory grants apply as for a local handoff. - The runtime selects the history.
fullsends the whole conversation as stored.last_nsends the last N messages.noneandsummary_onlysend no messages.autosends the summary only when the route has one and otherwise the last 5 messages. - The runtime projects the context to the keys the route authorized. It adds
handoff_fromandintent. It adds provenance for each key and the memory grants. - The runtime sends one A2A message. The history rides in the message metadata. The context rides in the metadata and in the platform envelope.
- The runtime records an
a2a_invocation_envelopetrace event. ItscontextKeysfield lists the keys sent. - With
RETURN: true, the parent waits. When the remote task completes, the runtime restores the parent, shows the remote reply, and appliesON_RETURN.MAPandSETrun against the values the remote agent returned.
- Fields that you did not name in
PASSorSET. - Values the runtime copies automatically between local agents, unless the key is one of
conversationSummary,user,gender, orlocation. - Internal keys that start with an underscore.
- The platform checks the target URL before dispatch. An unsafe target fails with the code
remote_target_unsafe. - The history leaves your platform as stored. The PII redaction that protects model calls does not apply to history sent to a remote agent. Choose
noneor a small window when messages can hold personal data. - The remote agent must understand the A2A metadata. It controls what it does with the history and context.
- The compiler does not check
ON_RETURNMAPfields for a remote target, because it cannot see the remote agent. A mapped field that the remote agent does not return is skipped without an error.
Common variations
Send no history
Use this whenPASS and the summary carry everything.
GATHER field from the minimal example.
Hand off permanently
SetRETURN: false when the remote agent owns the rest of the conversation. The router thread ends when the handoff starts.
Run the remote agent asynchronously
SetASYNC: true and TIMEOUT in seconds when the remote task takes long. The default is 300 seconds. Write the key as TIMEOUT. The text parser ignores ASYNC_TIMEOUT without a message. The remote agent must advertise push notifications. The platform must have its async infrastructure enabled. If either is missing, the handoff fails. The runtime does not fall back to a synchronous call.
TIMEOUT at a platform maximum.
Map values from the remote reply
A remote agent can return named values. It sends an A2Adata part that holds a returnValues object, in the reply message, the task status message, or a task artifact. MAP reads the keys of that object. The key is the left side of the entry.
GATHER field from the minimal example and a fraud_verdict field in the router MEMORY section.
The partner must send a data part like this one. This is the partner’s side, shown for reference.
- A
SETentry inON_RETURNcan read the same values asresult.verdict. - A
returnValueskey that yourMAPdoes not name is ignored. - A reply with text only fills no mapped field. The parent still resumes.
- Agree on the key names with the partner. The platform cannot validate them at compile time.
Share a stored value with the remote agent
A grant adds the path and its access level to the envelope. See Grant another agent access to memory. Grant only what the partner needs.Verification
- Run the validator. Expect no errors and no warnings.
- Send a fraud report and give the transaction ID.
- Expect a
handofftrace event toPartner_Fraud_Service. - Expect an
a2a_mode_resolvedevent. Check themodeand thereason. - Expect an
a2a_invocation_envelopeevent.contextKeysmust listtransaction_idand the summary key, plushandoff_fromandintent. It must not list fields you did not authorize. - Check the partner’s logs. The partner must receive the last four messages and no more.
- Make the endpoint unreachable. Expect the reply from
ON_FAILURE.
Production readiness checklist
- The partner endpoint uses HTTPS and is registered with credentials.
- A data-sharing agreement covers the history and context you send.
- Each route sets
HISTORYon purpose. Routes that can carry personal data usenoneor a small window. - Each
PASSlist holds only what the partner needs. ON_FAILUREgives the customer a next step.- Tests cover success, an unreachable partner, a slow partner, and a partner that rejects the task.
- Trace checks confirm
contextKeyson every remote handoff. - The team knows how the partner uses and stores the data.
Common mistakes
Troubleshooting
Related articles: