All posts

LGPD for Multi-Agent Systems

A fintech startup rolls out a fleet of autonomous agents that scrape customer transaction data from a PostgreSQL store, all while trying to meet LGPD requirements. Each agent is packaged with the same service‑account key, embedded in the container image, and the CI pipeline pushes new binaries without any review of the queries they run. When a regulator asks for a record of who accessed personal data, the team can only point to a vague log entry that says “agent‑123 executed a query”. Even afte

Free White Paper

Multi-Agent System Security + LGPD (Brazil): The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

A fintech startup rolls out a fleet of autonomous agents that scrape customer transaction data from a PostgreSQL store, all while trying to meet LGPD requirements. Each agent is packaged with the same service‑account key, embedded in the container image, and the CI pipeline pushes new binaries without any review of the queries they run. When a regulator asks for a record of who accessed personal data, the team can only point to a vague log entry that says “agent‑123 executed a query”.

Even after the company moves to per‑agent OIDC tokens and restricts each token to read‑only access on specific tables, the agents still connect directly to the database. The request travels over the network straight to PostgreSQL, and nothing intercepts the response. Sensitive fields such as CPF numbers or credit‑card fragments flow back to the agent unfiltered, and there is no immutable proof of which query returned which rows.

LGPD (Lei Geral de Proteção de Dados) expects data controllers to enforce data minimization, provide audit trails, and protect personal data at rest and in transit. The law requires that any processing of personal information be logged with the identity of the processor, the purpose of the access, and the exact data elements that were disclosed. It also mandates that organizations be able to mask or redact personal data when it is not needed for the business purpose, and that evidence of compliance be readily available for auditors.

How LGPD requirements map to multi‑agent systems

To satisfy LGPD, a multi‑agent architecture must address three core controls:

  • Identity‑driven access: each agent must present a verifiable identity, and the system must enforce the principle of least privilege for that identity.
  • Runtime governance: every request and response must be inspected, logged, and, when necessary, altered to hide personal data that is outside the approved scope.
  • Evidence collection: the platform must retain immutable records that auditors can query to prove who accessed what, when, and under which policy.

Without a dedicated gateway, the first bullet is only partially met – agents can be given distinct tokens, but the gateway that would enforce per‑request policies is missing. The second and third bullets rely on a component that can sit between the agent and the target service, inspect the wire‑protocol, and apply masking or approval workflows in real time.

Why hoop.dev is needed in the data path

hoop.dev is a Layer 7 gateway that sits exactly where the enforcement must happen – between the agent’s identity and the infrastructure resource. Because hoop.dev proxies the connection, it can:

  • Record every session, including the full request and response payloads, and associate them with the agent’s OIDC identity. This creates the audit trail LGPD demands.
  • Apply inline data masking on fields that are classified as personal data, ensuring that downstream services only see the minimal subset required for the operation.
  • Require just‑in‑time approval for high‑risk queries, such as bulk extracts or operations that touch sensitive columns, and block commands that violate policy before they reach the database.
  • Enforce least‑privilege scopes per agent, because the gateway validates each request against the token’s claims and can deny access that exceeds the granted role.

All of these outcomes exist only because hoop.dev occupies the data path. The identity system alone cannot guarantee that a token‑holder does not accidentally run a query that leaks personal data, and the database itself does not provide per‑request masking or approval. By placing hoop.dev in front of PostgreSQL, MongoDB, or any other supported target, the organization gains a single, auditable control point that satisfies the core LGPD controls.

Continue reading? Get the full guide.

Multi-Agent System Security + LGPD (Brazil): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Generating LGPD evidence with hoop.dev

When an auditor asks for proof of compliance, hoop.dev can export logs that contain:

  • The agent’s identity (subject claim from the OIDC token).
  • The timestamp of the request and the exact SQL statement executed.
  • The masked response payload, showing that personal fields were removed according to policy.
  • Any approval workflow metadata, such as who granted the exception and when.

These logs are retained for the period required by LGPD, providing the immutable evidence auditors expect.

Getting started

To retrofit an existing multi‑agent system with hoop.dev, follow the high‑level steps described in the getting‑started guide. Deploy the gateway, register each target service, and configure per‑agent OIDC clients. The learn section provides detailed examples of masking policies and approval workflows that align with LGPD’s data‑minimization rules.

FAQ

Does hoop.dev replace my existing identity provider?

No. hoop.dev consumes tokens from your IdP (Okta, Azure AD, Google Workspace, etc.) and uses the claims to make authorization decisions. It does not act as an IdP.

Can hoop.dev mask data in real time without changing my application code?

Yes. Because hoop.dev operates at the protocol layer, it can rewrite responses on the fly. Your agents continue to use their standard client libraries (psql, mongo, etc.) unchanged.

What retention period should I configure for LGPD evidence?

LGPD requires that processing logs be kept for the duration needed to demonstrate compliance, typically at least five years. hoop.dev’s logging can be configured to meet that requirement.

By placing an identity‑aware gateway in the data path, organizations can meet LGPD’s stringent audit, masking, and justification requirements without rewriting their multi‑agent codebase. hoop.dev provides the single enforcement point that turns scattered agent activity into a compliant, observable, and controllable process.

Explore the open‑source repository on GitHub to get started.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts