Catch PostgreSQL performance regressions and govern autonomous database agents before they reach production. Deterministic EXPLAIN tree analysis, automated AI index rewrites, and zero-trust policies.
QueryPilot inspects execution plans with zero database locks. Detect slow scans, generate optimal covering indexes, and fail pull requests before production regressions occur.
└─ Parallel Seq Scan on orders
Filter: (created_at > '2026-01-01')
cost: 0.00..41890.50 | rows: 184,000
└─ Hash Join (users.id = orders.user_id)
-- Recommended DDL Migration
CREATE INDEX CONCURRENTLY
idx_orders_status_covering
ON orders (status, created_at DESC)
INCLUDE (user_id, amount);
| Query | Base | PR | Diff |
|---|---|---|---|
| get_active | 12.4 | 12.8 | +3.2% |
| list_trans | 45.1 | 8,420 | +18,569% |
| user_feed | 88.0 | 89.1 | +1.2% |
When autonomous AI agents interact with your database, ArmorIQ validates cryptographic CSRG intent tokens to approve read-only inspections while blocking destructive schema mutations.
Autonomous agents can easily generate dangerous DDL or unrestricted table locks. QueryPilot embeds ArmorIQ at the control plane to enforce strict zero-trust boundaries.
Mints short-lived (300s TTL) cryptographic tokens required for all tool invocations.
Enforces policy allowing explain_query and analyze_plan while denying raw
writes.
Every decision is signed and verifiable via the ArmorIQ customer proxy.
armoriq.yaml · Policy Engine Active
version: v1 identity: api_key: $ARMORIQ_API_KEY user_id: querypilot-user agent_id: querypilot environment: sandbox proxy: url: https://customer-proxy.armoriq.ai timeout: 30 mcp_servers: - id: querypilot-db auth: type: bearer token: $QUERY_PILOT_MCP_TOKEN # Zero-trust principle: allow inspection, block mutation policy: allow: - querypilot-db.explain_query deny: [] intent: ttl_seconds: 300 require_csrg: true
QueryPilot operates an MCP server over Streamable HTTP on port :3333. Seamlessly connect Claude
Desktop, Cursor, or autonomous agents to analyze database plans.
Accepts raw SQL queries, runs EXPLAIN (FORMAT JSON) without executing data mutations, and
returns parsed AST metrics.
Scans the execution tree for high-cost sequential scans, cartesian products, and missing foreign key join indexes.
Cross-references table statistics and schema to output exact CREATE INDEX CONCURRENTLY
recommendations.
{
"mcpServers": {
"querypilot": {
"command": "npx",
"args": ["tsx", "src/mcp/server.ts"],
"env": {
"PORT": "3333",
"DATABASE_URL": "postgresql://..."
}
}
}
}
Test real SQL queries against our plan evaluator. Switch presets or write custom SQL to see live cost calculation and AI index generation.
Execution Plan Tree:
└─ Parallel Seq Scan on orders
Filter: (status = 'unfulfilled' AND created_at >= '2026-01-01')
cost: 0.00..41890.50 | rows: 184,000
└─ Hash Join (users.id = orders.user_id)
$ npx tsx src/index.ts analyze queries/report.sql Analyzing PostgreSQL execution plan... ✔ EXPLAIN (FORMAT JSON) complete [14ms] ⚡ Execution Plan Tree: └─ Index Scan using users_pkey on users (cost=0.42..8.44 rows=1) Index Cond: (id = 42) ✔ No sequential scans or unindexed sorts detected. Safe to ship!
Postgres EXPLAIN + ArmorIQ Zero-Trust policy demo video from the creator.