All posts

Non-Human Identities in Chain-of-Thought, Explained

How can you let an AI‑driven chain‑of‑thought process query a database or invoke a remote service without handing it permanent secrets, especially when the request comes from a non-human identity? Today many teams simply give their automation scripts a long‑lived service account key or embed a static password in a configuration file. The same credential is reused across dozens of pipelines, test runners and scheduled jobs. Engineers copy the file between environments, and the key lives in versi

Free White Paper

Human-in-the-Loop Approvals + Chain of Custody: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

How can you let an AI‑driven chain‑of‑thought process query a database or invoke a remote service without handing it permanent secrets, especially when the request comes from a non-human identity?

Today many teams simply give their automation scripts a long‑lived service account key or embed a static password in a configuration file. The same credential is reused across dozens of pipelines, test runners and scheduled jobs. Engineers copy the file between environments, and the key lives in version control histories for months. When a non-human agent runs, there is no record of which logical step issued the request, what data was returned, or whether the response contained sensitive fields. The result is a blind spot: broad standing access, no per‑request audit, and no ability to mask or block risky queries.

Moving to a token‑based model is a common first step. By issuing short‑lived OIDC tokens to bots, you gain identity information and can enforce least‑privilege scopes. The token proves the request originates from a non-human identity, and the identity provider can rotate keys automatically. However, the token is still presented directly to the target service. The gateway that sits between the token and the resource is missing, so the request reaches the database or API unchanged. In short, the setup improves authentication but leaves enforcement completely open.

Why non-human identity alone is insufficient

Non-human identities give you visibility into *who* is making a call, but they do not control *what* is being done. Without a data‑path enforcement point, a bot can still run a destructive command, exfiltrate PII, or trigger a cascade of downstream calls that bypass any policy you might have defined in your identity provider. The request travels straight to the target, meaning any masking or audit must be built into the target itself – an approach that is fragile and hard to maintain across heterogeneous systems.

This gap becomes especially visible in chain‑of‑thought workflows, where an LLM may generate a series of queries based on intermediate reasoning. Each step could leak partial data, and the overall reasoning path may need to be reviewed by a human before execution. Relying only on token scopes does not give you the ability to pause, review, or redact data in real time.

Placing enforcement in the data path with hoop.dev

hoop.dev provides the missing layer. It sits between the non-human identity token and the target service, acting as a Layer 7 gateway that can inspect each protocol message. When a bot presents its OIDC token, hoop.dev validates the token (setup) and then applies policy at the gateway (data path). Because the gateway controls the flow, hoop.dev can:

Continue reading? Get the full guide.

Human-in-the-Loop Approvals + Chain of Custody: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.
  • Record every session, creating a replayable audit trail for each chain‑of‑thought step.
  • Mask sensitive fields in query results before they reach the LLM, preventing accidental exposure.
  • Require just‑in‑time human approval for high‑risk commands, halting execution until an operator signs off.
  • Block disallowed commands outright, protecting the backend from destructive actions.

All of these outcomes exist only because hoop.dev is the active component in the data path. If you removed hoop.dev, the token would reach the database directly and none of the above controls would apply.

How the architecture fits together

The flow can be broken into three clear responsibilities:

  1. Setup: Identity providers issue short‑lived OIDC tokens to bots. The token encodes the non-human identity and its allowed scopes.
  2. The data path: hoop.dev receives the token, validates it, and then proxies the connection to the target service. Because the gateway is the only point where traffic passes, it can enforce masking, approval and command blocking.
  3. Enforcement outcomes: hoop.dev records the session, applies inline masking, triggers just‑in‑time approval workflows, and blocks disallowed commands. These outcomes are the evidence you need for compliance and for safe chain‑of‑thought execution.

This separation makes it easy to reason about security. The identity system tells you *who* is calling; hoop.dev tells you *what* they are allowed to do and *what* happened.

Getting started with hoop.dev

To adopt this model, start with the getting‑started guide. Deploy the gateway in your network, register your database or API as a connection, and configure your bot to obtain an OIDC token from your identity provider. The gateway will hold the actual service credentials, so the bot never sees them. Detailed policy examples are available in the learn section, where you can define masking rules, approval thresholds and command blacklists.

FAQ

Do I need to change my existing service accounts?

No. hoop.dev can continue to use the same backend credentials. The change is only in how the bot accesses the service – via the gateway instead of direct connection.

Will hoop.dev add latency to my chain‑of‑thought calls?

The gateway operates at the protocol layer and adds only the minimal processing needed for policy checks. In most environments the added latency is negligible compared to the round‑trip time to the target service.

Can I still use my existing CI/CD pipelines?

Yes. Update the pipeline step that connects to the resource to point at the hoop.dev endpoint and request an OIDC token for the bot identity. The rest of the pipeline remains unchanged.

Explore the source code on GitHub to see how the gateway is built and contribute improvements.

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