How neuraltrust/trustgate works
TrustGate is a security-focused gateway for LLM, MCP, and A2A traffic, with a shared administration plane. The principal runtime flow authenticates an application or agent, applies routing and policy decisions, forwards requests to an upstream, and observes the result. Administration configures gateways, registries, consumers, identity, and policies; configuration can be synchronized to data planes. The README documents these plane-level relationships; sampled source confirms selected routing, admin-handler, and telemetry behavior, but not every internal connection shown here.
Main entry points: proxy_handler.go Proxy request handling · admin_router.go Admin API · dispatcher.go Config synchronization · proxy_router.go Proxy API
Components 25
Administration
- Admin dashboard
frontend/src/app/dashboard/page.tsx - Admin API
pkg/server/router/admin_router.go - Gateway and registry management
pkg/api/handler/http/registry/preview_agent_card_handler.go - Identity and key management
pkg/api/handler/http/store/llm_key_handler.go - Policy management
pkg/api/handler/http/policy/create_policy_handler.go - Provider and model catalog
pkg/app/catalog/service.go
LLM Proxy
- Proxy API
pkg/server/router/proxy_router.go - Proxy request handling
pkg/api/handler/http/proxy/proxy_handler.go - Model routing
pkg/app/proxy/routing.go - Policy stages
pkg/app/plugins/stages.go - Provider forwarding
pkg/app/proxy/forwarder.go
MCP and A2A
- MCP API
pkg/server/router/mcp_router.go - MCP tool aggregation
pkg/app/mcp/composer.go - A2A agent forwarding
pkg/app/a2a/forwarder.go
Shared Services
- Config synchronization
pkg/app/configsnapshot/dispatcher.go - Request identity
pkg/api/middleware/auth_chain.go - Telemetry pipeline
pkg/app/metrics/pipeline.go
Other components
- Applications
- MCP and A2A clients
- LLM providers
- MCP and OpenAPI services
- A2A agents
- Postgres
- Redis
- OTLP collectors
Connections 24
- Applications → Proxy API: send requests
- Proxy API → Proxy request handling: routes requests
- Proxy request handling → Request identity: authenticates
- Proxy request handling → Model routing: routes models
- Proxy request handling → Policy stages: applies policies
- Proxy request handling → Provider forwarding: forwards requests
- Provider forwarding → LLM providers: calls provider
- MCP and A2A clients → MCP API: send tool calls
- MCP API → MCP tool aggregation: dispatches MCP
- MCP tool aggregation → MCP and OpenAPI services: aggregates tools
- MCP and A2A clients → A2A agent forwarding: send A2A calls
- A2A agent forwarding → A2A agents: forwards tasks
- Admin dashboard → Admin API: manage gateway
- Admin API → Gateway and registry management: routes management
pkg/server/router/admin_router.go - Admin API → Identity and key management: routes key operations
- Admin API → Policy management: routes policy operations
pkg/server/router/admin_router.go - Admin API → Provider and model catalog: provides catalog
- Admin API → Postgres: persists configuration
- Config synchronization → Proxy API: supplies configuration
- Config synchronization → MCP API: supplies configuration
- Config synchronization → A2A agent forwarding: supplies configuration
- Proxy request handling → Telemetry pipeline: records activity
- Telemetry pipeline → OTLP collectors: exports telemetry
- Proxy request handling → Redis: uses runtime state