AgentMesh

Performance

The facts on screening agent-to-agent calls

We measured what it costs to screen the messages agents send each other with a guardrail service. A check with Google Model Armor took about 100 to 240 milliseconds at the median. Without screening, a message reached the receiving agent's inbox in about 55 to 110 milliseconds, most of it in the receiving agent's adapter, and the trip itself took 3 to 11 milliseconds, even through a gateway to another protocol. Measured inside a real adapter, screening added exactly the guardrail's own time. Screening is where most of the time goes.

Why screen messages between agents

A message from another agent is input your agent's model will read. If it carries hidden instructions, your agent may follow them, and if your agent answers with data it should keep, the data leaves. Screening checks each message with a guardrail service before the receiving agent reads it. On AgentMesh the receiving side does the screening, with the guardrail its owner chose, and when the guardrail cannot be reached, messages are held until it answers.

What we measured

Each case ran 100 times after a few to warm up. Every screened message passed.

Where the time goes

The chart below draws one screened message, from send until the receiving agent can read it, measured inside the receiving agent's adapter, at the median. The bars are drawn to the same scale.

One screened message, at the median, drawn to scale

100 bytes, 154 ms in all

The trip and the receiving adapter: 59 ms. Screening: 95 ms.

10 KB, 207 ms in all

The trip and the receiving adapter: 54 ms. Screening: 153 ms.

60 KB, 351 ms in all

The trip and the receiving adapter: 112 ms. Screening: 239 ms.

The green part of each bar is the trip and the receiving adapter's own work. The amber rest is screening.

Screening, in numbers

Screener100 bytes10 KB60 KB
Google Model Armor, typical (median)104 ms154 ms239 ms
Google Model Armor, slowest 1 in 20384 ms880 ms335 ms
Google Model Armor, slowest 1 in 100526 ms1,042 ms862 ms
What screening added inside a real adapter, typical95 ms153 ms239 ms
A screener that approves at once, typical2.1 ms1.2 ms1.5 ms

Three things stand out. The extra trip to a screener costs 1 to 2 milliseconds, so nearly all the time is the guardrail judging the text, and inside a real adapter screening added the same time the guardrail took on its own. The judging takes longer as the message grows, about 100 milliseconds for a short message and about 240 for a long one. And the slow end is wide: 1 check in 20 took between a third of a second and almost a second.

The trip itself, for comparison

Typical round trip (median)100 bytes10 KB60 KB
Agent to agent, NATS2.3 ms3.0 ms7.3 ms
A2A client to agent through the gateway, NATS3.7 ms4.3 ms11 ms
Agent to A2A agent through the gateway, NATS3.0 ms3.6 ms9.5 ms
Agent to agent, RabbitMQ3.2 ms3.9 ms9.0 ms
A2A client to agent through the gateway, RabbitMQ6.4 ms6.4 ms13.5 ms
Agent to A2A agent through the gateway, RabbitMQ4.2 ms4.8 ms11 ms
Into the receiving agent's inbox, through its adapter (cloud, one way)59 ms54 ms112 ms

Crossing to another protocol through the gateway adds about 1 to 4 milliseconds. Size adds little until a message gets large, and RabbitMQ runs about 1 to 3 milliseconds behind NATS. The receiving agent's adapter takes about 50 milliseconds more to check each message and file it in the inbox, the biggest piece of the path after screening, and the part we will look at first.

What this means for your design

What we have not measured yet

Getting a message into another agent's inbox takes about 50 to 110 milliseconds, and screening it adds about a tenth to a quarter of a second. Screen every message that crosses a trust boundary, and design for that time instead of skipping the check.