One agent reading your customer table is traceable. A chain where an orchestrator delegates to a sub-agent that delegates to a tool-runner that issues the actual read makes data exfiltration harder to see, because the read happens several layers from anything you monitor, and the chain's own account of it can be incomplete. Nested agents do not invent a new way to steal data. They add distance and self-reporting between the read and your visibility.
Keep it operational. The risk is that sensitive data leaves through a deep layer, and the trail you get is whatever the chain reports rather than what actually happened.
Why nesting complicates exfiltration defense
- The read is deep. The layer issuing the query is far from the orchestrator, so monitoring the top tells you little about the actual data access.
- Self-reported volume. If you rely on the chain to log what it read, a distorted or partial report hides the size of the read.
- Inherited reach. A broad grant at the top means a deep layer can read more than its task needed.
The requirement: mask and record on the connection
Defenses against data exfiltration have to act on the access path between the chain and the data, not inside the chain that could be doing the exfiltrating. Masking applied in the result stream and a command-level record captured on the connection do not depend on any layer reporting honestly.
How a gateway closes the path
hoop.dev is an open-source access gateway between identities and infrastructure. Every connection a nested agent makes goes through it. Sensitive fields can be masked in the result stream before they reach the client through a configured data classification provider, and every command is recorded against a named principal, no matter how deep the layer that issued it. So a sub-agent's bulk read returns redacted values, and the read itself is logged with the exact statement and identity. Distance and self-reporting stop helping the attacker, because the gateway sees the real query on the wire. See how masking is configured per connection in the getting-started guide.
A concrete contrast
Without a gateway: a deep sub-agent reads raw PII at volume, and your only record is whatever the chain reported, which may understate it. With the connection governed: the same read returns masked fields, and the command-level record shows the principal, the statement, and the volume. The identity-aware model is described on the hoop.dev site.
