A2A Hosted Agent Mode
Purpose
This functional area lets an administrator turn a registered agent into an LLM-backed reasoning agent that
runs inside ApiMapper, instead of a proxy to a remote peer. Where Concentrator mode answers "who else can
our agents talk to," Hosted Agent mode answers "can our own agent understand an incomplete or ambiguous
request instead of just failing it" — recognizing "this request is missing something" is a semantic
judgment, and it is what lets a task pause at input-required and be resumed.
Main Capabilities
- give a registered agent a system prompt and an LLM connection, making it a hosted agent
- define one or more Skills on a hosted agent — a name, a skill-level prompt, and an explicit, curated subset of the tenant's MCP toolsets and ESRA (knowledge-base retrieval) exposures marked available to Hosted Agents
- mark an MCP toolset or an ESRA exposure "Hosted Agents only" or "MCP clients + Hosted Agents" (in addition to "MCP clients only") — a toolset built purely for agent use needs no MCP client application assigned to it at all
- the agent declares how each turn ended, using three tools it always has — the request is satisfied, it needs something only the caller can give, or it has run out of options — so a task's reported state is the one the agent meant rather than one inferred from which tools it happened to call
- a turn that pauses (
TASK_STATE_INPUT_REQUIRED) asks a clarifying question the caller can answer to resume the same conversation, on the same task - every tool the LLM invokes goes through the exact same governed invocation pipeline — authorization,
credential brokering, downstream call, audit — an MCP
tools/calluses; the LLM never gets a bypass path to a downstream API - every LLM turn is audited with its actual decision content — which tool it chose (if any), the outcome it declared and how, the clarifying question it asked (if any), the downstream status worth looking at, and the turn's token spend — not just success or failure
- bound what one task may spend, with per-task input and output token ceilings on the agent that fall back to the deployment's defaults, so a paused conversation that can be resumed indefinitely is still bounded
- read what a task cost: a running per-task token total that accumulates across a pause and a resume, shown per task and rolled up per agent on the Agents Monitoring screens
- start the agent without an A2A caller — on a schedule, from a webhook, or on demand — as a governed run identity, and follow every run of it, whatever started it, in one execution history (see Triggering a hosted agent)
- let a skill ask other agents, hosted here or remote, for help during a turn, on behalf of the original caller and within limits you set (see Working with other agents)
How It Works
Choosing a kind: RemoteAgent or HostedAgent
A registered agent's kind is set once at creation and never changed afterward (delete and recreate it to change it). A remote agent carries a target system and authentication profile, exactly as Concentrator mode describes. A hosted agent carries a system prompt and an existing LLM connection instead — the same connections the Portal's AI Settings page manages for semantic enrichment. Only one set of fields applies to a given agent.
In the Agent Directory the agent page's Details tab groups a hosted agent's settings into sections: General (tenant, name, address, kind, description), Model & prompt (the LLM connection, the model and the system prompt), Limits (what one task may spend, how many runs may go at once and how many may wait), Observability (Record transcript) and Availability & endpoints (Active, Published). A hosted agent also has Delegation limits (see Limits). A remote agent's target system and authentication profile are under Connection.
Authoring Skills
A Skill is the unit an admin actually designs around: a display name, a published id derived from it
(so "Company Documents Search" is addressed as company-documents-search), a description, a prompt fragment appended to the agent's own system prompt for that skill's turns, and an
explicit set of individual tools it may call — picked from the tenant's MCP toolsets and ESRA exposures
that are marked available to Hosted Agents. A skill is not required to correspond to a single tool: one
skill can bundle a handful of search tools drawn from several different toolsets (e.g. "search job postings"
across three separate job-board toolsets) while leaving out each toolset's write-shaped tools
(e.g. "create job posting"), which a whole-toolset grant could not express. A sibling skill on the
same agent can draw from a completely different set of toolsets/exposures. This is the primary structural
defense against prompt injection: a turn can only ever see and invoke the exact tools an admin selected,
never a toolset's or exposure's full tool list.
Because a caller does not name a skill (see below), a turn is scoped to the union of the skills that caller is authorized for, not to one of them. That makes what you put on an agent the boundary, rather than what you put on any single skill: two skills on one agent are two sets of tools a caller authorized for both can use together. Where that is not what you want, the answer is two agents, or an access policy that narrows one of the skills.
Because a skill is bound to individual tools drawn from MCP toolsets and ESRA exposures, a hosted agent's tools use exactly the same downstream call configuration (target system, credential binding, schema discovery, per-endpoint overrides) that MCP clients use for the same toolset, and the same governed knowledge-base retrieval configuration ESRA exposures resolve.
Running a turn
A caller sends the agent a message. It does not name a skill — A2A has no field for one, and choosing what
to do is the agent's job, not the caller's. The platform works out which of the agent's skills that caller
is authorized for, and creates a task in TASK_STATE_SUBMITTED. The turn itself — building a reasoning
agent from the authorized skills' prompts and the union of their tools, running the caller's message
through it — runs on the platform's workers, and the task moves to TASK_STATE_WORKING while it does.
By default SendMessage waits for the turn: with configuration.returnImmediately absent or false, the
call returns when the task completes, fails or pauses (input-required), with its artifacts. With
returnImmediately: true it returns at once, in TASK_STATE_SUBMITTED. Either way the task exists from the
start: a caller can ask about it while the agent is still thinking, watch it change over a stream, or hang
up entirely and be told by a push notification when there is something to come back for. See
A2A Task Lifecycle.
Authorization is the part that does not wait. A caller authorized for none of an agent's skills is refused before anything is accepted or any model consulted. The refusal does not name the skills they were not allowed to use, and no task id is issued. An agent with no skills configured is a legitimate agent — a model with a system prompt and no tools — and runs normally.
What the agent reads from a message
The agent reads every part of the caller's message, in order:
- a text part is passed on as written. Several text parts are all passed on, separated by a blank line;
- a data part is passed on as a fenced JSON block, re-serialized by the platform rather than copied in, so its content cannot close the block or pose as instructions around it. Data marked as coming from an external system, such as a webhook body, is labelled as data to act on, not instructions to follow;
- a file part is named, with its media type, and not opened: its bytes and its URI are never fetched.
All of it is the conversation's user turn. None of it reaches the agent's system prompt (see Prompt-injection defense).
The agent says how the turn ended
A turn ends when the agent declares what happened, and there is no other way for it to end. Every hosted agent is given three tools it always has, whatever its skills are, and its instructions oblige it to finish every turn by calling exactly one of them:
| Tool | The agent is saying | The task reaches |
|---|---|---|
agent_task_completed |
the request is satisfied | TASK_STATE_COMPLETED |
agent_request_more_input |
I am blocked on something only you can give me | TASK_STATE_INPUT_REQUIRED |
agent_report_unable_to_proceed |
I have run out of options | TASK_STATE_FAILED |
If it declares more than one, the least optimistic wins: unable-to-proceed over more-input over completed. A model that contradicts itself is not treated as having finished the work.
agent_task_completed takes no argument — the agent's written answer is what the caller receives. The other two carry the question
or the reason, and that text is what the caller is told.
These three tools reach no downstream API, resolve no credential and add nothing to what the agent can do.
They exist so it can say what it did. The agent_ prefix is reserved platform-wide: a mapping's tool name
may not use it, and one that does is refused when it is entered.
What the agent called along the way decides nothing. A tool that succeeded may have been purely preparatory — confirming a customer exists before an order can be created is not creating the order. A tool that failed is something the agent reads and reasons about: it may correct its arguments and retry, and a retry that succeeds is a success. And an agent that answers a question needing no tool at all has still answered it. Only the agent knows which of those happened, so only the agent says so.
If a turn ends without a declaration, the agent is asked once — and only once — to declare one. If it still does not, the task fails saying exactly that: the agent did not declare an outcome. The platform does not guess the outcome in either direction.
The clarifying question, and the reason a task failed, are carried on the task's status message
(status.message), which is where A2A puts an agent's own words. Neither is an artifact: an artifact is a
result, and a task that paused or failed has not produced one.
The agent's own name is not sent to the model
An agent's directory name is yours to choose and can hold anything — spaces, slashes, ampersands. Model providers disagree about what may appear in a message's author field, and some reject values that are perfectly ordinary display names. The platform therefore does not send it: a hosted agent's turn has one assistant, and its instructions already say who it is, so no agent can be made unusable by the name someone gave it.
A hosted agent never asks for credentials
TASK_STATE_AUTH_REQUIRED is a state this platform understands and will return for a task relayed from a
remote peer that produced one. A hosted agent of its own never produces it.
An agent's access to a downstream system is configured by an administrator — a target system and a credential binding, resolved by the runtime at call time. The caller of an A2A agent has no part in that and could not supply a credential if asked, and a caller should never put a credential in a message.
So a downstream 401 or 403 is what it actually is: an ordinary tool error. The agent reads it, and decides whether to report that it cannot proceed. The status code is recorded on the turn's audit entry, which is where the administrator whose misconfiguration it is will find it.
Every transition is persisted
Every one of those transitions is persisted before anything else happens with it, so GetTask on any
instance sees it, a subscriber following the task is told, and — for a terminal state or a pause waiting on
the caller — the task's push notification configuration fires.
A paused task's full conversation state is persisted alongside the task. A caller's follow-up message —
naming the paused task in taskId, or carrying only the same contextId, which continues the newest paused
task of that conversation — resumes that exact conversation rather than starting over: the LLM sees the
original request and the new information together in one continuous session.
Prompt-injection defense
Two layers, both mandatory, neither sufficient alone:
- Structural tool scoping — a turn only ever has the tools an admin explicitly assigned to the skills this caller is authorized for. This bounds the damage a successful injection can do regardless of what the caller's message says, because there is nothing outside that set to redirect the LLM toward. Authorization is resolved before the model runs, so the model chooses within an already-authorized set and can never widen one.
- Message-role separation — the admin-authored system prompt and the caller's message text travel on distinct channels into the model; caller-supplied text is submitted only as the conversation's user turn and can never rewrite or append to the system-level instructions.
The three control tools sit outside both layers without weakening either. They reach no downstream API and resolve no credential, so the set of things a successful injection could redirect the agent toward is unchanged. The platform's own instruction block is prepended to the agent's system prompt rather than mixed into it, so an agent's author can reinforce it and cannot remove it.
Governance and audit
A hosted agent's skill invocation is authorized through the same access-policy check Concentrator mode
uses (agent, optionally narrowed to a skill, a caller, or conditions on the caller's token) — one
governance model for both kinds of registered agent. The check runs once per skill the agent has, and its
answers are what the turn is built from. Every turn is audited under the platform's runtime category,
carrying the LLM's actual decision (the tool it chose, the outcome it declared and which control tool it
declared it with, the clarifying question it asked, if any, and the downstream status of the tool call worth
looking at) and the turn's token spend, alongside the same allow/deny/error outcome every other governed
call records. It also records whether the agent declared an outcome at all, and whether it had to be asked
twice, so a model that does not follow the contract shows up as a number rather than as a run of confusing
task states.
The tools an agent calls are audited exactly as they are when a client calls them directly over MCP: the
same tool.invoke, credential resolution, downstream call and transform entries, on the same path. An agent
does not get a second, quieter trail.
Two gates decide whether a call reaches the agent, and both apply. Publishing decides whether a route to the agent exists; a request to an unpublished agent gets the same response as one for an agent that does not exist, including for the Agent Card. The access policies above decide each individual call.
The conversation is not kept
A hosted agent's tasks carry no history, and asking for one with historyLength returns none; the
specification leaves history optional. The only record of a turn is the model's own working thread, and
that holds the tool calls the agent made along with the raw downstream responses that came back — material
that is kept away from the caller. You already hold the messages you sent, and every turn is audited, so the
compliance record exists without being handed to whoever is on the other end of the conversation.
What bounds a turn
A turn does not run on the caller's connection, so it is not bounded by it: the caller can hang up and the
model keeps going. The platform bounds it instead, under Runtime:A2a:HostedAgents — how many turns
run at once (MaxConcurrentTurns, 4), how many may wait (QueueCapacity, 128), and how long any one may
run (TurnTimeoutSeconds, 300). A turn that exceeds its time fails that task and leaves everything else
alone. A message that arrives when nothing can be queued is answered with a failed task saying so, rather
than accepted and never run.
Those limits are per Runtime instance and shared by every agent. Each hosted agent can also be given its own, in the Agent Directory: Max concurrent executions, counted across every Runtime instance and every way the agent is started, and Max queued executions, how many scheduled or webhook runs may wait for it. Leave the first blank for no agent-level limit and the second for the deployment's default.
What one task may spend
A turn budget bounds a turn. It does not bound a task, and a task is the thing that can be resumed indefinitely: a conversation paused waiting for the caller can be continued as many times as the caller likes, and nothing else limits what it accumulates.
So a hosted agent carries two ceilings — the most input tokens and the most output tokens one of its tasks may spend. Leave either blank on the agent and the deployment's default applies; blank means the platform's answer, never unbounded, so an agent nobody has edited is still bounded. The defaults are generous; tighten them once you have real figures from the Agents Monitoring screens (see What a task cost).
A task that has reached its ceiling fails, with a reason naming the limit and the value it was set to,
so the fix is visible from the task itself. It does not pause at input-required, because nothing the
caller can supply would unblock it.
The limit is enforced by counting, not by asking the model to cap itself. The task's running total is checked before each turn, and again after every model call the turn makes — so a turn that runs away is stopped at the call that crosses the line, not allowed to finish and be caught on the next one. What cannot be avoided is the cost of that one call, because a call's price is only known once it has been made.
The limit is not sent to the model as its own output cap. Counting what comes back needs nothing of the provider but the usage figure it returns, and bounds the whole task rather than one response.
A provider that reports no usage at all is never estimated into a breach: inferring a number would let a guess terminate a caller's task. On such a deployment the turn timeout still applies, and the limit still stops a task that was already over it before the turn began.
That usage figure is whatever the model provider returns alongside its answer. Nothing is inferred when a provider reports nothing: the call is still counted, so a zero on these screens is a zero and not a guess.
A ceiling breach is not the agent's declaration — the turn was not permitted to run, so there is nothing to read. It is recorded distinctly in the audit trail from a failure the agent declared itself, because one is a budget you can raise and the other is the agent saying it cannot do the work.
What a task cost
Every task carries a running total of what it spent: input tokens, output tokens and model calls, recorded with each turn's outcome and accumulating across a pause and a resume. The total stays with the task, so it remains readable after the governance audit trail for those turns has been purged.
The Agents Monitoring screens show it: per task on the tasks grid, and rolled up per agent, for the window being viewed, on the agents grid. The agent's lifetime total is a different figure, shown on the Agent Directory.
One thing to know when you plan an agent's access: a hosted agent's tools are gated by the caller's own identity — their issuer, roles, scopes, groups and claims — so two callers with the same claims see the same tools. If you need to keep an agent's capability away from some callers, express that on their identity (a scope, a role, a group).
Triggering A Hosted Agent
An A2A caller is one way to start a hosted agent. Three more need no conversation:
| Started by | Runs as | Details |
|---|---|---|
| A schedule: every few minutes, at set times on chosen days, or a cron expression, in a chosen time zone | The trigger's run identity | Scheduled Runs |
| A webhook: another system posts an event to the trigger's URL, signed or with a bearer token | The trigger's run identity, never the sender | Webhooks |
| On demand: an application calls the Runtime, or an operator uses Run… in the Agent Directory | The caller | On-Demand Runs |
A run identity is an application API key or an OAuth client-credentials application that a scheduled or webhook run acts as. The agent's access policies decide what it may use, exactly as for an A2A caller with the same claims. Run identities are managed under Security → Agent Run Identities. See Run Identities.
A trigger's instructions, its parameters and a webhook's body reach the agent as parts of its message, read as described in What the agent reads from a message. They never change the agent's system prompt.
Every run is recorded as an execution, A2A turns included. An execution records how the run was started, its
status, why it ended, how long it took and what it spent. The history of every channel is on Apps & Tools → Agent
Triggers, where triggers are also created and edited. Cancelling an A2A task with CancelTask cancels its
execution too. See Monitoring Agent Runs.
Working With Other Agents
A skill can name other agents as well as tools. During a turn, the agent can ask one of them for help, read its answer and carry on. The other agent can be hosted on this platform or a remote agent registered in the Agent Directory.
Configuring a collaborator
- Open the hosted agent in Apps & Tools → Agent Directory and go to its Skills tab.
- In a skill, under Collaborating agents, select the agents this skill may ask. The list holds every other active agent of the tenant, hosted or remote; the search box above it finds one by name or description. An agent can't be its own collaborator.
- Choose Save skill.
The platform refuses a configuration that would loop, such as an agent that asks another agent which asks the first one
back. The error names the whole loop, for example Front Desk → Contracts → Front Desk.
The model sees each collaborator as a tool named agent_ask_…. Its description holds only text an administrator wrote:
- for a hosted collaborator, its name, its description and its skills;
- for a remote collaborator, its name and description from the Agent Directory, plus the card skills you approved (see Approving a remote agent's skills).
The agent's instructions tell it to treat a collaborator's answer as information to check, never as instructions. If a collaborator asks a question, the agent answers it by calling the collaborator again with the same task, and turns to its own caller only when it can't answer itself.
A question is the only thing the agent can answer this way. If a remote collaborator asks for authorization instead, the
agent is told that it can't provide it and finishes without that collaborator: credentials come from the collaborator's
authentication profile in the Agent Directory, never from the model. The delegation is recorded as auth-required, and
a warning is logged so you can check that profile. The same applies to a remote task that ends without a result the
platform can follow: the agent is told to go on without it.
Who the collaborator sees
A delegation runs on behalf of the original caller, never as the delegating agent. The collaborator applies its own access policies to that caller, exactly as it would to the same caller calling it directly.
- A hosted collaborator gives the caller only the skills and tools its policies allow for them.
- A remote collaborator is reached only when the caller passes its access policy in the Agent Directory. It's then called with its own authentication profile, as any relayed call is.
- A scheduled or webhook run delegates as its run identity.
So configuring a collaborator never gives a caller more than they could reach directly. A caller who may not use a skill
doesn't get that skill's collaborators either. A collaborator the caller may not reach is left out of the turn and
listed with the run's withheld tools as agent: {name}.
Check identity in the trigger editor lists each skill's collaborators and whether a run could reach them.
Limits
Every delegation is bounded. Each limit has a deployment default and a hard maximum. A hosted agent can override any of them under Delegation limits on its Details tab. Leave a field blank to use the default; you can't go above the maximum.
| Limit | Default | Maximum | What it bounds |
|---|---|---|---|
| Max delegation depth | 3 | 5 | How many agents deep a chain may go below this agent. Along a chain the strictest setting wins, so an agent set to 1 never starts a deeper chain, even when an agent allowing 3 calls it |
| Max delegations per turn | 8 | 50 | How many times one turn may ask another agent. Further requests are refused, and the model is told so |
| Delegation timeout (seconds) | 180 | 300 | How long one request to another agent may take, and never more than what is left of the agent's own turn |
| Max answer characters | 32,000 | 200,000 | The longest answer handed back to the model. A longer one is cut, and the model is told it was |
Operators set the defaults and maximums under HostedAgents:Delegation, with the same values on the Portal API and
the Runtime:
"HostedAgents": {
"Delegation": {
"DefaultMaxDepth": 3, "HardMaxDepth": 5,
"DefaultMaxDelegationsPerTurn": 8, "HardMaxDelegationsPerTurn": 50,
"DefaultTimeoutSeconds": 180, "HardMaxTimeoutSeconds": 300,
"DefaultMaxAnswerCharacters": 32000, "HardMaxAnswerCharacters": 200000
}
}
A host doesn't start with a default above its own maximum.
What a collaborator spends counts against its own task's token ceiling, not the delegating task's. A collaborator can never end its caller's task by spending.
If a collaborator has a Max concurrent executions limit and no slot is free, the request isn't queued. The model is told the collaborator is busy and can try again or carry on without it.
A run that asked another agent is never retried automatically. The other agent may have called tools that change data.
Loops through other systems
Inside the platform, an agent already in a chain is never offered again. A remote agent configured to call one of your
agents back could still start a loop, so every message the platform sends to another agent carries a
delegation-chain marker. The marker is an A2A extension, https://codedprojects.com/a2a/extensions/delegation-chain/v1.
It holds the chain's id, its depth and a one-way hash of each agent already in it, never an agent's name or address.
An incoming message whose marker already lists the receiving agent is refused as a delegation loop. One deeper than the receiving agent allows is refused as too deep. Each of your agents' Agent Cards declares the extension as optional, and nothing is required of a caller that doesn't send it.
The marker only helps when the remote agent passes it on. For a third-party agent that drops it, give any agent that is both called from outside and calls out a Max concurrent executions limit.
Approving a remote agent's skills
A remote agent's Agent Card is refreshed automatically, with no review, so its text can change at any time. A model reads a tool's description almost as an instruction, so the platform never shows it live card text.
On the remote agent's Details tab, under Skills delegating agents are told about, select the card skills to approve and choose Approve selection. The platform saves the text of each skill as the card states it at that moment, with who approved it and when. Delegating agents see that saved text and nothing else from the card. With nothing approved, they see only the agent's name and description from the Agent Directory.
When the card later changes or removes an approved skill, the tab flags it as Changed since approved, or lists it as no longer on the card. Delegating agents keep seeing the approved text until you approve again. A new skill on the card is never shown to a model until you approve it.
Approving narrows what a delegating model is told, not what the remote agent does. An A2A message names no skill, and the remote agent chooses its own.
Removing an agent other agents use
An agent other skills name can't be deleted. Its Used by tab lists every skill that delegates to it, with Remove link on each. If you try to delete it, the confirmation shows the same list. Remove the links, then choose Try again. You can also deactivate the agent instead. Skills that still name an inactive agent no longer offer it, and their runs say so.
Reading a delegated run
A run started by another agent has the channel Agent. On the run page:
- Overview shows Delegated by, with a link to the run that asked, and how deep in the chain this run is. It also lists the runs this one delegated to, each with a link.
- Conversation shows each delegation under the model call that asked for it: the agent asked, how the request ended, how long it took, and a link to the run it started. A request that never reached its agent says why.
Every delegation is audited as a2a.agent.delegate, without the message or the answer, and appears in Call Flow. What
a collaborator was told and answered is in its own run, behind Record transcript as for any run.
Functional Value
A caller talking to a hosted agent gets a genuine back-and-forth instead of an all-or-nothing call: the LLM judges whether the caller gave enough information, and it has no capability outside the exact governed tools an administrator curated for it.