Operating Agent Link Entrypoints

This feature is in the Early Access stage and under active development. Configuration schemas and behavior are subject to change. We recommend that you do not use this feature in production environments.

This page covers what to consider when you operate an Agent Link Entrypoint after its link agents connect. For how the entrypoint works and how to connect an agent to it, see Agent Link Entrypoints (Early Access).

Changing Link Agents

For a link agent that the Platform service manages, a change takes effect when the link agent is deployed again, which sam config apply does. The entrypoint applies each change in place, and the link agents that the change does not name stay connected:

  • An added link agent can connect as soon as its deployment completes.

  • A changed link agent is disconnected and reconnects with its new settings. Its open tasks end as follows:
    • A task that the agent had not acknowledged is delivered again when the agent reconnects.

    • A task that the agent had acknowledged and not answered fails with a message that asks the caller to send it again.

  • When you replace a link agent's token, the change counts as a change to the link agent. The previous token stops working when the deployment completes, so give the agent its new token.

  • An undeployed or deleted link agent is disconnected, and each of its open tasks fails. The Platform service then deletes the agent's queues.

For a changed link agent built with the Link SDK, the first case applies. The Link SDK acknowledges a task when it sends the task's answer, so a task that the agent was still running is delivered again.

To replace the token of a link agent that the Platform service manages, see The Token Digest.

A change to one of the entrypoint's own limits takes effect when you deploy the entrypoint again, which restarts it and disconnects every link agent on it.

For an agent in a runtime configuration file, the entrypoint reads its agents when the Entrypoint Executor starts. You must restart sam run --embedded after you add, remove, or disable an agent, rotate its token, or change its peers or wake block. For more information about what a restart interrupts, see Restarts.

To rotate the token of an agent in a runtime configuration file, perform these steps:

  1. Issue a new token with sam-link-sdk link-token --out <new-file>, where <new-file> does not exist yet.

  2. Set the new digest in the variable that the agent's token_sha256 names, for example CLAIMS_ASSISTANT_TOKEN_SHA256 in .env.

  3. Restart sam run --embedded.

  4. Restart the agent with SAM_LINK_TOKEN_FILE set to the new file.

Each agent has one digest, so the agent cannot connect between steps 3 and 4.

Running Several Entrypoint Executor Replicas

Only one Entrypoint Executor replica serves link agents at a time: the replica that Agent Mesh elects as the leader among the Entrypoint Executor processes of a namespace. The other replicas answer each connection with HTTP 503 and a Retry-After header.

The Link SDK handles HTTP 503 as follows:

  • It waits for the Retry-After delay, about 1 second, and tries again up to 30 times before it backs off.

  • A request-driven agent that was woken stops trying after about 20 seconds.

Behind a load balancer with no session affinity, the agent therefore reaches the serving replica within a few attempts. Consider the following when you put a load balancer in front of the replicas:

  • Turn off session affinity on the connect path. An agent pinned to a replica that does not serve link agents never reaches the one that does.

  • Configure health checks so that they do not probe the connect path, or so that they treat HTTP 503 as healthy.

When the serving replica changes, it closes the connection of every link agent, and the agents reconnect to the new serving replica. A task that an agent was still running is delivered again by the new serving replica, and the Link SDK answers it then. The open approval requests, questions, and peer calls of that task are canceled.

Where the entrypoint runs depends on where you configure it:

  • An entrypoint that you create on the Platform service runs on every Entrypoint Executor replica.

  • An entrypoint in a runtime configuration file runs only in the processes that load the file. The election still covers every Entrypoint Executor process in the namespace, including processes that do not run the entrypoint.

If two or more sam run --embedded processes share a Solace event broker and a namespace, add the runtime configuration file to every one of them. Otherwise, a process without the entrypoint can be elected, and every process that has the entrypoint answers every connection with HTTP 503.

Restarts

A restart of the Entrypoint Executor that serves link agents closes the connection of every link agent. The restart also loses the following state:

  • open approval requests and questions, so an answer that a user gives after the restart does not reach the agent

  • the agent's open calls to other agents, which the Link SDK waits on until they time out

  • answers held for an agent that had disconnected

What happens to the tasks waiting in an agent's queue depends on the event broker:

  • With the in-memory event broker, which sam run --embedded uses when you configure no event broker, the restart discards every task waiting in an agent's queue, so a task that an agent had not answered gets no answer.

  • With a Solace event broker, tasks that an agent has not answered return to its queue, and the entrypoint delivers them again when the agent reconnects. The Link SDK keeps running such a task and answers it then.

Network Access

Agents connect to wss://<agent-mesh-host>/gw/<gateway_id>/v1/connect. The load balancer or ingress in front of the Entrypoint Executor must pass WebSocket upgrades on that path.

