Are you struggling to keep policy as code effective when your platform uses nested agents? When an automation script launches a secondary agent, which then talks to a database or a Kubernetes cluster, the original policy boundaries often disappear. Teams frequently hand a static credential to the first agent, let the second agent reuse it, and assume the same policy checks still apply. The result is a hidden chain of privileged calls that no one can audit, no one can approve, and no one can mask.
In this thin explainer we focus on what to watch for, not on step‑by‑step configuration. The goal is to surface the hidden risks and show where a proper enforcement point belongs.
Why nested agents break policy as code expectations
Most organizations start with a single service account that a top‑level automation uses to perform a task. That service account often has broad read/write rights because it must cover many downstream actions. When the automation spawns a child process, another agent, a container, or an LLM‑driven worker, it inherits the same token. The child then connects directly to the target system, bypassing any additional checks. Because the connection originates from the network rather than from a human, the original policy as code rules are never re‑evaluated. The chain looks like this:
- Engineer authenticates to a CI pipeline.
- Pipeline launches Agent A with a static credential.
- Agent A launches Agent B, which talks directly to a database.
- No audit log records the second hop, and no masking is applied to sensitive fields.
This unsanitized state leaves three dangerous gaps: uncontrolled privilege inheritance, invisible data flow, and missing evidence for compliance.
What policy as code must guarantee for nested agents
The intention of policy as code is to codify who may do what, when, and on which resource. For nested agents this means two things. First, the policy engine must be consulted on every hop, not just the initial request. Second, the system must retain a verifiable record of each hop so that auditors can trace the full path.
Even with those requirements, the request still reaches the target directly after the first hop. Without a dedicated enforcement layer, the downstream call bypasses the policy engine entirely, leaving the original intent unfulfilled. The precondition we need, therefore, is a data‑path component that can intercept every connection, regardless of which agent originated it.
hoop.dev as the data‑path enforcement point
Enter hoop.dev. It is a Layer 7 gateway that sits between any identity, human, service account, or nested agent, and the infrastructure resource. Because the gateway proxies the wire‑protocol, every request, even those launched by a child agent, must pass through it.
