All posts

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

Devin, the in‑house AI coding assistant, was given a long‑lived service‑account key without any guardrails, so it could push code, spin up clusters, and query production databases on demand. The key granted full access to every project in the GCP organization. When Devin generated a migration script that inadvertently dropped a table, the operation executed without any human review, and the data loss was only discovered days later. Because the agent connected directly to Cloud SQL, GKE, and Clou

Free White Paper

GCP VPC Service Controls + AI Guardrails: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Devin, the in‑house AI coding assistant, was given a long‑lived service‑account key without any guardrails, so it could push code, spin up clusters, and query production databases on demand. The key granted full access to every project in the GCP organization. When Devin generated a migration script that inadvertently dropped a table, the operation executed without any human review, and the data loss was only discovered days later. Because the agent connected directly to Cloud SQL, GKE, and Cloud Storage, there was no record of which commands were run, no way to redact sensitive fields in query results, and no mechanism to pause a destructive action for approval.

Why guardrails matter for AI coding agents

AI agents can produce high‑velocity changes that are hard for a human to anticipate. Guardrails provide runtime governance: they enforce command‑level policies, mask confidential data in responses, and require just‑in‑time (JIT) approval for risky operations. Without guardrails, a single generated command can cascade across services, expand the blast radius, and leave no audit trail for incident response. Organizations that treat AI agents as ordinary users miss the opportunity to embed intent‑based controls at the point where the request reaches the target system.

The missing piece: a data‑path enforcement layer

Identity and token provisioning, creating a service account, assigning it to Devin, and limiting its IAM scopes, decides who the request is and whether it may start. This setup is necessary but not sufficient. Once the token is issued, the request travels straight to the GCP endpoint, bypassing any point where policies can be examined or altered. The connection arrives at Cloud SQL or GKE with full privileges, leaving no place to inject guardrails, no place to record the session, and no place to mask sensitive fields.

Introducing hoop.dev as the enforcement gateway

hoop.dev sits in the Layer 7 data path between Devin and every GCP service it needs to reach. By proxying the protocol‑level traffic, hoop.dev becomes the sole location where guardrails can be applied. hoop.dev records each session, masks sensitive fields in query results, blocks dangerous commands before they reach the target, and routes high‑risk operations to a human approver. Because hoop.dev holds the credential for the downstream service, the AI agent never sees the secret, and every action is captured for replay and audit.

How the flow works for Devin

  • Devin authenticates to an OIDC provider that issues a short‑lived token.
  • hoop.dev validates the token, extracts group membership, and maps it to a policy profile.
  • The request is forwarded through hoop.dev to the target GCP resource (for example, a Cloud SQL instance).
  • Before the command reaches the database, hoop.dev evaluates it against guardrails: it may redact columns that contain secrets, reject statements that match a destructive pattern, or pause the request for manual approval.
  • The entire interaction is logged, and a replayable session file is stored for compliance and forensic analysis.

Benefits of the hoop.dev guardrail layer

  • Command‑level audit: Every SQL statement, kubectl command, or API call is captured with the identity that issued it.
  • Inline data masking: Sensitive fields such as passwords or API keys are stripped from responses before they reach Devin.
  • Just‑in‑time approval: Destructive actions, dropping tables, deleting clusters, or revoking IAM bindings, are halted until an authorized reviewer approves them.
  • Session recording and replay: Full‑fidelity recordings enable post‑incident review and training of future AI models.
  • Reduced blast radius: By enforcing least‑privilege at the gateway, even a compromised AI agent can only act within the bounds defined by guardrails.

Getting started with hoop.dev

To protect AI agents like Devin, deploy hoop.dev as the gateway that fronts your GCP resources. The quick‑start guide walks you through a Docker Compose deployment, OIDC configuration, and adding a connection for Cloud SQL or GKE. Detailed feature documentation explains how to define masking rules, approval workflows, and audit retention. Follow the getting‑started guide for step‑by‑step instructions, and explore the learn section for deeper coverage of guardrails and session replay.

Continue reading? Get the full guide.

GCP VPC Service Controls + AI Guardrails: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

When you’re ready to review the source code, contribute, or customize the gateway, visit the public repository on GitHub:

https://github.com/hoophq/hoop

FAQ

Do guardrails affect the performance of the underlying GCP service?

hoop.dev processes traffic at the protocol layer and applies policies before the request reaches the target. The additional latency is minimal and can be tuned by adjusting policy complexity. The benefit of enforced security and audit outweighs the small overhead.

Can I use hoop.dev with existing service‑account keys?

Yes. hoop.dev can store the existing credentials and present them to the target service on behalf of the AI agent. The agent never accesses the raw key, satisfying the principle of secret‑less operation while still allowing you to migrate gradually.

What happens if an approval request is ignored?

If a JIT approval is not granted within the configured timeout, hoop.dev automatically rejects the pending command and records the denial, ensuring that no unauthorized destructive action proceeds.

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