psql, for an ORM, for a dashboard and for an agent.
Free tier: one Sidecar per organization, with one Guardrail, one Data Masking rule and one Access Request rule. The Sidecar logs in to join your organization. More than one rule per feature, more than one Sidecar, or your own Control Plane needs Enterprise.
Configuration
One block.mask says what to rewrite, and a mask block carrying rules masks — there is no second switch to set.
config.yaml
entities is a list, even for one type, and one rule can name several:
pii and every supported entity is enabled. Add the section only to narrow the set, which also makes it exhaustive — a mask rule naming a type outside the list is then refused at startup rather than silently masking nothing.
config.yaml
Rule fields
Strategies
hash is the one worth knowing about: equal inputs give equal outputs, so a masked column still works as a join key. An analyst can group by customer without ever seeing a customer.
Entity rules and column rules
Two ways to name what gets masked, and they fail in opposite directions. Entity rules mask by detection. They work anywhere a value appears, including inside an opaque HTTP body or an MCP tool result, where the protocol names nothing — and they miss whatever the detector does not recognize. Column rules mask by position. They cannot miss, because they never guess — and they only work where the protocol names its values, which means result sets, not payloads.Inheritance: a listener’s mask block replaces the defaults
This is the single most common way a working config quietly stops masking:config.yaml
mask block replaces the top-level list rather than extending it. Adding one column rule drops every inherited entity rule, so list those again alongside it. This is deliberate: a rule owns an entity type, and two concatenated lists would leave two rules competing for one entity.
guardrails.rules behaves the opposite way — it concatenates.
Masks the AI applies
The Sidecar’s AI analyzer can also apply masks. On anallow, warn, require_approval or ai-handoff risk level, ai_rules selects the library rules the AI may apply to the statement it rated. With mode: existing_and_new, the AI may also create a one-time rule. A config file writes the library in rule_library. A Control Plane serves it from your organization’s Data Masking rules.
- One statement only. A mask applies to the response of the statement the AI rated. The listener’s own
maskblock never changes. A rule the AI creates is never saved to the library. - Scope depends on the protocol, and every path fails closed. On Postgres, the mask covers that statement’s response; a masked statement sent with the extended query protocol is denied. On HTTP, it covers one uncompressed response with a JSON or text body. On MySQL, Oracle and ClickHouse, it covers the rest of the connection, so every later statement is denied until the client reconnects. On gRPC and Spanner with descriptors, it covers every response of the call. Every other protocol denies a statement the AI masked.
- Visible. The audit record and the session details show each rule the AI applied or created, with its reason.
- Requirements. An Enterprise license and Sidecar 1.307.0 or later.
Verify what actually resolved
The admin API (admin.api_listen, off unless set) reports the resolved state per listener, which is the only place the merge above is visible:
Looking for masking on the Hoop Gateway instead? That is a different implementation, configured in the web app with DLP providers and per-resource roles. See Live Data Masking.
Next
Guardrails
Control what reaches the resource, not just what comes back.
Config File Reference
Every field, the full entity list, and what startup refuses.