All posts

Putting access controls around Devin: data masking for AI coding agents (on GCP)

Data masking stops secrets from leaking when an AI assistant like Devin reads a response. An AI coding assistant that can read every line of source code also sees any secret it returns, turning a productivity boost into a data‑leak risk. Today many teams deploy agents such as Devin directly inside a GCP project and give them a static service account that can query internal databases, read configuration files, and call internal APIs. The agent talks straight to the target system, using the same

Free White Paper

GCP VPC Service Controls + AI Model Access Control: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Data masking stops secrets from leaking when an AI assistant like Devin reads a response.

An AI coding assistant that can read every line of source code also sees any secret it returns, turning a productivity boost into a data‑leak risk.

Today many teams deploy agents such as Devin directly inside a GCP project and give them a static service account that can query internal databases, read configuration files, and call internal APIs. The agent talks straight to the target system, using the same credentials that a human engineer would use. Because the connection is direct, there is no place to inspect or transform the payload. If a request asks for a password, an API key, or a personally identifiable value, the response streams back to the agent unchanged and may be emitted in logs, chat windows, or downstream code suggestions.

That lack of protection is more than a nuisance. Exfiltrated secrets let attackers pivot into other services, violate compliance requirements, or expose customers to legal liability. Regulatory frameworks such as SOC 2 ask for evidence that sensitive fields never appear beyond the intended consumer. Even in a purely internal environment, a careless suggestion from an AI assistant can seed a credential in source control, creating a persistent backdoor.

One of the most common mistakes teams make is to assume that because the AI model runs in a sandbox, the data it receives is automatically safe. In practice the sandbox only isolates the compute environment; it does not filter the data flowing over the wire. Engineers often rely on post‑processing or manual review to catch secrets, but that approach is error‑prone and does not scale when the agent is invoked thousands of times a day.

We need a guardrail that sits between the identity that launches the request and the target service, capable of inspecting the response in real time and redacting any fields that match a masking policy. The guardrail must be transparent to the caller – the request still reaches the database or API directly – yet it must be the only point where enforcement can occur. Without such a data‑masking layer, the request still travels unaltered, there is no audit trail of what was returned, and no opportunity to block or approve a risky response.

Why hoop.dev is the only place enforcement can happen

hoop.dev acts as a Layer 7 gateway that sits in the data path for every connection to infrastructure. By design it proxies the traffic, inspects the protocol, and applies policies before the payload reaches the caller. Because the gateway is the sole conduit, any masking, logging, or approval step must happen there; no other component in the stack can guarantee that a secret has been stripped.

When a user or an AI agent such as Devin authenticates, the identity provider (Okta, Azure AD, Google Workspace, etc.) issues an OIDC token. hoop.dev validates that token, extracts the group membership, and decides whether the request is allowed to proceed. The gateway then forwards the request to the target service through a network‑resident agent that holds the service credentials. The agent never sees the user’s token, and the user never sees the service credentials – the gateway mediates the exchange.

Enforcement outcomes delivered by hoop.dev

  • hoop.dev masks sensitive fields in the response according to a configurable policy, ensuring that secrets never reach the AI model.
  • hoop.dev records each session, providing a replayable audit trail that shows exactly what data was returned and when.
  • hoop.dev requires just‑in‑time approval for queries that match a high‑risk pattern, adding a human decision point before the data is released.
  • hoop.dev blocks commands that are known to be dangerous, preventing destructive actions from being executed by an automated agent.

All of these outcomes exist because hoop.dev resides in the data path. If the gateway were removed, the request would travel directly to the database, the response would be unfiltered, and no audit record would be created.

Continue reading? Get the full guide.

GCP VPC Service Controls + AI Model Access Control: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Architectural flow for Devin on GCP

1. Engineers deploy the hoop.dev gateway in the same VPC as the target resources. The quick‑start guide walks through a Docker Compose deployment that includes OIDC configuration.

2. Engineers register the GCP‑hosted database (for example Cloud SQL) as a connection in hoop.dev. The gateway stores the service account key; the AI agent never handles it.

3. Engineers define a masking policy that targets fields such as password, api_key, or any column that matches a regular expression. hoop.dev evaluates the policy on every response packet.

4. When Devin issues a query, the gateway authenticates the request, forwards it, and inspects the response. hoop.dev replaces any matching field with a placeholder before handing the data back to the model.

5. hoop.dev logs the entire interaction and makes it replayable for compliance reviews.

Getting started

To try this in your own environment, follow the getting started guide. The documentation explains how to configure OIDC, register a connection, and create a masking rule without writing a single line of code.

For deeper insight into policy options and the full feature set, explore the feature documentation. Both resources assume you have a basic GCP project and a service account ready for the target resource.

All of the implementation details – Docker composition, agent deployment, and policy syntax – are available in the open‑source repository. View the repository on GitHub to clone the code, contribute improvements, or audit the gateway yourself.

FAQ

Does data masking affect query performance?

hoop.dev performs masking on the response payload after the target service has executed the query. The additional latency is limited to the time needed to inspect and replace matching fields, which is typically negligible compared to network round‑trip time.

Can I apply different masking rules per project or per user?

Yes. Because hoop.dev bases decisions on the authenticated identity, you can scope masking policies to specific groups, roles, or even individual users. This lets you enforce stricter controls for high‑privilege engineers while keeping a lighter touch for developers who only need read‑only access.

What happens if an AI agent tries to bypass the gateway?

Engineers force all traffic to the protected resources through the gateway by using VPC routing rules. If the agent attempts a direct connection, the request fails authentication because the service credentials exist only inside 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