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.
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, enable read-only mode:
tiger config set read_only trueWhen read-only mode is on:
- Mutating Tiger MCP tools and CLI commands (
service create,fork,start,stop,resize,update-password, anddelete) 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
SELECTqueries, still work.
To restrict a single session without changing your saved configuration, set the environment variable instead:
TIGER_READ_ONLY=true tiger mcp startTurn read-only mode back off with tiger config unset 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.
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 Common tasks.
- Read replica: connect the agent to a replica so exploration never touches the primary.
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.
- 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.