Tool‑using agents that rely only on rbac open the door to privilege abuse.
In many organizations, engineers deploy agents that automate database migrations, CI/CD pipelines, or log collection. The usual shortcut is to give those agents a static credential, often a long‑lived username and password or an API key, then assign a broad role that lets the agent reach every server it might need. The result is a single point of failure: if the credential leaks, an attacker inherits the same reach, and the organization has no visibility into which commands the agent actually executed.
That baseline state looks clean on paper because the role‑based access control (rbac) matrix appears to limit what each agent can do. In practice, rbac alone does not stop the agent from issuing destructive commands, does not hide sensitive data that flows back from the target, and does not provide a replayable record of what happened. The request still travels directly from the agent to the database, SSH server, or Kubernetes API, bypassing any guardrails that could catch a rogue query or an accidental data dump.
RBAC is a useful way to group permissions, but it is a static policy applied at the identity layer. When an agent presents a token, the identity system says, "this token belongs to role X, so allow it to connect." The enforcement point is the target system itself, which trusts the credential and runs the command without additional checks. This model leaves three critical gaps:
- No command‑level audit. The target logs who connected, but it does not capture every statement the agent sent, making forensic analysis difficult.
- No inline data masking. Sensitive fields, credit‑card numbers, personal identifiers, or secret keys, are returned to the agent in clear text, increasing exposure risk.
- No just‑in‑time approval. High‑risk operations such as dropping tables or changing IAM policies execute immediately, without a human pause for review.
These gaps persist even after you tighten rbac roles, because the enforcement still occurs downstream of the agent.
Placing enforcement in the data path
The missing piece is a gateway that sits on the data path between the identity layer and the infrastructure target. Such a gateway can inspect traffic at the protocol level, apply dynamic policies, and record everything for later review. It must also hold the credentials itself so that the agent never sees them, thereby reducing the blast radius of a credential leak.
hoop.dev fulfills that role. It acts as a layer‑7 proxy that verifies OIDC or SAML tokens, maps the token’s groups to fine‑grained policies, and then mediates every request before it reaches the backend resource. Because hoop.dev is the only point that can see both the incoming command and the outgoing response, it can enforce the following outcomes:
- Record each session for replay and audit.
- Mask sensitive fields in real time, ensuring that downstream consumers never see raw secrets.
- Require just‑in‑time approval for high‑risk commands, pausing execution until a designated reviewer grants consent.
- Block dangerous statements outright, preventing accidental data loss.
- Ensure the agent never receives the underlying credential, because hoop.dev injects its own service identity when connecting to the target.
All of these capabilities rely on the gateway sitting in the data path; the initial identity check (the setup) merely decides who may start a session. Without hoop.dev, the session would proceed unchecked.
How the architecture fits together
The workflow looks like this:
- Users authenticate against an identity provider (Okta, Azure AD, Google Workspace, etc.). The provider issues an OIDC token that includes group membership.
- hoop.dev receives the token, validates it, and maps the groups to role definitions that describe which resources the user may access and under what conditions.
- The user launches a standard client, psql, kubectl, ssh, or an API call, pointing at the hoop.dev endpoint instead of the raw target.
- The gateway forwards the request to the appropriate agent, which holds the target credentials. The agent never sees the user’s token or the static secret.
- Before the target processes the command, hoop.dev applies masking, approval, or blocking rules based on the policy attached to the request.
- After execution, hoop.dev records the full transcript, masks any sensitive data in the response, and stores the audit record for later replay.
This pattern turns a static rbac assignment into a dynamic, observable control surface. Teams can still define roles in their identity system, but the enforcement of those roles happens where it matters, right before the command reaches the infrastructure.
Getting started
To adopt this approach, begin with the getting started guide, which walks you through deploying the gateway, registering a connection, and configuring OIDC authentication. The learn section provides deeper coverage of masking policies, approval workflows, and session replay.
FAQ
Can I keep using my existing rbac roles?
Yes. hoop.dev reads the groups embedded in the OIDC token, so your current role definitions remain the source of truth. The gateway simply enforces those roles at the point of connection.
hoop.dev records at the protocol layer and streams the audit data to a backend store asynchronously. In practice the overhead is minimal compared to the latency of the underlying database or SSH connection.
What if an agent is compromised?
Because the agent never receives the raw credential, a compromised agent can only act within the permissions granted by hoop.dev for that session. Any attempt to exceed those permissions is blocked by the gateway, and the session is captured for forensic analysis.
Explore the source code on GitHub to see how the gateway is built and how you can extend its policy engine.