⚡ Fast MCP JSON-RPC inspector & multi-turn agent latency benchmark in Rust
1
stars
0
commits
Rust
primary language
Sep 6, 2026
updated
The In-VPC Runtime Security Gateway for Enterprise AI Agents — Stop destructive tool calls in microseconds. Sabrix applies strict systems discipline to govern autonomous agent traffic with zero third-party data egress.
Sabrix is a pure-Rust, zero-allocation runtime security gateway that inspects Model Context Protocol (MCP) tool arguments and prompt streams in real-time. It completely eliminates the latency tax (25-120ms) and data-leak liabilities of external SaaS AI firewalls, offering a 1.88 µs P50 latency ceiling for high-concurrency agent workflows.
Included in this repository is the sabrix-bench CLI utility, an open-source benchmarking tool designed to measure pure client-visible HTTP & Server-Sent Events (SSE) streaming metrics against any AI proxy, firewall, or LLM gateway.
While traditional web benchmark tools (wrk, vegeta) only measure total request duration ($t_{\text{total}}$), sabrix-bench measures exactly what matters for conversational AI agents:
cargo install sabrix-bench
cargo install --git https://github.com/Pro-Kla/sabrix-bench
sabrix-bench run — Live HTTP/SSE Gateway BenchmarkBenchmark any external endpoint with concurrent workers and streaming SSE chunk evaluation:
# Benchmark local gateway with 50 parallel connections
sabrix-bench run --target http://localhost:8080/v1/chat/completions --concurrency 50 --requests 500
# Benchmark with embedded Enterprise RAG test corpus (50 prompts)
sabrix-bench run --target http://localhost:8080/v1/chat/completions --suite rag --concurrency 25 --requests 100
# Benchmark with OWASP LLM Top-10 & safety test suite
sabrix-bench run --target http://localhost:8080/v1/chat/completions --suite owasp --concurrency 20
# Export standalone zero-dependency dark-mode HTML report & JSON telemetry
sabrix-bench run \
--target http://localhost:8080/v1/chat/completions \
--concurrency 50 \
--requests 1000 \
--export-html benchmark_report.html \
--export-json metrics.json
# Pass custom authentication or routing headers
sabrix-bench run \
--target https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
--concurrency 10 \
--requests 50
sabrix-bench trace — Real-Time MCP Tool-Call Security InspectorInspect JSON-RPC 2.0 requests (tools/call, resources/read) in sub-microsecond ($< 1\ \mu\text{s}$) latency and detect security violations (destructive shell commands, SQL mutations, credential leaks, path traversal):
# Run built-in demo scenarios
sabrix-bench trace --demo
# Inspect inline JSON payload
sabrix-bench trace -p '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "bash_exec",
"arguments": { "cmd": "rm -rf /data/customers" }
}
}'
# Pipe from stdin
cat mcp_payload.json | sabrix-bench trace
sabrix-bench compare — Multi-Turn Agent Latency SimulatorCalculate compounding latency penalties across multi-turn autonomous agent loops ($20$–$50$ turns) comparing In-Process safe-Rust evaluation vs. remote SaaS network roundtrips:
# Compare a 30-turn agent loop against a 120ms SaaS network baseline
sabrix-bench compare --turns 30
# Show architectural comparison matrix
sabrix-bench compare --matrix
sabrix-bench embeds standard test datasets directly inside the compiled binary:
--suite simple: 10 low-overhead baseline health and connectivity prompts.--suite rag: 50 enterprise RAG prompts of varying lengths ($1\text{KB}$ to $32\text{KB}$) for saturation and throughput benchmarking.--suite owasp: 50 standardized security probes (prompt injection, sensitive path reads, secret leakage, SQL drops) and benign control prompts.--payload <file.json>: Custom user JSON request payloads.Dual licensed under MIT or Apache 2.0.
Rust
93.6%
Shell
6.4%
⚡ Fast MCP JSON-RPC inspector & multi-turn agent latency benchmark in Rust
1
stars
0
commits
Rust
primary language
Sep 6, 2026
updated
The In-VPC Runtime Security Gateway for Enterprise AI Agents — Stop destructive tool calls in microseconds. Sabrix applies strict systems discipline to govern autonomous agent traffic with zero third-party data egress.
Sabrix is a pure-Rust, zero-allocation runtime security gateway that inspects Model Context Protocol (MCP) tool arguments and prompt streams in real-time. It completely eliminates the latency tax (25-120ms) and data-leak liabilities of external SaaS AI firewalls, offering a 1.88 µs P50 latency ceiling for high-concurrency agent workflows.
Included in this repository is the sabrix-bench CLI utility, an open-source benchmarking tool designed to measure pure client-visible HTTP & Server-Sent Events (SSE) streaming metrics against any AI proxy, firewall, or LLM gateway.
While traditional web benchmark tools (wrk, vegeta) only measure total request duration ($t_{\text{total}}$), sabrix-bench measures exactly what matters for conversational AI agents:
cargo install sabrix-bench
cargo install --git https://github.com/Pro-Kla/sabrix-bench
sabrix-bench run — Live HTTP/SSE Gateway BenchmarkBenchmark any external endpoint with concurrent workers and streaming SSE chunk evaluation:
# Benchmark local gateway with 50 parallel connections
sabrix-bench run --target http://localhost:8080/v1/chat/completions --concurrency 50 --requests 500
# Benchmark with embedded Enterprise RAG test corpus (50 prompts)
sabrix-bench run --target http://localhost:8080/v1/chat/completions --suite rag --concurrency 25 --requests 100
# Benchmark with OWASP LLM Top-10 & safety test suite
sabrix-bench run --target http://localhost:8080/v1/chat/completions --suite owasp --concurrency 20
# Export standalone zero-dependency dark-mode HTML report & JSON telemetry
sabrix-bench run \
--target http://localhost:8080/v1/chat/completions \
--concurrency 50 \
--requests 1000 \
--export-html benchmark_report.html \
--export-json metrics.json
# Pass custom authentication or routing headers
sabrix-bench run \
--target https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer sk-..." \
--concurrency 10 \
--requests 50
sabrix-bench trace — Real-Time MCP Tool-Call Security InspectorInspect JSON-RPC 2.0 requests (tools/call, resources/read) in sub-microsecond ($< 1\ \mu\text{s}$) latency and detect security violations (destructive shell commands, SQL mutations, credential leaks, path traversal):
# Run built-in demo scenarios
sabrix-bench trace --demo
# Inspect inline JSON payload
sabrix-bench trace -p '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "bash_exec",
"arguments": { "cmd": "rm -rf /data/customers" }
}
}'
# Pipe from stdin
cat mcp_payload.json | sabrix-bench trace
sabrix-bench compare — Multi-Turn Agent Latency SimulatorCalculate compounding latency penalties across multi-turn autonomous agent loops ($20$–$50$ turns) comparing In-Process safe-Rust evaluation vs. remote SaaS network roundtrips:
# Compare a 30-turn agent loop against a 120ms SaaS network baseline
sabrix-bench compare --turns 30
# Show architectural comparison matrix
sabrix-bench compare --matrix
sabrix-bench embeds standard test datasets directly inside the compiled binary:
--suite simple: 10 low-overhead baseline health and connectivity prompts.--suite rag: 50 enterprise RAG prompts of varying lengths ($1\text{KB}$ to $32\text{KB}$) for saturation and throughput benchmarking.--suite owasp: 50 standardized security probes (prompt injection, sensitive path reads, secret leakage, SQL drops) and benign control prompts.--payload <file.json>: Custom user JSON request payloads.Dual licensed under MIT or Apache 2.0.
Rust
93.6%
Shell
6.4%