What I Built
Multi-agent systems today suffer from three critical architectural flaws:
- Tight Coupling (Graph Rigidity): Traditional orchestrators force developers to design rigid, static execution graphs (DAGs). Adding a new agent or tool requires refactoring the orchestrator and redeploying the application.
- Prompt-Bloat: Frameworks push entire tool schemas into system prompts, generating massive token consumption, slow Time-to-First-Token (TTFT), and high costs.
- Vulnerable Privilege Levels: Cognitive agents often hold direct, permanent access to production databases. An indirect prompt injection can hijack the agent and execute arbitrary operations.
To solve this, I built the BFA SDK & IRC-A (Internet Relay Chat for Agents) Protocol. It is a decentralized, plug-and-play agent network architecture that inherits battle-tested principles:
- The BFA (Backend for Agents) Pattern: Structural isolation of agent support systems.
- Semantic Routing via FAISS: Dynamic, late-bound discovery. Instead of hardcoding tools in prompts, agents query a local vector store at runtime to resolve capabilities dynamically based on natural language intent.
- Smalltalk-style Encapsulation: Agents only know their local responsibility. They never hold direct database credentials.
- Ephemeral Delegated Execution Tokens (DETs): When an agent needs to invoke an external tool, the Gateway mints a cryptographically signed, short-lived token (PASETO) containing strict parameter lockdowns (e.g., "authorized only for Customer ID 722").
Cloud Run Embed
The BFA Gateway runs natively as a containerized microservice. It is packaged with Docker and has built-in Mangum support for serverless routing (ideal for zero-cold-start AWS Lambda or Google Cloud Run deployments).
To embed your Cloud Run deployment:
Live Gateway Dashboard: https://irc-a-gateway-hmwmve5bjq-uc.a.run.app
Live Chat UI Client: https://irc-a-chat-ui-hmwmve5bjq-uc.a.run.app
Your Agents
The architecture decouples the system into three specialized roles that interact securely:
-
BFA Gateway (The Registry & Customs Office):
- Acts as a stateless registry and routing broker.
- Dynamically registers agents and MCP tools on startup using an asymmetric RSA challenge-response handshake.
- Masks vector search results using logical IRC channels (e.g.,
#finance,#public) to prevent unauthorized capability discovery. - Mints ephemeral, signed Delegated Execution Tokens (DETs).
-
Cognitive Agent (e.g.,
CreditAdvisorAgent):- A stateless, reasoning-only agent.
- Has zero database access. It only knows how to decompose tasks and request capabilities semantically using natural language.
-
Execution Layer (e.g.,
BankDatabaseMCPtool server):- The only component with network access to the database.
- Validates incoming DETs offline before executing commands. If the request parameters do not match the parameters locked down in the DET, it rejects the call, ensuring zero-trust.
Key Learnings
- Returning to the Classics: Solving modern LLM constraints (prompt-bloat, graph coupling) didn't require inventing new AI theory, but rather applying classic software engineering patterns: late-binding, Smalltalk message-passing, and IRC-style channel segmentation.
- Decoupling is Efficiency: By keeping tool definitions out of the LLM prompt and resolving them semantically only on demand, we cut prompt size dramatically, saving cost and improving response speeds.
- The Parameter Lockdown Advantage: We learned that security must be enforced at the tool boundary. Even if an LLM is hijacked via prompt injection, the tool server validates the signed token parameters offline and denies unauthorized actions.

Top comments (0)