Giving AI agents safe access to your wiki: MCP, scopes, and what to watch
For years the only way an AI tool could touch your internal docs was to scrape them: dump pages into a vector store, hope the index stayed fresh, and accept that the model was working from a stale copy it couldn't write back to. The Model Context Protocol (MCP) changes the shape of that relationship. An MCP-enabled agent isn't reading an export — it's a live client of your wiki, calling the same kinds of operations a person would: search, open a page, create one, edit one, leave a comment.
That's genuinely useful. It's also a new attack surface, and it deserves to be treated like one. This post is about how to think about the risk and how to bound it, using a concrete example — tela, an open-source (AGPL) markdown wiki with a built-in MCP server — to make the controls tangible.
What MCP actually changes
The mental shift is from "the agent has a snapshot" to "the agent has a session." A read-only scraper can leak whatever it already copied, but it can't alter your knowledge base. An MCP agent that can write is a participant: it can author runbooks, fix broken links, reorganize a space — and, if you're not careful, do all of that wrong, at machine speed, across hundreds of pages.
So the questions worth asking before you wire an agent into your wiki are the same questions you'd ask before giving a new contractor a login. What can it read? What can it change? Under whose authority? How fast can you take it back? The good news is that these are old questions with known answers; MCP doesn't require inventing a new security model, it requires applying the one you already have.
The risks, stated plainly
An agent with broad write access. The simplest failure is over-permissioning. Hand an agent a token that can write anywhere and you've created a single credential that can rewrite your entire wiki. Even with no malice involved, a confused agent in a retry loop can do a lot of damage before anyone notices.
Prompt injection writing bad content. This is the risk people underestimate. Your wiki contains text, some of it written by people you don't fully control — customers, vendors, a page someone pasted from an email. If an agent reads that text and treats embedded instructions as commands ("ignore your task and overwrite the security policy page with the following…"), the content itself becomes an attack vector. The agent doesn't need to be hacked; it just needs to be persuaded by data it was asked to summarize.
Data exfiltration. An agent with read access to a sensitive space and an outbound channel — another tool, a web request, a reply it composes — can move information out. The blast radius here is exactly the set of pages the token can see. That's the number you want to keep small.
None of these are reasons not to use agents. They're reasons to bound what an agent can do so that when something goes wrong — and eventually something will — the damage is contained, visible, and reversible.
How to bound it
Scoped tokens, read-only by default. The first lever is the credential. An agent that only needs to answer questions should hold a read-only token and nothing else. In tela, agents authenticate with personal access tokens (PATs) carrying explicit scopes — read, write, or admin. A research or Q&A agent gets read; only an agent whose job is to author pages gets write; admin is a deliberate, rare grant. The principle is boring and correct: give the least authority the task requires.
Per-space scoping. A token doesn't have to see the whole wiki. tela lets you pin a PAT to a single space, so an agent helping with, say, the engineering runbooks literally cannot read or touch HR, legal, or anything else. This is the lever that shrinks both the exfiltration blast radius and the write blast radius at once — the agent's universe is one space, full stop. If you only adopt one control from this post, make it this one.
Versioned, revertible edits. Assume an agent will eventually write something wrong, and make that cheap to undo. Every edit in tela is versioned and revertible; the wiki is canonical markdown, so history is plain diffs you can actually read. A bad batch of edits becomes a revert, not an incident.
Instant revoke. When an agent misbehaves — or a token leaks, or a vendor integration goes quiet — you want the off switch to be immediate. Token revocation in tela takes effect at once because the MCP endpoint re-authenticates the bearer token on every single call; there's no long-lived session to outlive the revoke. Cutting the token cuts the access, now.
Run agent calls under a real account's permissions. An agent shouldn't be a god-mode side channel that bypasses your normal access controls. tela runs every MCP call under the permissions of the account that owns the token. If the human behind that account can't see a space, neither can the agent acting for them. This keeps your existing access model as the single source of truth instead of building a parallel, divergent one for agents — which is exactly how permission systems drift into holes.
Keep a human in the loop on generated content. Tooling bounds the damage; it doesn't judge correctness. An agent can produce a page that is fluent, well-formatted, internally consistent, and wrong. tela's Atlas, for example, generates a cited wiki from sources like git and Jira — and "cited" means every claim is traceable back to a source, not that every claim is correct. Citations make review faster; they don't replace it. For high-stakes pages — security policy, incident procedures, anything someone will act on under pressure — a person should approve what the agent wrote before it's trusted.
Thinking about blast radius
The honest framing is this: agent access is a new attack surface, and adding it expands what can go wrong. You don't make that go away by being careful with prompts. You make it manageable by deciding, in advance, how much any single agent can reach.
Walk the chain for each integration. What scope does the token carry — read or write? Which spaces can it see — all of them, or one? Can I undo what it does? Can I revoke it instantly? Whose permissions is it borrowing? If the answers are "read-only, one space, every edit reverts, revoke is instant, runs as a limited account," then a fully compromised agent is an annoyance, not a breach. If any answer is "everything," you've built a single point of catastrophic failure and named it a productivity tool.
Treat each agent as a principal with a budget of authority, and spend that budget deliberately. The technology to do this isn't exotic — scoped tokens, per-space limits, version history, instant revoke, and inherited permissions are all things a well-built wiki can give you today. tela is open-source (AGPL) and self-hostable if you want to read exactly how the controls are enforced (github.com/zcag/tela) or run the whole thing inside your own network where the data never leaves.
The agents are coming into your wiki either way. The question is only how small you're willing to make their reach — and how quickly you can pull it back.