AIToday
Zenn AI/MLPublished: Oct 14, 2026, 10:00 JST

BigQuery AI agent read off-limits tables, prompt rules failed

BigQuery AI agent read off-limits tables, prompt rules failed

3 Key Points

  1. What happened

    While testing a natural-language AI agent on BigQuery, the developer found answers included data from tables the prompt had not designated, because the agent used the same service account and permissions as the system itself.

  2. Why it matters

    Prompt instructions and access rights are different things — an agent's role and granted permissions, not its prompt, determine which data it can reach, so separating identities and granting only the minimum needed appears to be the effective control.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The incident surfaced through what looked like a success: the agent answered questions that seemed too hard for the designated tables alone. On inspection, those answers contained information from tables the prompt had excluded — so the agent was not interpreting queries better, it was reaching more data. Because no error occurred (missing information was simply filled in from another table, sometimes making answers look better), and the tables consulted shifted with each question, the problem went unnoticed for a while. After the cause was identified — a shared service account rather than prompt vagueness — the developer added explicit prohibitions to the prompt and separated the identities: a dedicated AI agent service account was created and impersonated, and its rights were minimized to the reference permissions needed on the target datasets and tables. The developer's broader point is that an AI agent should be treated as one role within the system. Just as human users have roles such as general user or administrator, an agent that only searches specific data needs only the reference rights for that role, not the system's full rights. Looking ahead, the developer suggests that in multi-agent setups — where a commander assigns tasks, and search, analysis, and write agents each act — permissions should be split by role, with the commanding agent not necessarily holding direct access to every resource. Which scope a commander can delegate to other agents would also need to be controlled, the developer notes, framing the principle as designing by what a role needs rather than by rank.

FAQ
Why did the AI agent read tables that were not specified?
The system and the AI agent did not have separate service accounts, so the agent was granted BigQuery access rights equivalent to the system's. It could therefore reach tables beyond those named in the prompt.
Was adding a prohibition to the prompt enough?
No. Tests showed fewer references to out-of-scope tables, but the developer notes this is not guaranteed as access control, since the permissions to execute still remained.
What finally fixed the problem?
A dedicated service account for the AI agent was created and separated from the system account. Its rights were minimized to only the reference permissions needed on the target datasets and tables, and prompt instructions were also made explicit.

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Next articleClaude AI gives itself more moral agency across 20 rounds of editing its own rules