The entrypoint sends a ping every 20 seconds and closes a connection when it receives neither a message nor a reply to a ping from the agent for 60 seconds. Set the idle timeout of every proxy and load balancer between the agent and the Entrypoint Executor above 60 seconds, so that they do not close connections that the entrypoint keeps open.

The entrypoint refuses a connection that carries an Origin header, so web browsers cannot connect.

The Link SDK refuses a plain ws:// URL to a host other than localhost or a loopback address unless you set SAM_LINK_ALLOW_INSECURE to 1, true, or yes, so use wss:// with TLS.

If the Entrypoint Executor uses a certificate from a private certificate authority (CA), set SAM_LINK_TRUST_STORE_PATH where the agent runs to a CA file or a directory of privacy enhanced mail (PEM) CA certificates.

Event Broker Permissions

The client profile and Access Control List (ACL) profile of the entrypoint's event broker username must allow the following for each link agent, where <ns> is the namespace and <agent> is the name that the agent connects as:

  • Creating and consuming the durable queue <ns>/q/a2a/<agent>, with a subscription to the agent's request topic <ns>/a2a/v1/agent/request/<agent>.

  • Creating and consuming the durable queue <ns>/q/agentlink/wake/<agent> for an agent with a wake block, with the same subscription. For a link agent that the Platform service manages, the entrypoint also deletes this queue when the agent no longer has a wake block.

  • Subscribing directly to the agent's request topic <ns>/a2a/v1/agent/request/<agent>, its peer response and status topics <ns>/a2a/v1/agent/response/<agent>/> and <ns>/a2a/v1/agent/status/<agent>/>, and its control topic <ns>/sam/v1/control/patch/apps/<agent>/instances/<agent>.

  • Publishing agent cards to <ns>/a2a/v1/discovery/agentcards, and peer calls to the request topics of the agent's peers, <ns>/a2a/v1/agent/request/<peer>.

  • Publishing answers and status events to the reply and status topics of the callers in Agent Mesh: <ns>/a2a/v1/gateway/response/>, <ns>/a2a/v1/gateway/status/>, <ns>/a2a/v1/agent/response/>, and <ns>/a2a/v1/agent/status/>.

  • Publishing token usage records to <ns>/sam/v1/governance/spend.

  • Publishing to <ns>/sam/v1/control/get/apps/platform/agent-control/<agent>, and publishing and subscribing to <ns>/sam/v1/control/reply/>, which the entrypoint uses for agent control requests and their replies.

The Platform service deletes the queues of a link agent that it undeploys. For an agent in a runtime configuration file, the entrypoint does not delete these queues when you remove the agent from the file. Delete the agent's queues by name on the Solace event broker, in Broker Manager or with the Solace Element Management Protocol (SEMP). For more information about queues and namespaces, see The Event Mesh Communication Layer.

Link Agent Trust Boundaries

The entrypoint checks every message a link agent sends, but it does not verify the following content that the agent reports:

  • The token counts the agent reports for each model call, and the model name that Agent Mesh prices them by. The entrypoint refuses a model call that reports more than 10,000,000 tokens of any one kind, or that takes the task's input and output tokens past 100,000,000.

  • The text, files, and data of the agent's answers, and its streamed text and progress messages.

  • What the agent's card says about it, including its description, skills, framework, and owner claims. Agent Mesh publishes the owner and team that you configure on the agent card, separately from what the agent declares.

  • The tool scopes the agent describes for its own tools. The entrypoint tells the agent which of those scopes the task's user holds, but it does not see the agent's tool calls before they run, so the agent must enforce those scopes itself.

The framework adapters in the Link SDK hide a scoped tool from users who lack its scopes and refuse calls to it. Scopes that the agent requires for the whole agent, which it declares in required_scopes in AgentConfig, are different: the entrypoint enforces them before it delivers a task.

A link agent's tools cannot use the user-delegated sign-in of Agent Mesh, because the agent never receives the user's token. A tool that must act as the user against a third-party API belongs on an agent in the Agent-Workflow Executor, which the link agent can reach as a peer. For more information about user-delegated sign-in, see Secure User-Delegated Tool Access.

Approval requests and questions from a link agent appear only in the channel where the task started. Agent Mesh does not send them through the notification service to Slack, Microsoft Teams, or the in-app inbox, as it does for agents in the Agent-Workflow Executor. When the task came from an entrypoint that cannot show an approval request or a question, such as a Model Context Protocol (MCP), Webhook, or Event Mesh Entrypoint, the Agent Link Entrypoint answers each of the agent's approval requests and questions as canceled immediately.

Auditing

The entrypoint writes an authentication audit event for every accepted connection and for every connection it refuses because of invalid credentials, a disabled agent, the connection rate, the connection limit, or the WebSocket subprotocol. The user in each event is agent:<name>. For more information, see Managing Audit and Compliance.

Next Steps

From here, you can: