How to Configure JetBrains AI MariaDB Data Masking

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up jetbrains ai mariadb data masking, you create masked database views or apply server masking rules. These rules rewrite sensitive fields before query results reach your editor. Many teams start by linking their editor to a shared database role. When that role has broad read permissions, the assistant can pull raw records into prompt context. A single query can send live emails, phone numbers, or card numbers to external models. How jetbrains ai mariadb data masking works in practice

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To set up jetbrains ai mariadb data masking, you create masked database views or apply server masking rules. These rules rewrite sensitive fields before query results reach your editor. Many teams start by linking their editor to a shared database role. When that role has broad read permissions, the assistant can pull raw records into prompt context. A single query can send live emails, phone numbers, or card numbers to external models.

How jetbrains ai mariadb data masking works in practice

Your code editor connects to the MariaDB server through its built-in database tool. When you ask the AI assistant for help, it reads your table structure. Developers also run SQL queries and paste result sets into the chat window. If the database returns raw text, the assistant sends that text to the model provider.

Native MariaDB features offer a few ways to alter those results first. Admins can build custom SQL views that format specific columns with string functions. You then grant the editor role read rights on the view instead of the base table. MariaDB also supports server components and plugins that rewrite sensitive columns during a query. When a developer runs a select statement, the server replaces characters in emails or national IDs. The editor receives the altered text, and the assistant uses safe values in its prompts.

How to set up database roles for editor sessions

Start by making a dedicated MariaDB user account just for your code editors. Do not let developers use the main app account in their local tools. Identify every table that holds emails, phone numbers, card numbers, or national IDs. Build a set of read-only views or masking rules for those specific tables. Revoke direct select rights on the base tables from the editor user account. Grant that user account permission to read only the masked views.

Next, have each developer update the database settings inside their editor. They should log in with the restricted user account and test a sample query. Check the output pane to confirm that masking rewrites matched fields in results. Once verified, the AI assistant can inspect schemas and sample rows with much lower risk.

AI Data Exfiltration Prevention + Data Masking (Static): architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native database rules solve and what they miss

Static views and server rules work well when schemas rarely change. They stop accidental leaks from known columns during normal query work. Still, database roles only decide who can log in and which objects they can read. They do not inspect what individual SQL statements or ad-hoc queries do in flight.

Fast-moving teams add new tables and columns every week. If a developer adds a new phone number column, the view config lags behind. Maintaining hundreds of custom views across staging and production servers takes constant manual effort. Also, developers often need temporary access to raw tables to fix urgent bugs. When they switch to a privileged role inside the editor, native view restrictions disappear. The AI assistant then regains full access to raw query results during that session.

Check MySQL queries and results on the wire

MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL. It runs next to MySQL, RDS, or Aurora and reads the MySQL wire protocol.

Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails. When a rule refuses a query, MySQL returns a native error packet with your message. On the response path, hoop.dev data masking rewrites string values in returned rows that match your rules. Every query and decision is logged per resource. See the MIT-licensed project on GitHub.

Frequently asked questions

Does JetBrains AI send raw MariaDB query results to model providers?

The assistant reads schema details and any query results you attach to the chat context. If your database session returns raw fields, those values can enter the prompt.

Which MariaDB fields should teams mask for AI coding assistants?

Teams should focus on high-risk fields like emails, phone numbers, card numbers, and national IDs. Rewriting these values in query results keeps sensitive customer details out of AI prompts.

Why are static MariaDB views hard to maintain for AI workflows?

Every schema change requires an admin to update the matching view definitions by hand. If someone forgets to update a view, new columns return unmasked data to the editor.

The query runs. The emails stay hidden.