How to restrict an AI agent to only read data from tools?

I’ve set up an AI agent to query work information. I want to make sure that whenever I ask the AI agent questions related to “work arrangements” or “work items,” it must search the information in Google Sheets before replying.

I’ve tried filling in the system message of the AI agent with the reply rules I want it to follow. However, no matter how I modify or adjust it, most of the time the AI agent skips Google Sheets when it’s running and uses Gemini to generate a reply directly. Therefore, most of the time the reply is incorrect (the reply format is correct, but the information in the reply is completely absent from the Google Sheets form. Gemini will randomly fabricate non-existent work information).

I would like to ask how to set it up so that the AI agent completely relies on the Google Sheets data to answer questions.

Information on your n8n setup

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

Welcome to the community :tada:

I found a thread similar to this one here so posting it for reference: How to Force n8n AI Agent to Use Tools?
here’s the summary:

  • Separate the task if it’s always needed.
  • Over-prompt system and user prompts; make dependencies explicit.
  • Improve tool description clarity.
  • Enable intermediate steps to track tool usage and verify calls.
  • Use a strong LLM model for better results.

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