Enforcement.
How Vericto decides what to do with each query: the split between severity and action, the possible decisions, and observe mode (dry-run) for validating your ruleset before blocking in production.
Overview
Every query that passes through Vericto is analyzed against the workspace ruleset. The analysis produces two distinct things: a severity, which describes how dangerous the query is, and an enforcement action, which describes what Vericto does about it. Separating the two concepts is what lets you tune the response without changing the risk classification.
The action is resolved by the workspace enforcement policy based on the severity. The final result of each query is one of five decisions: ALLOWED, FLAGGED, MONITORED, BLOCKED, or PARSE_ERROR.
Only BLOCKED stops a query. The other decisions forward the query to the database; they differ in the telemetry and alerts they generate. When observe mode is active, not even BLOCKED stops anything: all BLOCK actions are downgraded to FLAG.
Severity versus action
Vericto deliberately treats these two axes separately:
- Severity: how dangerous the query is. It is a property of the rule that fires and does not change between workspaces. The levels are Critical, High, Medium, Low, and Informational.
- Enforcement action: what Vericto does when a query violates a rule. The actions are
BLOCK(stop),FLAG(forward with an alert), andMONITOR(forward and log, no alert). The action is decided by the workspace enforcement policy.
The practical benefit: two organizations may agree that a DELETE without a WHERE is Critical severity, but one chooses to block it and the other only to alert while it adjusts its processes. Severity is a fact about the query; the action is a policy decision.
Per-query decisions
After analysis, each query receives exactly one of these decisions. Only BLOCKED prevents the query from reaching the database:
| Decision | Source action | Behavior |
|---|---|---|
ALLOWED |
— | The query violates no rule. The proxy forwards it to the database unchanged. |
FLAGGED |
FLAG |
The query violates a rule with a FLAG action. It is forwarded to the database, but it generates telemetry and fires an alert to the configured notification channels. |
MONITORED |
MONITOR |
The query violates a rule with a MONITOR action. It is forwarded and logged in the audit trail, without firing alerts. |
BLOCKED |
BLOCK |
The query violates a rule with a BLOCK action. The TCP proxy returns SQLSTATE 42501 and the query never reaches the database. The CLI and API report status BLOCKED and exit_code 1. |
PARSE_ERROR |
— | The query syntax is invalid and could not be parsed. By default Vericto operates fail-open: it forwards the query and logs it, without counting it as a block. The behavior is configurable to fail-closed per workspace. |
Default policy
When you turn on enforcement, Vericto applies this severity-to-action mapping. You can tune it per rule, but these are the starting values:
| Severity | Default action | Resulting decision |
|---|---|---|
| Critical | BLOCK |
BLOCKED |
| High | BLOCK |
BLOCKED |
| Medium | FLAG |
FLAGGED |
| Low | MONITOR |
MONITORED |
| Informational | MONITOR |
MONITORED |
| Parse error | Allow + report (fail-open) | PARSE_ERROR |
Default policy in brief: Critical and High are blocked, Medium is flagged, Low and Informational are monitored, and parse errors are allowed and logged.
Observe mode (dry-run)
Observe mode is a dry-run mode for validating the impact of your ruleset before blocking real traffic. While it is active, all BLOCK actions are downgraded to FLAG: nothing is blocked, but the dashboard shows you exactly which queries would have been blocked and by which rule.
Observe mode does not expire. The schema records observe_since (when the workspace entered observe) alongside monitor_mode; while the workspace is observing, every BLOCK decision is downgraded to FLAG. You can optionally set a target end date (observe_mode_expires_at): reaching it does not start blocking — the workspace stays in observe and we tell you.
Choice during onboarding
Every workspace starts in observe, with no end date. When you connect your first database you can choose between two modes:
- Observation (the default): Vericto blocks nothing and only flags what it would have blocked. It lasts until you switch to enforce: nothing changes it by itself. Ideal for measuring impact with no risk.
- Immediate protection: enforcement is active from the very start and
BLOCKactions stop queries for real.
How to turn on real enforcement
While the workspace is observing, the dashboard shows it in Dashboard → Rules with the date it has been observing since, and the mode can be changed there in both directions whenever you want. At 14 days in observe we remind you once in the dashboard, with “Switch to enforce” and “Stay in observe”; if you choose to stay, we remind you exactly once more 30 days later and never again. When you switch to enforce, BLOCK actions start stopping queries again immediately.
While observe mode is active, your database is not protected against destructive queries: everything is forwarded. Because observe never expires, only you decide when it ends: the state and the date it has been observing since are visible in the dashboard and in the signed compliance report.
The state can be read and changed via API with GET and PATCH on the enforcement-policy endpoint, which exposes observe_mode_active, observe_since, monitor_mode and the optional target end date (observe_days when writing, observe_mode_expires_at when reading).
Parse error handling
When a query has invalid syntax and Vericto cannot parse it, there is no AST to analyze against the ruleset. The behavior in that case is defined by the workspace policy:
- Fail-open (default): the query is forwarded to the database and logged as
PARSE_ERROR. It does not count as a block. It prioritizes availability: a malformed query usually fails on its own in the database engine. - Fail-closed (configurable): the query is blocked if it cannot be parsed. It prioritizes security, at the cost of rejecting queries the parser does not recognize even if they were legitimate.
The default is fail-open because it avoids outages from SQL dialects or constructs the parser does not yet cover. If your environment requires that nothing reaches the database without being analyzed, switch to fail-closed in the dashboard, under Settings → Unparseable queries. The admin and owner roles can change it. It applies to the TCP proxy and the Runtime API, which reject the query. The CLI, the Validation API and MCP execute nothing, but they apply the same workspace policy (per-severity actions, observe mode and unparseable queries) and answer what runtime would: under fail-closed, an unparseable query comes back BLOCKED with exit_code 1. The one difference is that there schema changes (DROP, ALTER, TRUNCATE) are reported as FLAGGED instead of blocked, so a migration does not break the pipeline.
Per database
Each database can have its own policy for unparseable SQL, under Dashboard → Databases → Unparseable SQL. The admin and owner roles can change it, and every change is recorded in the audit log as database.updated, with the old and the new value:
- Inherit workspace (default): the workspace policy applies, fail-open or fail-closed.
- Flag: on this database the query is recorded as
PARSE_ERRORand allowed, even when the workspace is fail-closed. - Block: on this database the query is blocked, even when the workspace is fail-open.
The effective value (the database's own when it has one, otherwise the workspace's) reaches every channel for that database: the TCP proxy receives it when it syncs the rules, already resolved for its database; the Runtime API applies it; and the CLI, the Validation API and MCP apply it when the check names the database_id (without it, the workspace policy is used). A database with an agent allowlist in enforce (VERICTO-087) or a sensitive column under block or mask (VERICTO-085) blocks unparseable SQL whatever this setting says: a query nobody could read cannot be shown to stay inside the allowlist or away from the column. The allowlist forces it for the identities it covers. The dashboard shows it as "Block (enforced: …)".
Recommended: Block for databases that AI agents access. Via API: PATCH /api/v1/workspaces/{workspace_id}/databases/{database_id}/parse-error-policy with {"parse_error_policy": "inherit"}, "flag" or "block".
Frequently asked questions
What is the difference between severity and action?
Severity describes how dangerous a query is and is a property of the rule that fires. The action describes what Vericto does (block, flag, or monitor) and is decided by the workspace enforcement policy. You can change the action without changing the severity.
What does the client receive when a query is blocked?
The TCP proxy returns SQLSTATE 42501 and the query never reaches the database. With the CLI or API, the status is BLOCKED and the exit_code is 1, which lets you fail a CI/CD pipeline on a dangerous query.
Does observe mode protect my database?
No. In observe mode all BLOCK actions are downgraded to FLAG, so no query is stopped. It is for measuring the impact of your ruleset, not for protection. Because it does not expire, the workspace keeps not blocking until you switch to enforce from Dashboard → Rules.
Can I change the action for a specific severity?
Yes. The default policy table is only a starting point. You can tune the action per rule from Dashboard → Rules, for example lowering a High rule from BLOCK to FLAG while you adapt your processes.
What happens if Vericto cannot parse a query?
By default, in fail-open, the query is forwarded and logged as PARSE_ERROR, without counting as a block. If your workspace is in fail-closed, the query is blocked because it cannot be analyzed. Each database can replace that policy with its own (Flag or Block).