The viral LLM wiki pattern, popularized by Karpathy and Garry Tan, offers superior synthesis compared to RAG, but it harbors a critical security flaw for teams. When an agent compiles knowledge from mixed-sensitivity sources, it inadvertently flattens permissions, exposing restricted data to broader audiences. This isn't a retrieval error; it is a design failure where the compile step erases the access model unless explicitly enforced.
The Intersection Rule
The core problem is that a compiled page inherits the sensitivity of its most restricted source, yet often resides in a folder with looser permissions. The solution is strict intersection logic: a page's audience must be the intersection of all its source ACLs. If an agent attempts to write a summary of a 'legal' escalation into a 'sales' scope, the system must reject the write immediately. Citing the source does not help; if the reader sees the synthesized sentence, the secret is out.
Provenance as Data, Not Footnote
Most implementations treat citations as textual footnotes. They must be treated as structured data fields. When a source's permissions change or it is deleted, every derived page must be invalidated. This requires a recompile or quarantine trigger. Without this, the wiki drifts, retaining stale permissions that can lead to significant security incidents long after the initial compilation.
Routing by Sensitivity
Not all knowledge should be compiled. Stable, low-sensitivity items like runbooks and architecture decisions benefit from the LLM wiki pattern. High-sensitivity data, such as HR cases or deal terms, should remain in query-time retrieval systems with per-user filtering. This hybrid approach preserves the synthesis benefits for general knowledge while maintaining strict access controls for sensitive domains. The agent should answer high-sensitivity questions by fetching sources for that specific user at that specific moment.
Infrastructure Implications
The choice of infrastructure is paramount. If the compile model is a third-party API, your most sensitive documents leave your boundary on every compile. Self-hosted AI infrastructure ensures that the read-and-decide step happens within your own perimeter. Furthermore, permissions should live on the documents themselves within the same system the agent reads and writes, rather than being rebuilt manually on a filesystem.
Key Takeaways
- Compile steps erase access controls unless intersection logic is enforced in the write path.
- Citations must be structured data to trigger recompiles when source permissions change.
- High-sensitivity data should use query-time retrieval, not static compilation.
- Self-hosting the compile model prevents sensitive data from leaving the infrastructure boundary.
The Bottom Line
The LLM wiki pattern is the right instinct for team knowledge, but only if you treat access decisions as part of the compilation process. If you don't, you are building a leaky bucket.