Message length: yes
The classifier reads text in 256-token windows, so a 500-character tool result costs several times a short question.
Measured on 41,520 guard calls replayed from 109 real agent repositories, and against other guards on the same machine.
Engine time on a laptop CPU with no GPU. The network and the agent's own model are excluded.
Every guard ran on the same 880 messages, on the same laptop CPU, one request at a time. AgentFox runs five kinds of check in about the time the others take for one.
Base-size models (AgentFox's classifier, the one in LLM Guard's scanner, Prompt Guard 2 86M) all take about 50 ms. AgentFox adds an HTTP round trip and its deterministic checks, 7.4 ms on their own. Its default checks take 63.1 ms, against 56.1 ms for LLM Guard's prompt-injection scanner, which looks for injection only.
| System | Checks for | Short messages, p50 / p95 (ms) | Long messages, p50 / p95 (ms) |
|---|---|---|---|
| AgentFox deterministic | PII, secrets, injection patterns, unsafe content, schema, unicode, insecure code | 7.4 / 9.1 | 11.7 / 38.9 |
| AgentFox default | The above, plus injection and jailbreaks by classifier | 63.1 / 77.6 | 117 / 412 |
| AgentFox default, cache on | Same | 60.1 / 67.2 | 104 / 401 |
| AgentFox extended | The above, plus similarity to known attacks | 71.0 / 89.0 | 126 / 464 |
| AgentFox with LLM judges, default mode | The above, plus injection and PII judged by gpt-4.1-mini when a rule relies on it | 74.1 / 98.5 | 122 / 356 |
| AgentFox with LLM judges always inline | Same, judged on every check | 865 / 1,093 | 879 / 1,448 |
| LLM Guard, prompt-injection scanner | Prompt injection | 56.1 / 66.2 | 90.7 / 218 |
| Meta Prompt Guard 2 86M | Prompt injection and jailbreaks | 54.4 / 62.6 | 86.8 / 209 |
| Meta Prompt Guard 2 22M | Prompt injection and jailbreaks | 25.5 / 29.9 | 48.4 / 106 |
| Guardrails AI, DetectJailbreak | Jailbreaks | 99.4 / 107 | 149 / 325 |
| LLM Guard, nine default scanners | Injection, PII, secrets, toxicity and five more | 249 / 316 | 348 / 650 |
| OpenAI omni-moderation (hosted) | Harm categories, not injection | 387 / 484 | 395 / 509 |
| NeMo Guardrails, self-check (gpt-4.1-mini) | One LLM policy check | 758 / 1,049 | 787 / 1,201 |
On long messages AgentFox reads the first 4,000 characters, where the others stop at 512 tokens. It does more work there, at a p95 of 412 ms, and reads every message to the end. With every LLM judge inline, AgentFox is about 100 ms slower than NeMo's single self-check, because its judge answers three questions where NeMo asks one. By default a judge only waits inline when an enforcing rule relies on it.
Each repository was mapped with agentfox init, and its own agents, tools and handoffs drove the traffic: single turns, five-turn sessions and multi-agent handoffs, through the same endpoints the SDK calls.
| Layer | What runs | Per check, p50 / p95 (ms) | Per single-agent turn, p50 (ms) |
|---|---|---|---|
| Deterministic | Patterns, PII, secrets, schema, unicode and code checks | 2.3 / 6.4 | 8.8 |
| Default | Deterministic + ML prompt-injection classifier | 57.4 / 302 | 179 |
| Extended | Default + similarity search against known attacks, score cache on | 9.9 / 276 | 77.1 |
| With an LLM judge | Extended + injection and PII judged by gpt-4.1-mini | 76.5 / 1,009 | 1,086 |
Tool calls are the cheapest step in every layer, 3.1 ms at the median with the default detectors. Text the classifier has to read (inputs, tool results, replies) is where the time goes. A single turn makes four guard calls, summed in the last column.
Extended's median is lower than Default's because it was measured with the score cache on, so text the classifier has already scored is not read again. The similarity search itself adds only a few milliseconds over Default with the cache on (benchmarks/latency/README.md).
Messages under 200 characters take 54.5 ms at the median and 83.5 ms at p95. Between 200 and 600 characters they take 188 ms and 374 ms, because longer text gets a 1,000 ms budget so the classifier can finish reading it. Replies with judges on pay the commitment check, about 0.88 s.
The classifier reads text in 256-token windows, so a 500-character tool result costs several times a short question.
A hosted guard pays the network on every call. From Bengaluru to a US region that is about 310 ms before any check runs. Run the gateway next to the agent.
Per-check latency is flat from the first turn of a session to the fifth.
LangGraph, CrewAI, AutoGen, the OpenAI Agents SDK, ADK and the rest land within a few milliseconds of each other per check.
Few vendors publish latency, and fewer say under what conditions. Azure Prompt Shields, AWS Bedrock Guardrails, Google Model Armor, OpenAI Moderation, Llama Guard and Guardrails AI publish none. These are the figures we found, as their authors state them.
| Product | Published latency | Conditions |
|---|---|---|
| Protect AI LLM Guard, injection scanner | 104 ms mean / 107 ms p95 (ONNX) | AWS m5.xlarge CPU, 384-token input |
| Meta Prompt Guard 2 | 86M: 92.4 ms; 22M: 19.3 ms | A100 GPU, 512 tokens |
| Lakera Guard | p95 50 ms to 300 ms | 1 to 16 detectors, about 1k to 5k characters |
| NVIDIA NeMo Guardrails | about 0.5 s added per chat turn | Three rails, GPU microservices |
| Palo Alto Prisma AIRS | about 700 ms added | Network firewall intercept mode |
Every recorded call, the scripts and the head-to-head harness are in benchmarks/latency.
uv run python -m benchmarks.latency.fetch_repos var/latency/reposuv run python -m benchmarks.latency.map_repos var/latency/repos var/latencyuv run python -m benchmarks.latency.run_latency var/latency/maps var/latency/runuv run python -m benchmarks.latency.report var/latency var/latency/results run@misc{agentfox_latency_benchmark_2026,
title = {What a guard check adds to an agent: latency on 109 agent repositories},
author = {{Nometria}},
year = {2026},
howpublished = {\url{https://useagentfox.com/benchmark/latency}},
note = {Scripts and results files: https://github.com/architsharm/agentfox}
}One command finds your agents. It starts in watch mode, so nothing is blocked until you say so.
uvx agentfox scan