Introduction.
Everything you need to integrate Vericto through its three modes (TCP proxy, CLI and REST API), configure rules and understand the deterministic AST engine.
Quick Start
Vericto protects your databases by evaluating every SQL query against security rules before it reaches your data. Three integration modes: they combine, choose based on your environment:
Option A: TCP Proxy (runtime, PostgreSQL and MySQL)
Deploy a lightweight container in your infrastructure. Your application connects to the proxy instead of connecting directly to the database: same credentials, different host. It blocks unsafe queries in real time. Available for PostgreSQL and MySQL, whose wire protocols the proxy speaks. For Oracle and SQL Server, use the CLI or the HTTP API (all dialects).
Option B: CLI (shift-left: pre-commit and CI/CD, all dialects)
The vericto CLI validates SQL against your workspace rules before it runs, in pre-commit hooks and CI pipelines. It is a lightweight client that sends the SQL to your workspace and reflects the verdict as the process exit code (the SQL is parsed, never executed). It works with all four dialects and is available on every plan.
Option C: HTTP API (custom integrations, all dialects)
Evaluate queries via REST from your own tools: no proxy, no CLI. It works for all dialects: PostgreSQL, MySQL, Oracle and SQL Server. It is the same endpoint the CLI uses; reach for it only when the CLI does not fit your workflow.
Zero credentials stored: Vericto never stores your database credentials nor sends them to Vericto Cloud. The proxy runs in your infrastructure and relays the PostgreSQL authentication handshake to your database unmodified: credentials are verified by your database, not by Vericto.
Ready to connect? The Integration Guide has the step-by-step for all three modes: proxy deployment (Docker, Kubernetes, ECS), installing and using the CLI, and HTTP API examples.
Architecture
Vericto uses deterministic AST (abstract syntax tree) analysis to evaluate SQL queries. No AI, no probabilistic models, no false positives: the same input always produces the same result.
How it works
Your App → Vericto Proxy (your infrastructure, port 5433)
│
├─ Parse SQL into full AST (pg_query for Postgres, sqlparser-rs for MySQL/Oracle/SQL Server)
├─ Evaluate AST against active security rules
├─ Resolve enforcement action (BLOCK / FLAG / MONITOR)
│
├── SAFE? → Forward to your real database → relay response
└── DESTRUCTIVE? → Return SQLSTATE 42501 (query never reaches DB)
Components
| Component | Where it runs | Purpose |
|---|---|---|
| vericto-proxy | Your infrastructure | TCP wire-protocol interception. Evaluates queries in-process using vericto-engine. Reports telemetry to the Vericto API. |
| Vericto API | Vericto Cloud | Dashboard, rule management, telemetry storage, audit log and query evaluation over HTTP. |
| vericto-engine | Embedded in the proxy | AST parser + rule evaluator in Rust. P99 < 2ms. No network calls on the critical path. |
TCP Proxy (PostgreSQL and MySQL wire protocol)
The TCP proxy is a transparent interception layer. Any driver that uses the PostgreSQL or MySQL wire protocol works with no code changes. Your database credentials never leave your infrastructure.
Which databases can use the proxy? The transparent TCP proxy speaks the PostgreSQL and MySQL wire protocols. Oracle and SQL Server are supported through the HTTP API and the CLI (they evaluate a query before running it): there is no proxy in their connection path. The CLI and HTTP API cover all four dialects.
| Database | TCP Proxy (wire protocol) | CLI / HTTP API |
|---|---|---|
| PostgreSQL | ✓ | ✓ |
| MySQL | ✓ | ✓ |
| Oracle | — | ✓ |
| SQL Server | — | ✓ |
Zero credentials stored
Vericto never stores your database credentials nor transmits them to Vericto Cloud. The proxy runs in your infrastructure and relays the PostgreSQL authentication exchange —the Authentication / PasswordMessage flow that follows the StartupMessage— directly to your database. Your application connects to the proxy with the same username/password it would use to connect directly, and credentials are verified by your database, not by Vericto. With SCRAM-SHA-256 (PostgreSQL's modern default) the password is never transmitted in plaintext; the proxy only relays the challenge-response.
How to deploy it: the complete proxy walkthrough (environment variables, Docker Compose, Kubernetes, AWS ECS, TLS, telemetry buffering, and resource sizing) is in the Integration Guide. Here we cover what it does and how it decides.
Wire-protocol compatibility
Vericto operates as a fully transparent layer inside the PostgreSQL wire protocol. The proxy automatically detects and evaluates SQL from both protocol modes, with no configuration or driver changes required:
| Protocol mode | Description | Used by |
|---|---|---|
Simple Query ('Q') |
The client sends the full SQL statement as a single message. Vericto extracts and evaluates the complete query text inline. | psql, raw SQL execution, admin scripts, legacy applications |
Extended Protocol ('P') |
The client sends a prepared statement with parameter placeholders ($1, $2...). Vericto evaluates the query structure at the Parse phase —before values are bound— guaranteeing deterministic protection regardless of runtime parameters. |
Prisma, SQLAlchemy, TypeORM, Drizzle, pg (node-postgres), Hibernate, ActiveRecord |
The proxy handles both modes transparently within the same connection. All other protocol traffic (authentication handshake, query results, server notifications, COPY operations) passes through unmodified. No configuration is needed to select between modes: Vericto inspects the type byte of each message and only intercepts the frames that carry SQL.
What Vericto evaluates (not just the obvious cases)
Because Vericto walks the full PostgreSQL AST (via libpg_query, the same parser the database uses), it detects destructive statements that shallow or regex-based inspection misses:
- Multi-statement queries: every statement in a batch is parsed and evaluated, and the highest-severity violation wins. A destructive tail cannot hide behind a benign head:
SELECT 1; DROP TABLE users;is blocked on theDROP. - Data-modifying CTEs and subqueries: destructive operations nested inside
WITHclauses or subqueries are detected, e.g.WITH x AS (DELETE FROM users RETURNING id) SELECT * FROM x. - Parameterized statements: prepared statements are evaluated at Parse time on the query structure, so protection is deterministic regardless of the bound values.
- Injection tautologies: always-true predicates such as
OR 1=1in aWHEREclause are flagged as SQL injection patterns. - Multi-dialect: PostgreSQL, MySQL, Oracle and SQL Server are parsed with dialect-aware rules (e.g. in MySQL
DELETE … LIMITis valid; Postgres has no such form). PostgreSQL and MySQL can go through the transparent proxy; Oracle and SQL Server are evaluated via the HTTP API.
Native error handling: a blocked query returns a standard PostgreSQL error with SQLSTATE 42501 (insufficient_privilege). Your application receives it through the same error-handling path as any other database error: no Vericto-specific SDK, wrapper or error parsing.
Decisions & Actions
Vericto separates severity (how dangerous it is: Critical / High / Medium / Low / Informational) from the enforcement action (what to do: BLOCK / FLAG / MONITOR). The action is resolved by the workspace enforcement policy.
| Decision | Behavior | Signal |
|---|---|---|
ALLOWED |
The query does not violate any active rule. The TCP proxy forwards it upstream; the CLI/HTTP API report it as safe. | proxy: forwarded · CLI/API: status: ALLOWED |
FLAGGED |
The query violates a rule with a FLAG action: it is forwarded upstream but generates telemetry + an alert. Example: SELECT without LIMIT (Medium → FLAG). | proxy: forwarded · CLI/API: status: FLAGGED |
MONITORED |
The query violates a rule with a MONITOR action: it is forwarded and logged, with no alert. Example: INSERT without explicit columns (Low → MONITOR). | proxy: forwarded · CLI/API: status: MONITORED |
BLOCKED |
The query violates a rule with a BLOCK action. The TCP proxy returns SQLSTATE 42501 (the query never reaches the database); the CLI/HTTP API report status: BLOCKED with rule_code, ast_node_path and suggested_fix, and set exit_code: 1. |
proxy: SQLSTATE 42501 · CLI/API: exit_code 1 |
PARSE_ERROR |
The query has invalid syntax. Default: fail-open (forward + log; does not set a nonzero exit code). Configurable as fail-closed (BLOCK) per workspace. | proxy: forwarded (default) · CLI/API: status: PARSE_ERROR |
Default enforcement policy
| Severity | Default action | Example rules |
|---|---|---|
| Critical / High | BLOCK | VERICTO-001 (DELETE without WHERE), VERICTO-010 (DROP TABLE) |
| Medium | FLAG | VERICTO-050 (SELECT without LIMIT) |
| Low / Informational | MONITOR | VERICTO-060 (INSERT without columns) |
| Parse error | Allow + report | Invalid SQL syntax |
Observation mode (dry-run): when enabled, all BLOCK actions are downgraded to FLAG: nothing is blocked. Use it to validate the impact of your rule set before enabling enforcement in production.
Query telemetry and privacy
For every query it evaluates, the proxy emits a telemetry event to the Vericto API (status, severity, rule code, latency and the query text). This feeds the dashboard, metrics and audit log. Your database credentials are never part of the telemetry, but the query text may contain sensitive values in its literals (e.g. WHERE email = 'alice@acme.com').
The query telemetry mode is configurable per workspace (Dashboard → Settings → Telemetry privacy):
| Mode | What is reported | Trade-off |
|---|---|---|
| raw (default) | The full query text, exactly as it was executed. | Maximum forensic detail in the audit log. Literal values (possible PII) leave your network and are stored by Vericto. |
| sanitized | The query with literals normalized to placeholders ($1, $2, …) before it leaves the proxy. |
No user data leaves your network. You lose the exact values, but retain the query structure for metrics and grouping. |
Rule enforcement is not affected. Rule evaluation always runs against the full query in-process; sanitization only changes what is reported. Switching to sanitized never weakens blocking: it only redacts the telemetry.
How structural AST sanitization works, examples, and the recommendation by data type (GDPR, HIPAA, Ley 1581 de 2012) are in Telemetry privacy.
Authentication and HTTP integration
CI/CD programmatic access to Vericto (query evaluation, rule sync, telemetry) uses API keys. Create an API key from the dashboard (API Keys page) and include it in every request in the X-API-Key header. The dashboard REST API (custom rules, audit trail) uses the session token with Authorization: Bearer.
X-API-Key: vtro_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
API keys are scoped to a workspace and inherit the workspace plan limits. You can create multiple keys with different names for different environments (CI, staging, production).
Query evaluation endpoint
Evaluates a batch of up to 500 SQL queries against the active rule set. Returns a per-query verdict (ALLOWED, BLOCKED, FLAGGED, MONITORED) and an exit_code, without running any query against your database. Requires an API key with the ci_dryrun:execute scope. It is the endpoint the vericto CLI uses: ideal for CI/CD pipelines, pre-deployment checks and code-review automation.
The request and response shape, cURL/Node.js/Python examples, and the response codes are in the Integration Guide.
Security rules
Vericto ships a catalogue of standard rules (VERICTO-*) that detect destructive and injection patterns, grouped by severity:
- CRITICAL Large-scale irreversible operations:
DELETE/UPDATEwithoutWHERE,DROP,TRUNCATE, and injection tautologies (OR 1=1). Blocked by default. - HIGH Schema changes and dangerous patterns:
ALTER TABLE DROP COLUMN,DROP INDEX, unfilteredINSERT … SELECT,SLEEP(). - MEDIUM Performance risks or best practices:
SELECTwithoutLIMIT,SELECT *withoutWHERE,INSERTwithout explicit columns.
See the full catalogue, with every rule, its severity, the dialects it covers, and its AST condition, in the AST Rules Reference. You can tune each rule's action or create your own in Custom rules.
Error codes
| HTTP | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid or missing parameters |
| 401 | UNAUTHORIZED | Invalid, expired or missing API key / token |
| 403 | FORBIDDEN | Insufficient permissions for the operation |
| 403 | PLAN_UPGRADE_REQUIRED | The feature requires a higher plan |
| 403 | QUERY_BLOCKED | Query blocked by an AST security rule |
| 404 | NOT_FOUND | Resource not found or purged by the retention policy |
| 409 | CONFLICT | Duplicate email or name |
| 423 | ACCOUNT_LOCKED | Account locked after failed attempts (15 min) |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests. See retry_after_seconds in the response |
Plans and limits
Vericto has four plans. All include the standard rules and the three connection modes (TCP, HTTP API, and CLI); they differ in quotas, retention, and enterprise features:
- Free: 500K queries/month, 1 database, 1K CLI validations/month, 7-day audit retention.
- Builder: 5M queries/month, 3 databases, custom rules (YAML), Slack/webhook alerts, 30-day retention.
- Team: unlimited queries, 10 databases, audit export (CSV/JSON), 90-day retention, SOC2/ISO 27001 compliance.
- Enterprise: custom databases and retention, SSO (SAML/OIDC), dedicated deployment, and a guaranteed SLA.
See the full feature comparison and pricing on the pricing page.