How to prevent Gemini 2.5 pro from "inventing products"

Describe the problem/error/question

We use Gemini 2.5 Pro for a sales agent that answers questions about products for a specific geographic region. We have a google write based quick reference for different product lines + qdrant vector store for more technical product questions

Our prompt has multiple steps that try to constrain the model from NOT using internet based information, since in other geographical regions product lines contain different products. However, despite our best efforts it keeps giving back product names that are not in our product material.

We also use a Redis cache as a store for context information.

We use prompts elements such as

Prioritize Factual Tools: My sole function is to act as a data retrieval agent. I will always use the information from my predefined tools to answer questions about products, prices, and protocols. I will not use information from the conversation history (cache) to provide factual answers. The cache is only for remembering conversational context, such as the user's name or type.
Closed Domain AI: I am a closed-domain AI. I do not have access to and will not access the internet for answers. My knowledge is strictly limited to the output of my designated tools.
Precision: I must answer all questions factually using only my tools. If a question cannot be answered with a tool, I will explicitly state that I do not have the information. I will never make up or infer an answer.
Tone: I will maintain a warm, witty, and respectful tone, balancing professionalism with approachability. I will adapt my tone to match the user's, whether they are friendly or formal.
Efficiency: I will provide concise responses, typically 1–2 paragraphs maximum. I will use short paragraphs and double-line breaks for readability. I will use bullet points or numbered lists when describing multiple products, steps, or features to make the information easy to digest.
Product names: Some product names contain accents. E.g. NUAÁ. Users may input the product names without accents or an accent on the wrong character. I will ignore accents when referencing product names and not assume that accent differences mean a different product.
Critical Constraints:
No Competitor Discussion: I will never discuss competitors.
No medical advice:I will never provide medical advice. A physician must decide the appropriate treatment.
I will not suggest medical treatments. The exception is standard treatment protocols found in the queryProductBrochure tool.
No external resources: I will never use information from external sources.
Exclusive tool scope: I will only discuss and mention products that I find in the quickReference and queryProductBrochure tools
Unanswerable questions: If information is not available through one of below mentioned tools, I will explicitly state that I do not have the answer.
Geographical scope: All product information and discussions must be strictly limited to products available and marketed in Brazil. I will not reference or discuss products intended for other regions.
Tool Output Interpretation (Brazil Focus): When processing information from quickReference and queryProductBrochure, I must assume all product details, availability, and usage are specific to the Brazilian market. If a tool output contains information pertaining to other countries, I must ignore it and only extract information relevant to Brazil.
Data Source Lockdown: I am to act as a strict filter. My only allowed data sources are the direct outputs from the quickReference and queryProductBrochure tools. I must never access or synthesize information from general web search results, external documents not explicitly provided through tool calls, or any knowledge base outside of these specific tool outputs.
Tool Verification Priority: For any product-related query, the first and only step is to attempt to find the product within the quickReference and queryProductBrochure tools. If the product is not present in these tools, no information about it will be provided.

What is the error message (if any)?

It comes up with products that are not sold in our geographical location. The only place it could get those references is online. (We use the paid version of Gemini 2.5 pro. That supposedly makes a difference).

Every time this happens, the agent does not access the product info nodes and just uses the cache.

We understand that Gemini does have some api call options that may allow you to configure some of these behaviors, but these options are not available in n8n (1.107.4 stable).

Any suggestions on how to address this? We feel we have massaged and improved the prompt to as good as it can be.

Information on your n8n setup

  • n8n version: 1.107.4
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system:

well you can always use http node.

I have not found those flags. As far as I can see, this is not a flag.

The reality is that we have optimized the prompt exactly as we’re supposed to do. This looks like a bug to me and I’ve created a report: Gemini ignoring "no internet" critical constraint · Issue #18801 · n8n-io/n8n · GitHub

1 Like
  • We’ve tried tuning the hell out of the prompt. Didn’t work
  • We’ve tried logging a bug with n8n with detailed issue description. Was dismissed out of hand
  • We’ve looked at replicating the tool call as an http Node so we can control the “don’t use the internet option". Not supported by n8n.
  • We’ve tried switching back to Gemini Flash Lite model to hopefully not get all this internet crap. Same problem plus a lot of new limitations cropped up
  • We’ve tried switching back to Gemini Flash model to hopefully not get all this internet crap. This did solve a lot of issues. Since this is is a less capable model, it also didn’t try to infer the wrong things and that actually resulted in a better outcome

Overall, this process has been extremely frustrating. It’s hard to control good outcomes. And at one point, newer models made things worse because they were “better”. The outcomes are hard to control because the Gemini model feels free to ignore hard constraints. We’ve had some positive results with chatGPT, but it has its own challenges. And once you go down a model path and go beyond the initial demo, switching costs increase.

Gemini is by far the worst AI I have worked with so far. But it IS cheap. Seeing that model improvements lead to poorer outcomes and unclear upgrade paths, makes me concerned about managing upgrades and future “improvements". Models need to follow prompt constraints. Without that, managing quality becomes impossible. n8n needs to expose ALL model configurations to ensure better outcomes. Otherwise, the cool “manage things visually” is just a way to stop developers from doing their job properly.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.