Skip to content

Best practices for AI agents

Use Tiger MCP and Tiger CLI safely with AI agents, including read-only mode, forks and 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.

When you want an agent to explore and query without making any changes, enable read-only mode:

Terminal window
tiger config set read_only true

When read-only mode is on:

  • Mutating Tiger MCP tools and CLI commands (service create, fork, start, stop, resize, update-password, and delete) are refused.
  • Database sessions run in Tiger Cloud's immutable read-only mode, so writes and schema changes (DDL) are rejected by the server.
  • Read operations, such as listing services and running SELECT queries, still work.

To restrict a single session without changing your saved configuration, set the environment variable instead:

Terminal window
TIGER_READ_ONLY=true tiger mcp start

Turn read-only mode back off with tiger config unset read_only.

Default production to read-only

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 and connect the agent using that role's credentials. 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.

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 Common tasks.
  • Read replica: connect the agent to a replica so exploration never touches the primary.

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.

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.