Picture the end-state first. Every AI agent that touches your MySQL database is a named principal with its own access policy, its own recorded sessions, and its own scope. No agent shares a login with another agent or with a human. When something runs a query, you know exactly which agent it was, because the identity is attached at the connection, not guessed from an IP. That is what non-human identity for AI agents on MySQL looks like when it is done right.
Most deployments start far from that. The agent reads a MySQL username and password from an environment variable, the same pair a human service uses, and that shared credential becomes the agent's whole identity. Non-human identity is the work of replacing that shared secret with a distinct, governed principal for each agent.
The end-state in concrete terms
- Each agent authenticates as itself, separate from humans and from other agents.
- Access is scoped to what the agent's task needs, not the full grant of a shared user.
- Every session is attributed to that identity, so audit and recording are meaningful.
- The agent never holds the raw MySQL credential, so rotating or revoking it does not require touching agent code.
Why a shared MySQL user fails as identity
A MySQL user is a database object, not an identity system. When several agents share one, the database cannot tell them apart, access is the union of everything any of them needs, and revoking one agent means rotating a secret that breaks the others. The identity has to live above the database user, on the connection, where it can map many distinct principals onto the access MySQL understands.
How to reach the end-state
hoop.dev is an open-source Layer 7 gateway that proxies the MySQL wire protocol. It authenticates each connecting identity through your OIDC or SAML provider and authorizes the session before it opens MySQL. The agent presents its own identity to hoop.dev; hoop.dev reaches MySQL with the connection-configured credential as the session principal. The agent's identity stays distinct end to end, while the database still sees a credential it understands.
