An AI agent that runs a nightly reconciliation job needs to read three databases and an internal billing service. The way most teams ship that on day one is a long-lived service principal secret pasted into an environment variable, copied into a second pipeline, and forgotten. That secret is a non-human identity with no expiry, no session boundary, and no record of which query it ran at 3am. When the agent misbehaves, you cannot tell what it touched.
This guide shows how to give an AI agent access to your infrastructure where the non-human identity is governed by Microsoft Entra and every connection runs through hoop.dev. The important framing up front: Entra is the identity provider. hoop.dev is the relying party that verifies the Entra-issued token and reads group membership to decide what the agent may reach. hoop.dev does not sit in front of Entra and does not manage your Entra tenant. It governs the database, cluster, and service connections that the Entra identity is allowed to open.
What non-human identity means for an agent on Entra
A non-human identity is a service principal, managed identity, or workload identity that authenticates without a person at the keyboard. In Entra that is usually an app registration with a client credential or a workload identity federation trust. The risk is not the identity itself. The risk is that the identity carries standing access to infrastructure and authenticates with a secret that never rotates.
The architectural requirement is this: the agent should present an Entra identity to a gateway, and the gateway should be the thing that holds the connection to the database. The agent never holds the database password. The boundary that decides what the agent can run has to live outside the agent process, because an agent that holds its own credential can be prompted into using it in ways nobody approved.
How the connection is structured
hoop.dev runs a gateway and an agent that sits inside your network next to the resource. The network agent opens an outbound connection to the gateway, so nothing is exposed inbound. The credential for the target database lives on the connection inside hoop.dev, not in the AI agent. The AI agent authenticates as its Entra identity, hoop.dev verifies that token, maps the Entra group to a policy, and only then proxies the query to Postgres or the internal service.
