All posts

Standing Access for the Claude Agent SDK

Many assume that giving the Claude Agent SDK permanent credentials is safe because the SDK never stores secrets itself. In reality, standing access creates a persistent attack surface that bypasses runtime checks. When developers embed a long‑lived API key or service‑account token directly in code, every instance of the SDK can reuse that secret without re‑authenticating. The secret often lives in a repository, a container image, or an environment variable that is replicated across dozens of ho

Free White Paper

Standing Privileges Elimination + Open Policy Agent (OPA): The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Many assume that giving the Claude Agent SDK permanent credentials is safe because the SDK never stores secrets itself. In reality, standing access creates a persistent attack surface that bypasses runtime checks.

When developers embed a long‑lived API key or service‑account token directly in code, every instance of the SDK can reuse that secret without re‑authenticating. The secret often lives in a repository, a container image, or an environment variable that is replicated across dozens of hosts. If an attacker compromises a single host, they inherit the same privileges as every other instance of the SDK. The result is a single point of failure that can be abused for months before anyone notices.

Beyond the obvious credential leakage, standing access eliminates any opportunity to enforce intent‑based policies at request time. The SDK can issue any command supported by the downstream service, and the service sees a request that appears to come from a trusted identity. There is no audit trail that ties a specific command to a specific engineer, and no way to block dangerous operations before they reach the target.

Why standing access is a problem for the Claude Agent SDK

The Claude Agent SDK is designed to let AI‑driven agents act on behalf of users. In many deployments, teams grant the SDK a static token that never expires. This token is then used for every interaction with internal databases, HTTP APIs, or SSH endpoints. The convenience of a single secret masks three critical gaps:

  • Unlimited blast radius. A compromised host can issue any request the SDK supports, from reading confidential records to modifying production configurations.
  • No per‑request visibility. Operations are not tied to a human identity, so security teams cannot answer who ran a particular query or why it was executed.
  • No real‑time policy enforcement. Dangerous commands such as destructive SQL statements or privileged SSH actions are allowed to pass unchecked.

These gaps are especially dangerous in environments where the Claude Agent SDK is used to automate routine tasks across multiple clouds or data stores. The standing access model gives the agent unrestricted reach, effectively turning it into a backdoor.

What fixing standing access alone does not solve

One obvious mitigation is to replace a never‑expiring token with a short‑lived credential or to rotate the secret frequently. While this reduces the window of exposure, it does not address the core architectural flaw: the request still travels directly from the SDK to the target service. The gateway that could inspect the request, enforce least‑privilege checks, or mask sensitive fields is missing.

In this intermediate state, the following remains true:

Continue reading? Get the full guide.

Standing Privileges Elimination + Open Policy Agent (OPA): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.
  • The SDK still connects straight to the database or HTTP endpoint, meaning the target sees only the SDK’s identity.
  • There is no centralized audit log that records each command, its parameters, and the initiating user.
  • Inline data masking or command blocking cannot be applied because there is no intercepting layer.

In other words, reducing the lifetime of a secret is necessary but not sufficient. Teams need a control plane that sits on the data path, where every request can be examined before it reaches the backend.

Introducing hoop.dev as the data‑path enforcement layer

hoop.dev is a Layer 7 gateway that proxies connections between the Claude Agent SDK and the underlying infrastructure. By placing hoop.dev between the SDK and the target, all traffic is forced through a single, inspectable boundary.

Setup. Identities are still managed by your existing OIDC or SAML provider. Service accounts for the SDK are provisioned with the minimal scopes required for their job. hoop.dev validates the token, extracts group membership, and decides whether the request may proceed.

The data path. Every request from the SDK is routed through hoop.dev. At this point hoop.dev can apply just‑in‑time (JIT) approvals, enforce command‑level policies, and mask sensitive response fields. Because the gateway sits in the protocol layer, it can block a destructive SQL statement before it reaches the database, or require a human reviewer to approve a privileged SSH command.

Enforcement outcomes. hoop.dev records each session, providing a replayable audit trail that ties every action back to the originating user. It masks personally identifiable information in query results, ensuring that downstream logs do not contain raw data. It also enforces JIT access, meaning the SDK receives a short‑lived credential only for the duration of an approved operation.

All of these capabilities exist because hoop.dev is the only component that sits on the data path. Without it, the SDK would continue to talk directly to the resource, and none of the above controls could be guaranteed.

For teams ready to adopt this pattern, the getting‑started guide walks through deploying the gateway, registering a Claude Agent SDK connection, and configuring JIT policies. The learn section provides deeper explanations of masking, session replay, and approval workflows.

FAQ

  • Is any form of standing access ever acceptable? A short‑lived token that expires after a few minutes can be useful for automation, but it must still be mediated by a gateway that records and enforces policies. Without that mediation, standing access remains a high‑risk practice.
  • How does hoop.dev enforce just‑in‑time access for the Claude Agent SDK? When the SDK presents a request, hoop.dev checks the associated policy. If the policy requires approval, the request is paused and a human reviewer is notified. Once approved, hoop.dev issues a temporary credential to the SDK and forwards the request.
  • What happens to logs and audit data? hoop.dev writes a per‑session record that includes the user identity, the exact command, timestamps, and any masking actions applied. These logs can be exported to your SIEM or retained for compliance audits.

By moving the enforcement point from the SDK itself to a dedicated gateway, organizations can keep the convenience of the Claude Agent SDK while eliminating the hidden dangers of standing access. The combination of strong identity setup, a data‑path gateway, and comprehensive enforcement outcomes creates a resilient security posture that scales with modern AI‑driven workloads.

Explore the source code, contribute improvements, and see how the community is building on this model at GitHub.

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