An AI agent decides, at 2am, that the cleanest way to resolve a stuck job is to delete a batch of rows in production. It is confident. It is also wrong. If nothing sits between that decision and the database, the rows are gone before anyone wakes up. The control you want is not a better-behaved agent. It is a human checkpoint on the operations that can hurt.
Approval workflows put that checkpoint in the path. This guide adds approval workflows for AI agents whose identity is issued by Microsoft Entra, enforced on the infrastructure connection by hoop.dev. The roles, up front: Entra is the identity provider that authenticates the agent and asserts its group. hoop.dev is the relying party that verifies the Entra token and routes risky operations to a reviewer before they reach the target. The approval sits on the database or service connection. hoop.dev does not insert approvals into Entra and does not front Entra itself.
Which operations need an approval
Not everything should stop for a human. A read of order status can run freely. A delete, a schema change, or a write to a financial table is where an approval earns its cost. The design goal is to let routine work flow and to gate only the operations whose blast radius justifies a pause. The decision about which is which lives in policy at the gateway, not in the agent, because an agent that can decide it does not need approval has no approval at all.
Setting up approval workflows step by step
Take an agent that maintains a production database and occasionally needs to run a destructive cleanup.
- In Entra, put the agent identity in a group such as
db-maintenance-agents. - Configure hoop.dev to verify Entra tokens against your tenant.
- Create the hoop.dev connection to the database with its credential on the connection.
- Bind a policy to the Entra group: reads run directly, writes and deletes route for approval, and every session is recorded.
policy: db-maintenance-agents
connection: prod-maintenance
rules:
- match: SELECT
action: allow
- match: DELETE|DROP|UPDATE
action: require-approval
record: trueWhen the agent issues a delete, hoop.dev holds the operation, notifies the reviewer with the identity and the exact statement, and only runs it on approval. The agent waits at the boundary.
