All posts

Protecting Self-Hosted Models from Shadow AI

When shadow AI is fully contained, every prompt sent to a self‑hosted model is logged, approved, and any sensitive output is filtered before it reaches downstream systems. In that ideal state, engineers can trust that no hidden process is siphoning proprietary data or generating unapproved responses. Today many teams expose their models through static API keys or long‑lived service accounts that sit in code repositories, CI pipelines, or container images. Those credentials are shared across doz

Free White Paper

AI Model Access Control + Self-Service Access Portals: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

When shadow AI is fully contained, every prompt sent to a self‑hosted model is logged, approved, and any sensitive output is filtered before it reaches downstream systems. In that ideal state, engineers can trust that no hidden process is siphoning proprietary data or generating unapproved responses.

Today many teams expose their models through static API keys or long‑lived service accounts that sit in code repositories, CI pipelines, or container images. Those credentials are shared across dozens of services, and any developer with access can invoke the model at will. Because the request travels directly to the model endpoint, there is no central log of who asked what, no way to enforce that only approved prompts are executed, and no guarantee that the model’s response does not contain confidential information. The result is a fertile ground for shadow AI – an unsanctioned instance that silently consumes the model, learns from it, and potentially leaks data.

Why shadow ai threatens self‑hosted models

The core issue is the lack of a control point between the identity that initiates a request and the model that fulfills it. Without a gateway, the following gaps remain:

  • Standing access: a token that never expires gives perpetual rights.
  • No audit trail: the model sees a request but the organization cannot later prove who made it.
  • No inline protection: sensitive fields in the model’s response are sent unfiltered to the caller.
  • No approval workflow: risky prompts can be issued without human oversight.

Even if you introduce non‑human identities, role‑based tokens, or federated login, the request still reaches the model directly, leaving the above gaps untouched. The setup alone decides who may start a session, but it does not enforce policy on the data path.

Introducing an identity‑aware gateway

To close the gap, the enforcement point must sit on the network path that carries the request. hoop.dev is built exactly for that purpose. It acts as a Layer 7 proxy that terminates the client connection, validates the caller’s OIDC or SAML token, and then forwards the request to the self‑hosted model only after applying policy.

Setup begins with provisioning an OIDC client in your identity provider, creating service accounts for automated agents, and assigning least‑privilege groups that reflect the intended use of the model. Those steps decide who may attempt a connection, but they do not yet guarantee safe execution.

Data‑path enforcement by hoop.dev

Once the request reaches the gateway, hoop.dev becomes the sole place where enforcement can happen. It records each session, stores a replay‑able log, and can replay the interaction for forensic review. Before a prompt is forwarded, hoop.dev can require a just‑in‑time approval from a designated reviewer, ensuring that only vetted queries are processed. If the request contains a command that matches a risky pattern, hoop.dev blocks it outright.

Continue reading? Get the full guide.

AI Model Access Control + Self-Service Access Portals: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

When the model returns a response, hoop.dev can apply inline masking to redact sensitive fields such as API keys, personal identifiers, or proprietary code snippets. The masked response is then delivered to the caller, while the original unmasked payload is retained only in the secure audit log.

All of these outcomes, session recording, just‑in‑time approval, command blocking, and inline masking, exist because hoop.dev sits in the data path. Without that gateway, the model would answer directly and none of the controls could be enforced.

Benefits for organizations running self‑hosted models

  • Visibility: every prompt and response is tied to a verified identity, providing a complete audit trail for compliance and incident response.
  • Risk reduction: risky or exploratory queries are intercepted before they reach the model, limiting exposure to unintended behavior.
  • Data protection: sensitive output is automatically filtered, preventing accidental leakage to downstream services.
  • Just‑in‑time access: engineers receive temporary, scoped permissions that expire with the session, eliminating standing credentials.

Because hoop.dev is open source, you can run the gateway inside your own network, keep all logs under your control, and extend the policy engine to match your organization’s risk appetite.

Getting started

Review the getting‑started guide to deploy the gateway and configure OIDC authentication. The learn section provides deeper detail on masking policies, approval workflows, and session replay.

Explore the source code and contribute to the project on GitHub.

FAQ

Does hoop.dev replace the model’s own authentication?

No. The model still authenticates to the gateway using the credential stored in hoop.dev’s configuration. The gateway merely adds a policy layer on top of that existing authentication.

Can I use hoop.dev with any self‑hosted model?

hoop.dev proxies generic TCP/HTTP‑based endpoints, so any model that exposes a standard API can be fronted. Specific connector details are documented in the product docs.

How long are session logs retained?

Log retention is a configuration choice made by the operator. hoop.dev stores logs in a backend you control, allowing you to align retention with your compliance requirements.

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