Are you worried that an automation agent could act on behalf of a privileged user while your security policies remain invisible? You might think writing policy as code will solve the problem, but without a place to enforce those rules the code lives only on paper. In many teams the same service account or SSH key is baked into scripts and shared across dozens of pipelines. The agent authenticates directly to the database, Kubernetes cluster, or remote host, and because the credential never changes, any compromised process can impersonate any user who ever ran that job. Auditors see a flood of successful connections but cannot tell which human approved them or whether a risky command was blocked. The result is a blind spot: you know an agent is talking to the target, but you have no runtime guardrails, no per‑command audit, and no way to enforce masking of sensitive fields.
Why policy as code needs a runtime enforcement point
Policy as code lets you express who may do what, when, and under which conditions. The definition itself is valuable, but it does not automatically stop a rogue agent from issuing a destructive command. The missing piece is a data‑path component that can read the policy, compare each request against it, and act before the request reaches the target. Without that component, the policy remains a static document that auditors can cite but attackers can ignore.
Setup: identity and least‑privilege grants
Identity providers such as Okta, Azure AD, or Google Workspace issue short‑lived OIDC tokens. Those tokens identify the caller, convey group membership, and can be scoped to a single role. Assigning a token the minimum set of permissions is essential, but tokens alone cannot block a command that falls outside the intended workflow. The setup stage decides who is allowed to start a session, but it does not enforce the fine‑grained rules that policy as code describes.
The data path must be the enforcement boundary
Only a gateway that sits between the caller and the infrastructure can reliably enforce policy as code. The gateway inspects the wire‑level protocol, applies guardrails, and decides whether to allow, mask, or require approval for each operation. Placing enforcement elsewhere, inside the agent, in the target service, or in a downstream log, leaves the request unchecked and opens a path for impersonation.
hoop.dev as the policy‑enforcement gateway
hoop.dev fulfills the data‑path requirement. It proxies connections to databases, Kubernetes clusters, SSH hosts, and HTTP services, and it evaluates every request against the defined policy as code. hoop.dev records each session for replay, so auditors can trace exactly which identity issued which command. It masks sensitive fields in responses, preventing accidental leakage of secrets. When a request matches a rule that requires human approval, hoop.dev pauses the operation and routes it to an approver before it reaches the target. Because the gateway holds the credential, the agent never sees the secret, eliminating credential spill from compromised agents.
