Inspiration

Throughout my career working on backend platform teams, I've spent countless hours orchestrating hundreds of disparate microservices, legacy APIs, and disparate data streams. Recently, as I began building out my own AI-powered "Second Brain" to orchestrate my personal life, I realized something profound: the gap between a personal AI assistant and an enterprise autonomous fleet is entirely a routing and security problem.

Whether it's an AI agent trying to fetch my personal Obsidian notes, or an enterprise agent trying to pull a SAP invoice, they both face the exact same hurdles:

  1. They speak modern JSON, but the world runs on legacy SOAP, REST, and SQL.
  2. You absolutely cannot blindly trust an LLM to make its own security decisions or have unrestricted API keys.

I was inspired to bridge this gap. I wanted to build the equivalent of an Enterprise Service Bus (ESB) for the AI age—a central, Zero-Trust gateway that intercepts, verifies, and translates agent requests before they ever touch sensitive systems.

What it does

PRISM (Protocol Routing & Identity Service for MCP) is a Zero-Trust API Broker that safely connects fleets of autonomous agents to legacy infrastructure. It acts as a highly-secure intermediary for the Model Context Protocol (MCP).

When an agent (built in any framework) wants to perform an action:

  1. Identity: It sends an MCP request bundled with a cryptographically signed JWT.
  2. Evaluation: PRISM intercepts the request, verifies the signature against a central Identity Provider (JWKS), and evaluates the agent's role against GitOps-based .yaml policies loaded dynamically from Google Cloud Storage.
  3. Asynchronous Execution: Instead of blocking the HTTP connection while the AI thinks, PRISM drops the task onto a Google Pub/Sub queue and instantly returns a task\_id.
  4. The Meta-Worker: A completely isolated, locked-down Cloud Run worker picks up the task, orchestrates the Gemini reasoning loop via Google Cloud Vertex AI, and executes the actual legacy internal tools.
  5. Memory & Audit: The final result is stored in a Firestore Memory Bank for the client to poll, and the entire execution (with PII redacted) is streamed to Google Cloud Logging for SOC2/HIPAA compliance.

How we built it

PRISM is a cloud-native, serverless architecture built primarily in Go.

  • The Gateway & Worker: We built the core microservices in Go for maximum concurrency and low-latency API handling. They are containerized and deployed as two separate Google Cloud Run services.
  • Infrastructure: We relied heavily on GCP's native enterprise security features. The Meta-Worker is completely isolated from the public internet, only accepting traffic from Google Cloud Pub/Sub via authenticated OIDC Service Accounts.
  • AI Integration: We utilized the official Google Cloud Vertex AI Go SDK to securely orchestrate the gemini-3.6-flash model without ever exposing a raw API key, relying purely on Application Default Credentials (ADC) and Google Cloud IAM.

Challenges we ran into

1. The "Silent Death" of Asynchronous Workers: Because our Meta-Worker operates entirely in the background triggered by Pub/Sub, early errors (like failing to mount an API key or a malformed payload) caused the worker to crash silently without returning an HTTP response. We had to build extensive, step-by-step telemetry logging directly into the Go handlers just to regain observability over the async pipeline.

2. Bridging AI Studio vs. Vertex AI: During development, we initially relied on standard Google AI Studio API keys. However, transitioning the architecture to a true enterprise pattern meant stripping out API keys entirely and refactoring the Go codebase to authenticate natively with Vertex AI via Google Cloud's internal IAM policies.

3. State Management in a Stateless Cloud: Cloud Run is inherently stateless, but agents require cross-turn context. We solved this by implementing the "Enterprise Memory Bank" pattern, using Firestore to hydrate and persist agent session state completely independently of the active HTTP requests.

What we learned

  • Go is phenomenal for Agentic infrastructure. While Python dominates the data science side of AI, Go's strict typing, goroutines, and blazing-fast startup times make it the absolute perfect language for building the actual gateways and routing infrastructure that agents rely on.
  • The Model Context Protocol (MCP) is a game-changer. Standardizing how agents request tools allowed us to build a gateway that is completely agnostic to which framework (Antigravity, GenKit, LangChain) the agent was built in.
  • Security cannot be an afterthought for Agents. The potential for prompt-injection attacks means that Role-Based Access Control (RBAC) must happen at the infrastructure layer, not the prompt layer.

What's next for PRISM

Our next step is implementing a visual dashboard for the Telemetry logs so security teams can monitor agent fleet behavior in real-time. We also plan to build native protocol adapters for GraphQL, gRPC, and direct PostgreSQL queries, allowing PRISM to seamlessly bridge modern agents into even more legacy enterprise architectures.

Built With

  • ai-agents
  • api-gateway
  • docker
  • firestore
  • gemini
  • gemini-api
  • gitops
  • go
  • golang
  • google-cloud
  • google-cloud-logging
  • google-cloud-pubsub
  • google-cloud-run
  • jwt
  • mcp
  • microservices
  • model-context-protocol
  • python
  • rbac
  • rsa
  • serverless
  • vertex-ai
  • zero-trust
Share this project:

Updates

Submission history