Best practices for AI agents
Use Tiger MCP and Tiger CLI safely with AI agents, including read-only mode, forks and read replicas, and effective prompting
Tiger MCP lets an AI agent act on your Tiger Cloud services: create and fork services, run queries, and change data. This page covers how to keep that safe and get better results. New to these tools? See Tiger CLI and Tiger MCP.
Restrict agents to read-only
Section titled “Restrict agents to read-only”When you want an agent to explore and query without making any changes, turn on read-only mode. See Restrict Tiger MCP to read-only for the commands: it blocks mutating CLI commands and Tiger MCP tools, and puts database sessions into Tiger Cloud's immutable read-only mode so writes and schema changes are rejected by the server.
This also protects your bill: creating, forking, and resizing services all provision or change billable resources, and read-only mode disables the Tiger MCP tools for all three.
Keep production services in read-only mode and only escalate to write access deliberately, for the specific change you intend to make.
For an additional layer of security, create a dedicated read-only database role, save its password with tiger db save-password <service-id> --role <role> --password=<password>, then connect the agent as that role (tiger db connect <service-id> --role <role>, or the role parameter on Tiger MCP's database tools). Because the restriction is enforced by the database itself, it applies no matter how the agent connects. See Manage data security in your Tiger Cloud service to create the role.
Test against a fork or a read replica
Section titled “Test against a fork or a read replica”For exploratory or agent-driven work, point the agent at a copy of your data instead of production:
- Fork a service to get an isolated, writable copy you can experiment on and then discard. See Manage your services.
- Read replica: connect the agent to a read replica so exploration never touches the primary or its write performance. Add a read replica in Tiger Console, then point the agent at that set's own connection details.
Have the database do the work
Section titled “Have the database do the work”Agents sometimes pull large result sets to the client and process them locally, which is slow and can expose more data than needed. Get better results by:
- Asking for a single computed answer (an aggregate, a ratio, a yes/no) rather than raw rows.
- Setting explicit limits in your prompt, for example "return at most 50 rows."
- Asking the agent to show the SQL it will run so you can verify it before it executes.
Guardrails for coding agents
Section titled “Guardrails for coding agents”When you use an agent like Claude Code against your database, add project instructions (for example, in CLAUDE.md) that state which services are production, that production is read-only, and which project to use. This reduces mistakes when an agent switches context.
Next steps
Section titled “Next steps”- Common tasks with Tiger CLI and Tiger MCP: Manage services and work with your data from the CLI or your agent.
- Cookbook: Longer, multi-step prompts for schema design, data analysis, and performance tuning.
- Integrate Tiger Cloud with your AI agent: Set up Tiger MCP and connect it to your AI agent.
- File an issue in the Tiger CLI repo: Report bugs or request features to help shape the open-source Tiger CLI and Tiger MCP.