Prompt Injection Risks in MCP-Connected Data Pipelines
A governed, read-only analytics layer limits what injected agents can reach.

MCP-connected data pipelines expose agents to prompt injection through both the data they analyze and the prompts users send. The appropriate defence is a governed, pre-modeled, read-only analytical layer between agents and production. For API-first and agent-first teams, a headless analytics platform should let agents use shared metric definitions and access-controlled datasets through MCP without giving them direct access to production Supabase tables.
Why MCP-connected data pipelines are a uniquely dangerous injection surface
Query results, logs, schema metadata, and tool outputs become context that the model uses to decide what to do next. That is the critical trust boundary. In conventional applications, user input passes through defined validation layers, while an MCP-connected agent interprets information arriving through several channels, including database responses. Content retrieved for analysis can therefore become an instruction governing the analysis itself.
Anthropic introduced MCP in 2024 to standardize bidirectional communication between AI host applications and tool servers. The protocol lets agents discover and invoke tools dynamically, including databases, file systems, and analytics APIs. Discovery itself introduces another input channel. The MCP-DPT taxonomy identifies pre-execution artifacts including tool names, natural-language descriptions, argument schemas, and server-provided prompts. These enter the model’s context and influence tool selection before any execution occurs.
Indirect prompt injection exploits this arrangement by embedding instructions in material the agent legitimately needs to read. A database record or API response need not arrive as a user request to influence the model. The CASCADE audit shows that tool outputs are separate indirect-injection channels outside the user prompt and the defences many teams have set up to watch for attacks. Analytics amplifies that exposure by design. The agent’s job is to read large amounts of data, so the data it needs to read can also contain instructions.
The concrete attack classes that target pipeline data specifically
Tool poisoning begins before the agent queries a dataset. Malicious instructions embedded in function descriptions or parameter schemas enter its context when tools are registered. The descriptor-manipulation study distinguishes Tool Poisoning, which biases tool selection, from Shadowing, which contaminates shared context so benign tools are reinterpreted. Rug Pull introduces unsafe behaviour through descriptor changes after approval, including plugin updates or registry sync. Trust can therefore expire without an obvious execution event.
MCP-ITP demonstrates a less direct variant called implicit tool poisoning. The poisoned tool is never invoked. Instead, its metadata induces the agent to call an authorized, high-privilege tool such as write_file or execute_sql. The trigger and the damaging operation belong to different tools, separating the source of the instruction from the action it causes.
Log-To-Leak targets disclosure after the legitimate work is complete. Its directive uses Trigger, Tool Binding, Justification, and Pressure to get the agent to make an unauthorized logging call to an endpoint the attacker controls. The payload includes the user query, server name, server response, and agent response. Successful analysis and disclosure can thus coexist. The study evaluated this pattern across five MCP servers, namely GitHub, Mapbox, PayPal, YFinance, and Playwright, and four LLM agents.
Prompt-to-SQL and compositional injections instead redirect the operations used to answer a question. A malicious text string in a database record can alter the query the agent generates, compromising confidentiality or data integrity. Here, the data changes its own interpretation. Across these classes, natural-language content can cross from evidence into instruction because the model lacks a reliable syntactic boundary between the two.
What actually happened when real pipelines were attacked
Supabase MCP proofs of concept in 2025 demonstrated the direct data-to-instruction path. Content that an agent read through an MCP tool led it to expose private data. The authorized read was the entry point. The attack did not depend on a malicious user asking the agent to disclose information directly, which makes prompt-only screening an incomplete account of the threat.
OX Security’s “Mother of All AI Supply Chains” finding in April 2026 illustrated exposure further upstream. A command execution vulnerability in Anthropic’s official MCP SDKs for Python, TypeScript, Java, and Rust exposed an estimated 200,000 vulnerable instances across a supply chain spanning more than 150 million package downloads. The trusted integration was itself an attack surface.
AWS Kiro illustrated a different escalation in July 2026. The agent could be led to rewrite its own MCP configuration, enabling code execution, as documented in CVE-2026-10591. The case shows how legitimate management access can become dangerous when content the agent reads can change its operating environment.
A SQL-injection flaw in Anthropic’s Postgres MCP server exposed the limits of nominal restrictions. A supposedly read-only connection could execute a destructive schema-dropping command. The label did not establish the boundary. The failure shows that a connection flag or query-inspection gate is insufficient as a complete governance layer.
Why runtime guardrails alone cannot close the pipeline injection gap

Prompt filters and output guards inspect only parts of the interaction. A user-input filter does not cover malicious instructions arriving later in a tool response, while an output check may run after that content has already influenced tool selection. Placement determines what a guard can prevent. The MCP-DPT taxonomy identifies predominantly tool-centric defences and persistent gaps in host orchestration, transport, and supply-chain layers.
Execution monitoring also depends on what it attributes as suspicious. MCP-ITP achieved high attack success rates across twelve LLM agents while reducing malicious tool detection to as low as 0.3%. The poisoned tool did not need execution. Monitoring focused on that tool could miss the legitimate, privileged operation induced by its metadata.
Log-To-Leak found that three evaluated defences left residual attack success rates above 55% on GitHub MCP with GPT-4o. Correct output did not exclude subsequent disclosure. A monitor concerned only with whether the requested analysis succeeded would not distinguish that outcome from safe execution.
Broader detection introduces its own operational costs. The CASCADE audit found that many cases were referred to humans, with both false positives and false negatives, and that detection figures changed with the rules used to make decisions. The descriptor-manipulation study found that integrity verification, pre-context semantic vetting, and runtime guardrails reduced unsafe invocations without eliminating them, while flagging a large share of benign descriptors. These results give no grounds to treat a benchmark as a guarantee.
Authentication cannot resolve this gap on its own. Valid credentials identify an agent, but they do not supply missing column-level classification or fine-grained access policies. Authorization, in turn, does not define which calculations or datasets should be authoritative. Runtime controls remain useful within defence in depth, but they cannot substitute for governing what the agent can read and do.
The architectural defence: pre-modeled, governed, read-only data as the injection barrier
The architectural response is to remove raw, mutable production data from the agent-facing surface. Agents should receive pre-modeled datasets through a governed layer, with read-only privileges enforced at the source. The permissions must still hold when the model makes a mistake. For Supabase teams, a follower replica rather than the primary can isolate analytical access and operational load, while a materialized analytical copy provides a separate surface for modeled metrics.
Read-write separation limits the damage an attack can do by changing data. An agent that reads untrusted support tickets, inbound content, or public records should not also be able to write to internal systems in the same session. AWS guidance sets out tighter rules for each kind of action: agents can read, writes need human approval, and deletes are denied entirely. Disclosure still requires separate access controls. Blocking writes limits one kind of harm, but some readable fields may still be wrong to share with some agents.
Pre-calculated metrics stored in governed Parquet datasets and queried through DuckDB narrow the exposed content as well as the available operations. When the interface excludes raw records and production schema comments, those channels have no direct path into agent context. Access rules still need explicit enforcement. Production Postgres row-level security does not follow data into an analytical copy on its own, so teams must set dataset-level permissions before sessions begin.
A single governed MCP server can expose datasets, metric definitions, and scheduled reports with consistent permissions, auditability, cross-agent observability, and shared rate limiting. It also allows credential rotation and tool-version changes without redeploying each agent. Dreambase is one Supabase-focused implementation of this pattern, exposing pre-calculated metrics in Parquet through DuckDB via an MCP analytics server rather than letting agents query the production database.
How to let AI agents query Supabase data without direct production database access
Supabase’s MCP server, as of November 2026, exposes 37 tools, OAuth 2.1 authentication, and a read_only=true flag that uses a read-only Postgres role. Source-enforced privileges are stronger than query inspection alone. Nevertheless, authentication and read-only access do not restrict the interface to approved metrics, and prompt-to-SQL manipulation can occur through execute_sql.
For teams building the latter, production should remain off-limits to agent reads. A follower replica or materialized analytical copy separates agent activity from the primary, while pre-modeled Parquet datasets queried through DuckDB avoid ad-hoc SQL against live tables. The copy needs its own authorization policy. Dataset-level rules must independently enforce who can see which data rather than assuming production row-level security has propagated.
Agents should get governed metric definitions instead of raw table schemas whose comments, column descriptions, and table names can carry natural-language instructions. Tool selection should reflect that narrower purpose. Read operations should use pre-modeled datasets, write operations should need human approval, and delete operations should be off-limits to agents.
The choice is therefore about exposed capability. Official MCP servers also exist for providers including Neon, Prisma Postgres, Google Cloud SQL, AlloyDB, and AWS Aurora and RDS, but provider availability does not make raw-table access governed. Informatica’s enterprise pattern, announced at Informatica World on May 20, 2026, illustrates a complementary approach. It exposes capabilities such as metadata search, data quality checks, and lineage tracking through MCP endpoints rather than treating a raw data store as the agent interface.

Metrics as the highest-stakes governed surface — and why agents need a single source of truth
Silent metric manipulation is especially consequential because it can leave the analytical workflow looking successful. An injected instruction may change a calculation, filter, or aggregation without any clear sign of failure. The number still looks like an answer. If human teammates and other agents accept it as ground truth, the problem becomes one of operational alignment.
A metrics layer, also called a metrics store or headless BI, centralizes how a company calculates its KPIs. Dashboards, reports, and agent queries resolve against the same pre-calculated definitions instead of independently reconstructing them from raw tables. This gives headless analytics a concrete role. For API-first and agent-first teams, its shared unit of consumption is the governed dataset.
To preserve that shared basis, metrics should be calculated ahead of time and delivered where people work, including inbox, Slack, and scheduled reports. Delivery and querying then serve different needs.
An agent cannot answer a novel question that the model does not cover with the same freedom as ad-hoc production SQL. That limitation is part of the defence. The governed layer is where teams decide which flexibility to provide without letting an injected instruction redefine an approved calculation.
For early-stage teams, the practical starting point is a small set of actionable KPIs modeled into a governed layer from day one. Making that layer the only agent-facing surface avoids the higher cost of retrofitting governance after an injection incident. Humans and agents can then discuss what the numbers mean, rather than unknowingly act on different versions of them.
Sources
- MCP-DPT: A Defense-Placement Taxonomy and Coverage Analysis for Model Context Protocol Security
- Evaluating a Layered Prompt-Injection Defence for the Model Context Protocol: A Record-Level Audit of Decision Conventions, Corpus Provenance and Reproducibility
- Log-To-Leak: Prompt Injection Attacks on Tool-Using LLM Agents via the Model Context Protocol
- MCP-ITP: An Automated Framework for Implicit Tool Poisoning in MCP
- Semantic Attacks on Tool-Augmented LLMs: Securing the Model Context Protocol Against Descriptor-Level Manipulation


