What Infragate is, and how it started
← All posts

What Infragate is, and how it started


It was mid-2025. Most organizations seemed to be building chatbots, and the Model Context Protocol was so new that most developers were unaware of it. We were integrating a generative AI chatbot into an existing hospital operations platform, so that staff could explore the system and query operational data in plain language instead of clicking through it.

The difficult part was never the model. Rather, it was letting the model access live data without either copying that data elsewhere or granting it more access than the requesting user deserved.

Three approaches that did not hold up

RAG

The first instinct was retrieval-augmented generation (i.e., embed the existing data, store it in a vector database, and let the model retrieve context as needed). This is a sound pattern for static documents. Our data, however, was not static. Operational data changes constantly, so RAG meant duplicating large volumes of it and then managing a synchronization problem indefinitely. Every answer would be slightly stale, and slightly stale answers are not acceptable in a hospital.

The existing APIs

Next, we examined the APIs that the frontend of the application already called. This approach seemed correct, since those APIs already enforced permissions. That is, a user querying through them cannot access anything that is not visible to them in the UI. This property is valuable, and we kept it.

The problem was coverage. A large part of the data that the chatbot required was not exposed by any endpoint, and every gap meant writing a new one. Thus, the capabilities of the chatbot were limited by the amount of backend work we were willing to do in a given week.

Direct database access

We therefore considered querying the database directly, on the assumption that all the data is stored there. It is, and that is the trap. A schema is not an interface. Without the logic layer of the application, rows lose the meaning that the application assigns to them (e.g., which timestamp is the relevant one, which records are soft-deleted, and what a status value implies). Additionally, the permission model that the previous approach provided at no cost was lost.

The thing that worked

We shipped a small server between the chatbot and the backend APIs, which forwarded the auth token of the user on every request. The model received a usable set of operations, and the access check remained where it already worked (in the application, as that user). Users could query live data, and nobody needed to reason whether the AI held excessive access, because its access matched theirs exactly.

It worked. However, it was tedious. Every new capability required a new endpoint or a change to an existing one. Each iteration meant more code to write, review, and maintain, and all of it was glue. The interesting work was not the glue.

What that turned into

The key observation was that the glue is identical in every case. Every group that integrates an agent with a real system writes a version of that proxy, then repeats it for the next system, and then copies the config onto a second laptop along with every secret in it.

This is the layer that Infragate builds. It is not a service that generates backends (which is where this started, but not where it landed). Rather, it is tooling for the part that every project was building by hand.

  • CAPA declares what an agent is allowed to do in a single file per repository (skills, tools, MCP servers, and sub-agents). One command installs it, and a colleague receives the same setup without a walkthrough.
  • Lanyard turns the auth-passthrough idea from that first proxy into a product. It provides one gateway URL, each person is signed in to each server as themselves, and each agent has one revocable key.
  • ShareCube handles what the agent produces, so that a document ends up at a URL where a colleague can comment on it, instead of being buried in a chat.

All of it uses MCP, which was the bet in 2025 and currently appears to be the correct one. An open protocol is preferable to a proprietary integration surface, because the integrations outlive whichever client is currently popular.

The remainder of this blog documents that work as it is released.