How sanketdhole/torana-gateway works
Torana is an enterprise security gateway for AI-agent protocols and access to enterprise tools and assets. Its principal workflow accepts agent traffic through protocol-specific ingress, applies identity and policy controls, routes requests, and brokers access to upstream services; MCP requests additionally support tool discovery filtering and authorization. The repository also contains control-plane configuration, peer synchronization, plugin sandboxing, limits, and telemetry. The README documents broader A2A and gateway capabilities; sampled source confirms MCP authorization/forwarding, policy evaluation, and plugin lifecycle details, but not every runtime connection.
Main entry points: chain.go Filter Pipeline · egress.go Egress Broker · manager.go Plugin Manager · ingress.go HTTP and gRPC
Components 27
Gateway Runtime
- Gateway Entry
cmd/gateway-data/main.go - Supervisor
internal/supervisor/supervisor.go - HTTP and gRPC
internal/ingress/ingress.go - MCP Handler
internal/ingress/mcp/handler.go - A2A Handler
internal/ingress/a2a/handler.go - WebSocket Handler
internal/ingress/ws/handler.go - Filter Pipeline
internal/pipeline/chain.go - Route Matching
internal/router/router.go
Security Controls
- Identity Resolution
internal/security/authn/provider.go - Policy Engine
internal/security/authz/engine.go - Token Exchange
internal/security/sts/sts.go - Usage Limits
internal/limits/limiter.go
Upstream Access
- Egress Broker
internal/egress/egress.go - Remote MCP
internal/egress/mcp/client.go - HTTP and gRPC
internal/egress/http/http.go - PostgreSQL
internal/egress/postgres/client.go - Model Providers
internal/egress/llm/client.go
Configuration and Peers
- Snapshot Client
internal/controlplane/client.go - Gateway Config
internal/config/config.go - Peer Mesh
internal/peers/manager.go
Plugins and Observability
- Plugin Manager
internal/plugins/manager/manager.go - WASM Runtime
internal/plugins/wasm/manager.go - Process Plugins
internal/plugins/process/manager.go - Telemetry and Audit
internal/observe/observe.go
Other components
- Agent Clients
- Enterprise Services
- Control Plane
Connections 26
- Agent Clients → HTTP and gRPC: send requests
- Gateway Entry → Supervisor: starts
- Supervisor → HTTP and gRPC: serves traffic
- HTTP and gRPC → Filter Pipeline: passes requests
- Filter Pipeline → Identity Resolution: resolves identity
- Filter Pipeline → Policy Engine: enforces policy
- Filter Pipeline → Route Matching: routes requests
- MCP Handler → Policy Engine: authorizes tools
- MCP Handler → Remote MCP: forwards JSON-RPC
- A2A Handler → Peer Mesh: discovers agents
- Route Matching → Egress Broker: selects upstream
- Egress Broker → Remote MCP: dispatches MCP
- Egress Broker → HTTP and gRPC: dispatches calls
- Egress Broker → PostgreSQL: dispatches queries
- Egress Broker → Model Providers: dispatches prompts
- Control Plane → Snapshot Client: sends snapshots
- Snapshot Client → Gateway Config: updates snapshot
- Peer Mesh → Peer Mesh: syncs snapshots
- Plugin Manager → WASM Runtime: loads WASM
- Plugin Manager → Process Plugins: registers plugins
- Filter Pipeline → Plugin Manager: runs filters
- Filter Pipeline → Usage Limits: checks usage
- Filter Pipeline → Telemetry and Audit: emits telemetry
- Policy Engine → Telemetry and Audit: audits decisions
- Token Exchange → Agent Clients: issues delegated tokens
- Egress Broker → Enterprise Services: accesses assets