Sub topic 11
Vetting extensions and tool servers
This chapter assumes you know how agent permissions work and what prompt injection is. It also assumes you have used an AI assistant that can call tools. An MCP server (Model Context Protocol server) is a program that gives an assistant extra tools, such as reading a database, searching tickets, or posting to chat. Editor extensions and plugins do a similar job. Each one adds code that runs with your access, so each one needs a review before you install it.
Why extensions change the threat model
A tool server is not a passive document. It is software that runs on your machine or on a remote host. It can see every argument the assistant passes to it and can return any text it likes. That creates two separate risks:
- Data exposure. The server receives whatever the model sends, including file contents, query text, and tokens you configured for it.
- Injection channel. The server's replies and tool descriptions go into the model's context. A malicious or compromised server can include instructions that steer the assistant into reading secrets or calling other tools.
A vetting checklist
Check these points before you enable a server or extension.
- Source. Who publishes it? Prefer a maintained repository from a known vendor or your own organization. Be wary of near-identical names, which are used to impersonate popular packages.
- Code and scope. Read what the tools do. A "markdown formatter" that asks for network access is a warning sign.
- Local or remote. A local server runs as your user. A remote server sees your data on someone else's infrastructure, so apply the provider-policy questions from the earlier chapter to it as well.
- Credentials requested. Give it the narrowest token that works. A read-only token for one project is better than your personal admin key.
- Version. Pin an exact version or commit. Auto-updating means a later release can change behavior after you reviewed it.
- Approvals. Keep per-call approval on for tools that write, delete, send, or reach the network.
Pinning and scoping in practice
Many assistants configure servers in a JSON file. The exact file name and keys vary by tool, so check yours. The example below shows the pattern: a pinned version and a token passed from the environment rather than written into the file.
{
"mcpServers": {
"tickets": {
"command": "npx",
"args": ["-y", "[email protected]"],
"env": {
"TICKETS_TOKEN": "${TICKETS_READONLY_TOKEN}"
}
}
}
}The package name here is a placeholder. The ${...} substitution is supported by some tools and not others. If yours does not support it, set the variable in your shell before starting the assistant.
Testing before trusting
Run a new server in a throwaway project that holds no real secrets. Use a token created only for the test. Then look at what the server does:
- List the tools it registers and read each description. Descriptions are model input, so look for odd instructions inside them.
- Watch outbound connections while you use it, with a proxy or your operating system's network monitor.
- Confirm it works with a read-only credential. If it fails, find out why it needs more.
Ongoing maintenance
Vetting is not a one-time act. Review the configured servers on a schedule, remove the ones nobody uses, and re-check a server whenever its maintainer changes or its permissions grow. Revoke the tokens of removed servers, because deleting the config does not invalidate the credential.
Exercise
A teammate wants to add a community MCP server that searches your issue tracker. It asks for a personal access token with full account rights and runs with auto-update on. Name three changes you would require before approving it.
Show answer
Replace the token with a read-only token scoped to the needed project, pin the server to a reviewed exact version or commit and turn off auto-update, and keep per-call approval on for any tool that writes or reaches the network. Reviewing the source and testing it first in a project with no real secrets is also a valid answer.