Skip to main content
Glama

ZeroTrust AI Broker (zt-broker)

CI License: Apache-2.0 Python 3.12 Bronze: PASS Audit: PASS

An open-source, inline Zero Trust MCP security broker built for ZeroTrust AI: Securing the Agentic Enterprise (Techfest 2026-27, IIT Bombay × Zscaler).

30-Second Summary

zt-broker sits inline (0.0.0.0:8200/mcp) between 5 autonomous AI agents and 26 enterprise tools, answering one question for every call:

"Can this agent be trusted to perform this action on this resource right now—and can we enforce, explain, and prove that decision?"

  • Least-Privilege Policy + Zero-Restart Hot Reload: Per-agent YAML policies (policies/agents/*.yaml) with JSON Schema validation, dry-run checks, atomic swap via watchfiles / POST /admin/reload, and resource_agent_allowlist for instant Round 3 restrictions.

  • 5 Timeout-Isolated Parallel Detectors: Direct prompt injection (multilingual heuristics + quantized CPU ONNX classifier), indirect injection response sanitizer, DLP (MOD-97 IBAN, Luhn PAN, PII, secrets, session-harvested values), sanitized-aware session taint tracking, and tool-abuse/payment-diversion detection.

  • Graded Explainable Decisions + Adaptive Trust: Outputs ALLOW, MONITOR, STEP_UP, or BLOCK with cited rule IDs, signals, trust/risk scores, and remediation.

  • Tamper-Evident Audit Trail: Write-ahead fsynced JSONL with SHA-256 hash chain, Ed25519 signatures, and atomic .head truncation anchor (broker-audit verify).

Related MCP server: production-mcp-server

Architecture

Architecture Diagram

Full C4 diagrams and outcome sequence flows: docs/ARCHITECTURE.md.

One-Command Quickstart & Demo

Prerequisites: Python 3.12, uv, and sentinel-sandbox at ../sentinel-sandbox (with uv sync run in both).

# Install dependencies & fetch/verify quantized ONNX model (Apache-2.0)
make setup

# Run the complete ONE-command end-to-end demo (sandbox + broker + all 4 decisions + tamper check)
make demo

Reproduce Bronze Milestone & Audit Verification

# Runs sentinel tools + zt-broker + sentinel check --suite bronze + sentinel audit test
make bronze

# Verify any audit log manually (exits 0 if intact, non-zero with first bad seq on tamper)
uv run --no-sync broker-audit verify audit/bronze_audit.jsonl

# Export SIEM-ready ECS JSON
uv run --no-sync broker-audit export audit/bronze_audit.jsonl --format ecs

Run SOC Dashboard (Out-of-Band)

uv sync --extra dashboard
uv run --no-sync streamlit run src/zt_broker/dashboard/app.py

Key Evaluation Metrics (135 Replay Runs vs. Passthrough Baseline)

Metric

Passthrough Baseline

zt-broker v1.0.0

Identity Probes Refused

N/A

3 / 3

benign_utility

1.000

1.000 (15/15)

false_block_rate

0.000

0.000 (0/15)

attack_success_rate (FNR)

1.000 (120/120)

0.000 (0/120)

utility_under_attack

1.000

0.933 (112/120)

step_up_rate (Benign)

0.000

0.000

decision_mismatch_runs

0

0

latency_p50_ms (end-to-end MCP hop)

24.85 ms

48.18 ms (+23.33 ms)

Custom Red-Team Corpus (16 cases)

—

100.0% detected

Benign-Suspicious Corpus (12 cases)

—

0.0% false blocks

sentinel audit test (modify/delete/insert/reorder/truncate)

—

AUDIT: PASS (0 missing)

Environment Variables

Variable

Default

Description

SENTINEL_BROKER_TOKEN

""

Upstream tool-server bearer credential (never exposed to agents)

SENTINEL_UPSTREAM_URL

http://127.0.0.1:8100/mcp

Upstream Sentinel MCP server URL

SENTINEL_APPROVER_URL

http://127.0.0.1:8102/approve

Step-up approver endpoint (empty disables -> fail closed)

SENTINEL_CATALOG_DIR

Auto-resolved

Directory containing agents.yaml, resources.yaml, tools.yaml

SENTINEL_BROKER_HOST

0.0.0.0

Broker listen host

SENTINEL_BROKER_PORT

8200

Broker listen port (/mcp, /healthz, /readyz, /metrics, /admin/reload)

ZT_POLICY_DIR

policies

Policy YAML root directory

ZT_AUDIT_LOG_PATH

audit/audit.jsonl

Append-only JSONL audit log path (mount volume in Docker)

ZT_AUDIT_SIGNING_KEY

Ephemeral if unset

Ed25519 private key (PEM / hex / URL-safe base64)

ZT_AUDIT_PUBLIC_KEY

Embedded in .head

Optional pinned Ed25519 public key for broker-audit verify

ZT_RELOAD_TOKEN

""

Bearer secret protecting POST /admin/reload

ZT_MODEL_PATH

models/prompt_guard.onnx

Local pre-quantized ONNX model path

ZT_CLASSIFIER_ENABLED

true

Toggle ONNX classifier (degrades gracefully to heuristics)

ZT_DETECTOR_TIMEOUT_MS

2000

Per-detector timeout in milliseconds

ZT_ONNX_THREADS

2

Intra-op CPU threads for ONNX Runtime

Container Build & Run

docker build -t zt-broker:latest .
docker run --rm -p 8200:8200 --read-only --tmpfs /tmp \
  -v "$(pwd)/audit:/data/audit" \
  -v /path/to/catalog:/catalog:ro \
  -e SENTINEL_BROKER_TOKEN="$(cat ../sentinel-sandbox/.sentinel/broker.token)" \
  -e SENTINEL_UPSTREAM_URL=http://host.docker.internal:8100/mcp \
  -e SENTINEL_APPROVER_URL=http://host.docker.internal:8102/approve \
  -e SENTINEL_CATALOG_DIR=/catalog \
  zt-broker:latest

(Docker runtime image zt-broker:latest (367 MB) uses python:3.12-slim-bookworm + non-root UID 10001 + baked 256 MB INT8 ONNX weights; verified with docker build and docker run --read-only --tmpfs /tmp against sentinel check --suite bronze (BRONZE: PASS) and sentinel audit test (AUDIT: PASS).)

Documentation Index

Submission Tag / Commit: See git rev-parse HEAD / tag v1.0.0-submission.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Governed MCP gateway that lets AI agents call tools with policy enforcement, prompt-injection screening, a kill-switch, and tamper-evident signed audit logs.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to safely call enterprise tools through a governed MCP gateway with permission enforcement, blast-radius controls, input validation, and a full audit trail for every invocation.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to reach upstream MCP tool servers through a central policy gateway that authenticates each agent, enforces least-privilege and default-deny rules, and applies response obligations such as redaction, inference stripping, PII masking, and truncation. It also records every decision in a tamper-evident, hash-chained audit log that can be verified later.
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI clients to call upstream MCP tools under each user's own identity, with guardrails, approvals, data filtering, and tamper-evident audit streaming to SIEM.
      AGPL 3.0