- Updated summarization prompt to require Russian output and exclude non-textual elements - Upgraded ollama dependency to v0.6.1 - Enhanced run.sh script to support both single record and file-based ID input for MongoDB test generation - Updated documentation in scripts/README.md to reflect new functionality - Added verbose flag to generate_summarization_from_mongo.py for better debugging ``` This commit message follows the conventional commit format with a short title (50-72 characters) and provides a clear description of the changes made and their purpose.
3 lines
8.0 KiB
Plaintext
3 lines
8.0 KiB
Plaintext
The first time I wired an agent to real enterprise systems, it felt like I'd unlocked a cheat code. I had a clean, repeatable pattern: the model asks, a server answers, and suddenly the agent can do things. Then the uncomfortable thought hit: If I can plug in a new tool in an afternoon, an attacker can too. That's the real shift MCP brings. It doesn't just make tool access easier. It standardizes the most dangerous part of an agentic system: the interface between language and action. And in enterprises, anything that becomes standardized plumbing becomes… a security boundary. MCP in One Minute The Model Context Protocol (MCP) is an open protocol for connecting LLM apps (clients/hosts) to external tools and data sources (servers). It uses a client–server architecture and JSON-RPC 2.0 messages for communication. In practice, MCP lets an app expose: Tools (functions the model can call) Resources (data the model can read) Prompts (reusable instruction templates) And it supports different transport methods depending on whether you're local or remote (for example, stdio for local subprocess-style servers, and server-sent events for remote connections). If you've read my "RAG vs tools vs tuning" decision tree, MCP sits squarely in the tools bucket, but it pushes tools from "one-off integrations" into "an ecosystem." That ecosystem effect is exactly why this becomes a security story. The Uncomfortable Truth: MCP Turns Integrations Into an Attack Surface Enterprises already know how to secure APIs. They know how to secure service accounts. They know how to secure laptops. But MCP combines multiple risks into one pipeline: Natural language decision-making (easy to manipulate) Tool execution (real power) Data access (often sensitive) Third-party servers (supply chain) Untrusted content flowing into the model (prompt injection) OWASP's LLM Top 10 has names for these exact failure modes: prompt injection, insecure output handling, supply chain vulnerabilities, and more. MCP doesn't create these risks, but it makes them scalable. Threat Model: How MCP Fails in the Real World Here are the enterprise-grade failure patterns I worry about most. Not theoretical "AI doom." Just practical, embarrassing, breach-y stuff. 1. Permission Confusion: "Who Is the Model Acting As?" In many first drafts of agent systems, tool calls run under a single powerful service account. That's convenient… and catastrophic. Because the moment a user can influence the model (and they can), you've built a "natural-language privilege escalation" machine: the user doesn't need direct access to the underlying system; they only need the model to use its access on their behalf. In enterprise terms: you've violated least privilege and lost non-repudiation. What you want instead: Tool calls must be tied to an end-user identity (or an explicitly delegated identity). Permissions should be enforced at the tool/server, not “by instruction.” The model should never hold raw credentials; it should receive scoped tokens or call through a broker. This aligns with how modern systems treat sensitive actions: identity and authorization are enforced outside the app logic. 2. Tool Scoping Failure: "Too Much Agency, Too Few Guardrails." Tool catalogs tend to grow. That’s the point of MCP: add servers, discover tools, go faster. But broad toolsets create what OWASP flags as “Excessive Agency” style failure: the model has too many ways to cause harm. Classic enterprise examples: A helpful agent that can both read and write to the same system Tools that can export data to external destinations (email, pastebin-like endpoints, public repos) Tools that can run shell commands or touch production resources Once you connect real systems, the main question becomes: What is the smallest set of actions the model needs to achieve the job? 3. Prompt Injection Through Tool Results: "The tool output is hostile." This is the one that makes MCP a security problem, not just an engineering choice. Indirect prompt injection is when malicious instructions are embedded in content that the model treats as "data," such as web pages, documents, tickets, emails, or… tool outputs. OWASP calls prompt injection the top risk category for LLM apps for a reason. Microsoft's own security write-up is explicit: if your app can use tools, a successful injection can lead to data exfiltration through tool calls (or even covert channels based on whether a tool call happens). With MCP, this becomes sharper: A server returns "results." Those results may include attacker-controlled text (issue comments, PR descriptions, wiki pages, customer messages) The model follows instructions embedded in that text The model then uses other tools to leak data or take actions The security principle here is simple: Treat tool outputs as untrusted input. That's not how most people build v1 agents. 4. Audit Log Gaps: "We Can't Explain What Happened." When something goes wrong in enterprise systems, the first questions are always: Who did it? What did they access? Where did the data go? Can we reproduce it? Can we prove it? Most agent prototypes can't answer those questions. And MCP can make it worse if you have multiple servers, multiple tool calls, and no unified tracing. You get a mess of partial logs: some in the host app, some in each server, some in cloud provider logs. Without auditability, you can't do incident response. You can't do compliance. You can't do governance. 5. Supply Chain Risk: "Installing MCP Servers Is Installing Software." MCP encourages an ecosystem of servers. Some are internal. Many are third-party. Some are "download this repo and run it." In the stdio transport, the client can launch an MCP server as a subprocess, and the server reads and writes messages over stdin/stdout. That's powerful and ergonomic and also means: The server runs with the privileges of the process launching it It may have access to the local filesystem, environment variables, network, and secrets, depending on your setup So, yes: in many deployments, adding an MCP server is operationally similar to installing a new executable. Enterprises already have processes for that (code signing, provenance checks, vulnerability scanning, approvals). MCP adoption should inherit those processes, not bypass them. Why This Is a Governance Opportunity Here's the good news: MCP's "standard connector layer" can become a gift to security teams. Because once tool access becomes standardized, you can centralize controls. Think about what API gateways did for the modern enterprise: unified auth rate limits logging request policies threat detection versioning MCP is heading in the same direction. With the growing industry push toward shared agent standards and community governance (including efforts to keep MCP open and neutral under broader foundations), the ecosystem is getting real enough that enterprises should design for governance from day one, not as a patch later. The Enterprise MCP Security Playbook Put a “tool gateway” in the middle. Make end-user identity non-optional. Split tools by risk class (read vs. write vs. irreversible). Treat tool outputs like hostile web input. Logging that helps incident response (without leaking secrets). The Point: Tools Aren't Features Anymore, They're Infrastructure In my decision-tree mindset, "tools vs. tuning vs. RAG" is about picking the right lever. MCP changes what "tools" really means. Tools stop being a feature in one app and start becoming shared infrastructure across many apps and many teams. Infrastructure needs: threat models governance auditability lifecycle management security ownership If you treat MCP as "just a convenient plugin layer," you'll eventually learn about prompt injection, data leakage, and privilege boundaries the hard way. If you treat MCP as "the new enterprise integration bus for agents," you can actually win: central control consistent security policies reusable approvals and logging faster adoption with fewer surprises That's why I call it a security problem and a governance opportunity. Learned something new? Tap that like button and pass it on!
|
||
==============
|