<!-- Vericto setup prompt: AI agents (MCP), version 1 (2026-10-16). https://vericto.com/setup/ai-agents.md -->
Values in angle brackets (<database_id>, <workspace_name>, ...) come from the Vericto dashboard: ask the user for them, or copy this prompt from Dashboard → Integrations → Set up with AI, where they are filled in.

You are connecting an AI agent to Vericto so it checks SQL with check_sql before it runs, commits or proposes it, for the database "<database_name>" (<dialect>) in the Vericto workspace "<workspace_name>". Optionally the agent's key gets an agent access allowlist: the tables and columns it may touch on that database (Team and Enterprise plans).

Start by checking what is already in place, then only do what is missing or broken. Do not redo steps that already pass.

MCP servers you may have:
- vericto-account (support, read-only): setup_status, explain_block, search_docs.
- vericto (runtime): check_sql, list_rules, show_rule, list_reports, show_report, whoami.
If vericto-account is not connected, inspect this repository and the agent's MCP configuration instead and ask me to confirm anything you cannot see.

Values (not secrets): runtime MCP URL = https://mcp.vericto.com/mcp, VERICTO_DATABASE_ID = <database_id>, dialect = <dialect>.
Secrets: each agent's API key is ALWAYS read from an environment variable (VERICTO_API_KEY for this agent). Never ask me to paste it, never print it, never write it into a file that is committed. Agent configuration files that hold a key belong in the user's home directory, never in the repository.

Step 1 - Check current state.
Look for an MCP server named vericto in the agent's configuration (claude mcp list; ~/.cursor/mcp.json; .vscode/mcp.json; ~/.kiro/settings/mcp.json). If it is there, call vericto.whoami: it lists this workspace's databases and the remaining checks. If vericto-account is connected, call setup_status with database_id=<database_id> and report whether MCP checks already arrive and how many agent access policies the database has.

Step 2 - API key per agent (a human does this).
Each agent identity gets its own key, so its checks and its allowlist identify it. Ask me to create a key in https://app.vericto.com/dashboard/api-keys with only the scope ci_dryrun:execute, named after the agent, and to keep it in the environment variable VERICTO_API_KEY of the agent's process. Wait for me to confirm.

Step 3 - Add the runtime MCP server to the agent.
Claude Code:
  claude mcp add --scope user --transport http vericto https://mcp.vericto.com/mcp --header 'Authorization: Bearer ${VERICTO_API_KEY}'
Cursor (~/.cursor/mcp.json, in the home directory):
  { "mcpServers": { "vericto": { "url": "https://mcp.vericto.com/mcp", "headers": { "Authorization": "Bearer ${env:VERICTO_API_KEY}" } } } }
Other clients: a remote HTTP MCP server at https://mcp.vericto.com/mcp with the header Authorization: Bearer ${VERICTO_API_KEY}, written in that client's own syntax for environment variables.
Restart the agent and call vericto.whoami to confirm the connection.

Step 4 - Agent access allowlist in observe mode (optional, Team and Enterprise; a human does this).
Ask me to open https://app.vericto.com/dashboard/databases, choose "<database_name>", then Data access, then Agent access, pick this agent's key, and mark the tables and columns it needs, in observe mode. In observe mode access outside the list is flagged, not denied. Suggest the tables you see the agent use in this repository; do not guess others.

Step 5 - Verify.
Call vericto.check_sql with sql="DELETE FROM vericto_setup_probe", dialect="<dialect>" and database_id="<database_id>". Nothing is executed. Expected: BLOCKED (missing WHERE), with a suggested fix. This costs one check from the monthly allowance. Then call vericto.list_reports for the report id and vericto-account.explain_block with it, and tell me in two sentences why it was blocked.

Step 6 - Allowlist to enforce (I decide).
If there is an allowlist, tell me to review its flagged accesses for a few days and switch it to enforce in the same Agent access panel when they look right. Do not change it yourself. Add to the agent's instructions (CLAUDE.md, AGENTS.md or the client's rules file): "Before you run, commit or propose SQL, call vericto.check_sql; BLOCKED means it must not ship as written."

Finish with a checklist: key per agent, MCP server added, whoami, allowlist mode, probe result.
