All posts

LGPD for Inference

A former contractor still has a personal access token that points at the company’s inference endpoint. The team never revoked the token, and the contractor can submit queries that include citizens’ names, addresses, and health details. When a data‑privacy audit arrives, the team cannot prove who ran which query, whether any personal data was exposed, or if the request was authorized. This scenario illustrates a common gap: modern AI inference services often run behind static credentials and rece

Free White Paper

LGPD (Brazil): The Complete Guide

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

Free. No spam. Unsubscribe anytime.

A former contractor still has a personal access token that points at the company’s inference endpoint. The team never revoked the token, and the contractor can submit queries that include citizens’ names, addresses, and health details. When a data‑privacy audit arrives, the team cannot prove who ran which query, whether any personal data was exposed, or if the request was authorized. This scenario illustrates a common gap: modern AI inference services often run behind static credentials and receive traffic directly, leaving no verifiable trail.

Brazil’s General Data Protection Law (lgpd) requires organizations to demonstrate accountability for any processing of personal data. For inference workloads, accountability means knowing exactly which identity accessed the model, what input data was provided, whether the request was approved, and what output was returned. The law also mandates minimisation of personal data exposure, the ability to mask or redact sensitive fields, and the retention of immutable logs that auditors can review.

What lgpd expects from AI inference services

lgpd defines several technical and organisational controls that apply to inference pipelines:

  • Purpose limitation and consent. Each request must be tied to a legitimate purpose and, where required, to explicit consent from the data subject.
  • Access accountability. The system must record the identity of the requester, the time of the request, and the specific model version used.
  • Data minimisation. Personal identifiers should be stripped or masked before they are stored or returned.
  • Auditability. hoop.dev stores logs in a tamper‑evident, searchable store and retains them for the period defined by the organisation’s data‑retention policy.
  • Incident response. When a breach is suspected, the organization must be able to replay the exact session that caused the exposure.

Meeting these expectations becomes straightforward when a control plane fronts the inference service and enforces policies before the request reaches the model.

Why the data path matters

Most teams already have a solid setup: they provision OIDC or SAML identities, assign least‑privilege roles to service accounts, and configure the inference engine with a static API key. This setup decides who may start a request, but it does not enforce any of the lgpd controls listed above. The request still travels straight to the model, bypassing any opportunity to log, mask, or require approval. In other words, the enforcement outcomes that lgpd demands exist only if a gateway sits in the data path.

How hoop.dev delivers the required evidence

hoop.dev is an identity‑aware proxy that sits between the requester and the inference endpoint. By placing the gateway in the data path, hoop.dev can apply every lgpd control without changing the client code.

Setup. Teams configure OIDC or SAML authentication in hoop.dev, map groups to inference permissions, and grant the gateway a minimal service‑account credential that can invoke the model. The gateway never stores user secrets; it only validates the presented token.

Continue reading? Get the full guide.

LGPD (Brazil): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

The data path. Every inference request passes through hoop.dev. The gateway inspects the payload, applies inline masking rules to redact personal identifiers, and checks whether the request matches an approved policy. If the request exceeds a risk threshold, hoop.dev routes it to a human approver before forwarding it to the model.

Enforcement outcomes. hoop.dev records each session and stores the logs so they can be retained and searched, providing the audit trail that lgpd auditors expect. Because the gateway controls the flow, it can replay any session for incident investigation, demonstrating exactly what data was processed and by whom.

In practice, this means an organization can answer lgpd audit questions such as:

  • Who queried the model on a given day?
  • What personal fields were present in the input and how were they masked?
  • Was a particular high‑risk request approved by a data‑privacy officer?

All of these answers generate automatically in hoop.dev, eliminating manual log‑aggregation and reducing the risk of human error.

Getting started

To try the solution, follow the getting‑started guide and review the feature documentation for inference‑specific policies. The project is open source under an MIT license, so you can self‑host the gateway inside your network and customise masking rules to match your lgpd data‑handling policies.

Explore the source code on GitHub to see how the proxy integrates with popular inference frameworks and to contribute improvements.

FAQ

Does hoop.dev make my inference service lgpd compliant?

No. hoop.dev does not claim compliance, but it generates the evidence that lgpd auditors require, such as request logs, masking actions, and approval records.

What kinds of logs are produced?

hoop.dev logs the requester’s identity, timestamp, model version, input payload (with masked fields), approval decisions, and the final response. hoop.dev stores logs in a storage location configured by the deployment, allowing retention according to your policy.

Can I mask arbitrary fields in the inference response?

Yes. hoop.dev lets you define masking rules that target any JSON path or regular‑expression pattern, ensuring personal identifiers are redacted before they leave the gateway.

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