Prompt Injection Risks in Data-Reading AI Agents
Agents can't tell data from commands, so govern what they read.

Prompt injection in data-reading AI agents is a structural consequence of how large language models process text, not a bug that a patch will fix, and the only reliable mitigation is architectural: keep agents away from raw, untrusted data sources and give them pre-governed datasets instead. For a developer wiring an AI agent to a Supabase project, this means the risk starts the moment the agent gets a database connection string, not when something goes wrong.
Why AI agents can't separate instructions from content
Picture the ordinary moment: a developer connects an agent to a Postgres instance so it can answer questions about customer accounts, usage, or revenue. The agent runs a query, gets rows back, and reasons over them the way it would reason over any other text in its context. That last part is the problem. Whatever lands in the context window is a candidate for the model's next action.
This matters most for agents that read data, because any row a database query returns, any API response an MCP tool surfaces, or any document a retrieval pipeline fetches can carry an instruction. A customer support ticket, a product review, a field in a database table: any of it can carry text that looks, to the model, exactly like an instruction from the user.
Three attack patterns follow from this single root cause, and each is harder to catch than the one before it. Indirect injection is subtler. Stored injection goes further still: the malicious instruction sits in long-term memory, an indexed document, or a knowledge base, and fires later, often in a session that has nothing to do with where it was planted, making it almost impossible to trace back to its source.
A fourth pattern, introduced by researchers from Seoul National University, UIUC, and Largosoft in July 2026, operates one layer below all three. Agent Data Injection, or ADI, doesn't smuggle in an explicit command. It corrupts the trusted metadata an agent uses to interpret the structure of what it's reading: a sender name, a button ID, a record of a prior tool call. Think of a GitHub maintainer whose profile metadata gets quietly altered so that an agent reviewing a pull request misreads who approved it. Probabilistic delimiter injection works by inserting punctuation-like characters into fields the attacker controls; because an LLM reads structure probabilistically rather than through strict parsing rules, it misreads field boundaries and treats attacker-supplied content as if it were trusted metadata. The paper behind it found near-zero success rates for classic instruction injection against current defenses, but ADI still succeeded in up to half of its attempts against those same defenses.
The structural root cause here, that LLMs cannot distinguish instructions from data when both arrive as text, means any agent querying raw, untrusted data sources inherits this blindness by default. Governed datasets close off that surface. Platforms like Dreambase pre-model data into structured, validated datasets and serve them through MCP, so agents get pre-calculated metrics with known provenance, and an attacker can no longer hide instructions inside raw database rows.
None of this scales with attacker sophistication so much as it scales with what the agent is allowed to do. Researchers at ETH Zurich evaluated automated injection attacks across 80 task pairs and found that black-box optimization, a method called TAP, substantially outperformed gradient-based approaches. Attacks tuned against smaller open-source models didn't reliably transfer to frontier models, so that offers a partial barrier, but attacks tuned directly against the target model stayed effective regardless.
From research curiosity to confirmed production incidents
Between 2024 and 2026, prompt injection stopped being a research curiosity, and now it's a confirmed feature of production systems that organizations depend on daily.
The clearest case of data exfiltration arrived in mid-2025 with EchoLeak, a zero-click attack against Microsoft 365 Copilot disclosed by Aim Labs. The vulnerability was assigned CVE-2025-32711, describing Microsoft 365 Copilot's exposure to a zero-click indirect prompt injection that exfiltrated sensitive data without any user interaction.
MCP-connected deployments introduced a different kind of damage: supply-chain and cross-tenant exposure. In June 2025, a path traversal flaw on the Smithery platform, a managed MCP deployment service, let an attacker read arbitrary files, including environment files holding API keys, database credentials, and OAuth secrets, across more than 3,000 deployed MCP applications at once. Early 2026 brought a wave of disclosures, with researchers filing more than 30 CVEs in 60 days; one of them, CVE-2025-6514 in mcp-remote, reached a CVSS score of 9.6 and affected a package that had already been downloaded hundreds of thousands of times. For multi-tenant analytics deployments specifically, the consequence takes a different shape: a single agent serving many users can leak one user's personal data into another's session if context isolation fails, and long-lived memory features only enlarge the blast radius of whichever session gets compromised first.
ADI's arrival in July 2026 confirmed that this list of incidents will keep growing, because a new attack class that existing defenses were never built to catch now has working proof-of-concept code against shipping products. Coverage of the ADI paper documented three live attacks: an arbitrary click exploit against web agents including Claude in Chrome, Antigravity, and Nanobrowser; remote code execution against coding agents including Claude Code, Codex, and Gemini CLI; and a supply-chain attack carried out through fake pull-request review records. The research team reported each finding to the relevant vendors before publishing, and OpenAI, Google, and Anthropic all acknowledged the reports, which confirms these are credible production risks rather than lab artifacts that don't translate to the real world.
As these indirect injection attacks moved into production against real, widely used platforms, the risk shifted from theoretical to immediate. The architectural solution is just as production-ready. Governed data layers that decouple agents from raw database access are already running. Dreambase operates this way, serving pre-modeled datasets through MCP so agents never touch production Postgres instances directly, removing the raw-data attack surface without giving up the analytics capability agentic workflows need.
In May 2026, the intelligence community weighed in directly. Five Eyes joint guidance named prompt injection a core manipulation vector against AI systems and recommended that organizations assume agentic AI may behave unexpectedly, planning deployments accordingly, and prioritizing resilience, reversibility, and risk containment over efficiency gains. The guidance was direct: strong governance, explicit accountability, rigorous monitoring, and human oversight are not optional safeguards but essential prerequisites.
The MCP data layer as the highest-risk surface
MCP exists to make it easy to connect an agent to many data sources at once, and that convenience raises the risk. Even a single row in a database table or one page the agent happens to browse can become a place to embed adversarial instructions, if an attacker can influence it, and that can redirect the agent's behavior mid-task.
Part of what makes this dangerous is how easy MCP makes broad access grants. The NSA's Artificial Intelligence Security Center addressed this directly in a Cybersecurity Information Sheet published on May 20, 2026, titled "Model Context Protocol (MCP): Security Design Considerations for AI-Driven Automation." Its core finding: MCP's adoption has outpaced the development of its own security model.
A related and quieter problem is the absence of auditing. Token theft, injection, and data exfiltration can all happen without leaving a trace if there's no agent-level audit trail to check against. This isn't a hypothetical compliance gap. SOC 2 and ISO 42001 both broadly require traceable agent activity, DORA requires it specifically for financial entities' ICT systems, and the EU AI Act requires it for high-risk AI systems. A silent, MCP-connected agent is a liability under these frameworks whether or not an attack ever occurs.
Protocol-level fixes and runtime monitoring treat symptoms, not the underlying condition. That conclusion points toward a different kind of fix than tuning a filter, one that starts with what data the agent is allowed to touch.
Querying Supabase data without direct database access
When a developer connects an AI agent to a Supabase project, the agent inherits whatever database credentials the developer hands it, and the default credential scope, built for application use, is far wider than any agent actually needs. The resulting trade-off is blunt: a read grant risks disclosure, a write grant risks data integrity, and the infrastructure most Supabase teams run today, one shared role, session-level logs, no gate on writes, was designed for neither case.
This is no longer a hypothetical configuration. On August 7, 2026, Supabase became a connector on Perplexity Computer, a hosted agent orchestrator through which Computer can read from and write back to Postgres tables, keep state across runs, look up users, and invoke Edge Functions. That integration makes commercially available the exact setup that maximizes injection risk: a standing, persistent, read-write connection between an autonomous agent and a production database.
The canonical safe-access pattern, scoped read-only credentials and a restricted PostgreSQL role with no write access, reduces how much damage a compromised agent can do, but it does not close the injection surface. A read-only user stops mutation, but it does nothing to stop an injected instruction from causing the agent to hand over data it was legitimately allowed to read. None of these measures, individually or combined, eliminate the surface. They shrink it.
Risk also scales with how much autonomy the agent has, not just with how sensitive the underlying data is. A useful way to see this is by capability level. At Level 1, an agent chatting with data from uploaded files, the risk is minimal because the data surface is bounded and the user controls it directly. At Level 2, natural-language-to-SQL on live data, risk appears in whatever the database hands back. At Level 3, an investigative agent decomposing open-ended "why" questions, risk compounds because the agent is chaining multiple tool calls, and each call is its own injection surface. At Level 4, an autonomous agent monitoring, investigating, and delivering results with no human confirming anything in the loop, standing write access to a production Postgres instance is the worst case available, and the Supabase connector on Perplexity Computer makes exactly that configuration available commercially today.
Why patching agent behavior is the wrong frame
Every behavioral defense published so far addresses one specific attack pattern rather than the structural condition that makes all of them possible, and an attacker only has to find the one pattern a given defense doesn't cover. Model hardening and input guardrails were tuned to catch instruction-shaped text, and ADI defeats them by working on trusted metadata instead, showing that a defense built for one attack class leaves the adjacent class wide open.
The ADI researchers tested one heavy-handed fix: a defense that tracks the provenance of every piece of data as it moves through the system. A defense that damages the thing it's protecting isn't a defense anyone can actually ship. Researchers at NIT Calicut make the deeper point explicit: existing guardrail mechanisms were designed for conversational AI with a human watching, single-turn exchanges, trusted input channels, and text-only output. Autonomous, data-reading agents violate every one of those assumptions at once.
Separation fixes this: agents should consume data that has already been processed, validated, and bounded. If the data an agent reads has already been vetted before it ever reaches the model, the injection surface shrinks down to that governed dataset instead of spanning the entire production database with all its unvetted rows. If you expose data through a single MCP server with an explicit schema, instead of open SQL access to production tables, the agent's entire tool-call surface is defined in advance and auditable after the fact, so an injected instruction embedded in a query result can't invoke a tool the server never exposed. This is the principle Dreambase operationalizes for Supabase teams: pre-modeling data into governed Parquet datasets queryable through DuckDB, and exposing all of it through a single MCP server, so the agent gets fast, accurate, cheap-to-query context without ever touching the production database directly.
ChatGPT's Atlas browser defeated the click-hijacking attack from the ADI paper, because it tags page elements with random, unguessable IDs instead of sequential ones, showing that one behavioral fix did work. The open question for Supabase teams is how to apply that same unpredictability, that same separation between the trusted layer and the untrusted one, at database scale.
A governed data layer for Supabase teams running agents
A governed data layer for agent access needs three things that raw Postgres access cannot provide on its own: physical separation from the production database, an explicit and bounded schema, and a complete audit trail for every query. An injection embedded in a query result has nowhere to propagate back to, because the agent was never given a write path into production. Auditability means every tool call, every query, and every change in context gets logged at the data layer itself, not reconstructed afterward from scattered application logs, which is what closes the gap that makes MCP-connected agents such a quiet compliance risk.
For teams already running Supabase, none of this requires replacing Postgres. It means extending it into an analytical layer, with no ETL pipeline, no separate warehouse, and no new infrastructure to maintain. Dreambase builds this pattern directly for Supabase projects: it sits as the data layer between Postgres and any agent or human consumer, pre-modeling data into Parquet datasets queryable through DuckDB and exposing it all through one MCP server, so agents get fast, accurate context while production databases stay untouched.
The same governed layer that closes off the injection surface also fixes a separate, older problem: metric inconsistency. An agent with open SQL access inherits that inconsistency and can amplify it across every workflow it touches. Pre-calculated, named metrics, one definition of ARR, one definition of an active user, one definition of churn, computed once and served from the governed layer, mean every agent query and every human dashboard reads from the same number. The architecture that keeps an agent safe from injection is the same architecture that makes its numbers worth trusting.
Sources
- Agent Data Injection Attacks are Realistic Threats to AI Agents
- Assessing Automated Prompt Injection Attacks in Agentic Environments
- Toward Secure AI-Powered Penetration Testing Agents: Security Threats, Guardrails, and Architectural Perspectives
- The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis
- From prompt injections to protocol exploits: Threats in LLM-powered AI agents workflows - ScienceDirect
- Model Context Protocol Threat Modeling and Analyzing Vulnerabilities to Prompt Injection with Tool Poisoning


