An AI coding assistant that writes queries against a production MySQL instance can accidentally return full patient names, social security numbers, or credit‑card details, exposing the need for pii/phi redaction when it tries to illustrate a result set. The assistant’s output is then consumed by developers, logged by CI pipelines, or even displayed in a chat window, creating a direct path for protected data to leave the controlled environment.
Regulators treat any exposure of personally identifiable information (PII) or protected health information (PHI) as a violation, and the reputational cost of a leak can dwarf the engineering effort required to prevent it. When an LLM‑driven tool is given unrestricted read access, the model may echo back any column it sees, regardless of the original intent of the request.
Most teams today hand the AI service a static MySQL username and password, store those secrets in a vault, and let the model connect directly. The connection bypasses any middle‑box, so there is no visibility into which tables are queried, no way to scrub sensitive columns, and no audit trail that shows who asked for what data. The result is a convenient shortcut that sacrifices governance.
Why a non‑human identity alone is not enough
Moving to a service account with read‑only privileges is a step forward. The account can be scoped to a single database or schema, and role‑based access control can limit which tables are reachable. However, the request still travels straight from the AI process to MySQL. The gateway that could enforce column‑level policies is missing, so the agent can still retrieve raw PII/PHI and return it unfiltered. In addition, there is no built‑in mechanism to require a human reviewer before a query that touches sensitive tables is executed.
Introducing hoop.dev as the enforcement point
hoop.dev provides a Layer 7 gateway that sits between the AI agent and the MySQL server. The gateway proxies the native MySQL wire protocol, inspects each statement, and applies configurable policies before the request reaches the database. Because the gateway is the only place the traffic passes, it becomes the sole location where masking, approval, and logging can be enforced.
How the data path works for MySQL
When an AI service wants to run a query, it authenticates to hoop.dev using an OIDC token issued by the organization’s identity provider. The token conveys the service’s identity and group membership. hoop.dev validates the token, maps the identity to a set of MySQL connection credentials that it holds internally, and then opens a proxied session to the target database.
