Credential Brokering: Securing AI Agents Without Secrets

Key Takeaways
- •Credential brokering allows autonomous agents to access protected enterprise systems through identity gateways without ever exposing raw secrets to the model.
- •Examines the security hazards of direct secret exposure, analyzing the structural bottlenecks and trade-offs in real-world deployments.
- •Provides engineering benchmarks and verification criteria for how credential brokering separates authority from secrets.
On 10 November 2026, the Cloud Native Computing Foundation welcomed OpenShell as a Sandbox project, spotlighting credential brokering as the required architectural standard for preventing secret exfiltration in autonomous systems. By decoupling authentication from language model contexts, credential brokering enables agents to interact with protected enterprise APIs without ever viewing or storing long-lived credentials.
Early generative AI integrations passed API keys and database credentials directly to the model. Developers injected raw secrets into system prompts, mounted environment variable files inside execution containers, or allowed agents to pass authentication headers as function parameters. In an autonomous environment, exposing raw credentials to a probabilistic model introduces critical security vulnerabilities. Once a secret enters the context window or execution environment, any successful prompt injection can exfiltrate it.
The security hazards of direct secret exposure
Directly providing credentials to an autonomous agent creates several immediate attack paths:
- Prompt injection exfiltration: an attacker embeds hidden text inside an external document that the agent reads. The payload instructs the model to encode its system prompt or environment variables into base64 and transmit the string to an external server via curl or DNS tunneling.
- Accidental disclosure in transcripts and logs: language models frequently quote their own prompts or tool inputs in reasoning summaries. Storing these conversations in centralized logging services or database transcripts exposes plaintext credentials to broad internal teams.
- Process memory snooping: when an agent runs arbitrary development tools or compiles third-party libraries, untrusted dependencies can inspect the local process table, read environment variables, and steal stored cloud tokens.
- Scope creep and lack of revocation: static API keys rarely support fine-grained scoping. If an agent holds a broad cloud provider token to provision one virtual machine, a compromised agent can use that same key to access production storage buckets or delete database backups.
Direct Secret Exposure (Vulnerable):
[Agent Context: Contains API_KEY] ──(Exfiltrated via Prompt Injection)──> [Attacker]
Credential Brokering (Secure):
[Agent Runtime] ──(Request Action: Read File)──> [Security Gateway]
│
▼ (Validates Policy)
[Credential Broker]
│
▼ (Injects Ephemeral Token)
[Protected Enterprise API]How credential brokering separates authority from secrets
Credential brokering shifts authentication from the agent to an external security gateway. The agent receives authorization to perform a specific action, but the mechanical credentials required to execute that action remain confined to trusted infrastructure.
The brokered execution sequence proceeds across four distinct stages:
- Abstract request generation: when an agent needs to fetch data, it does not formulate an HTTP request containing an Authorization header. It outputs an abstract tool request specifying the target resource and intent, such as read_customer_record with identifier 4082.
- Gateway policy evaluation: the request arrives at an external policy engine, such as Cedar in OpenShell. The supervisor verifies that the agent's current task identity holds permission to access customer 4082, checking user identity, task boundaries, and rate limits.
- Dynamic token exchange or proxy injection: upon approval, the credential broker obtains a short-lived, downscoped token using protocols such as OAuth 2.0 Token Exchange (RFC 8693). Alternatively, the gateway acts as an egress proxy, directly injecting the authorization header into the outbound HTTP packet as it traverses the network interface.
- Response sanitization: the remote API returns the customer record to the gateway. The gateway inspects the payload, scrubs any reflected authorization tokens or internal network headers, and delivers only the sanitized data payload to the agent context.
Ephemeral scopes and workload identity
A robust credential broker relies on short-lived identities rather than static secrets. Implementing secure brokering requires adhering to established standards:
- Workload identity federation: instead of storing static service account keys on disk, the agent runtime assumes an ephemeral workload identity anchored to container metadata, SPIFFE IDs, or cloud IAM roles.
- Fine-grained scoping: tokens issued by the broker must be restricted to the exact resource required for the immediate task. If an agent needs to read an object from an Amazon S3 bucket, the broker generates a presigned URL valid for fifteen minutes rather than granting broad read permissions across the cloud account.
- Immediate revocation: because tokens are ephemeral, revoking access does not require rotating master keys. Security teams can terminate an agent's active workload identity, instantly invalidating all downstream access across connected services.
Implementation criteria for production agent brokers
Organizations implementing credential brokering should enforce four baseline architectural requirements:
- Zero secrets in disk storage or environment variables: agent containers must boot without access to static .env files or secret volume mounts.
- Outbound network proxying: all external network requests from agent sandboxes must route through an authenticated forward proxy capable of injecting bearer tokens on approved routes.
- Strict payload inspection: the gateway must prevent the agent from arbitrary egress, blocking requests that attempt to transmit headers to unapproved domain endpoints.
- Comprehensive audit logging: the broker must log every token minting event, recording the requesting agent identity, task context, requested scope, and target API endpoint.
Sources
- CNCF: Welcoming OpenShell (10 November 2026), CNCF, 10 November 2026
- NVIDIA OpenShell Development Note (9 November 2026), NVIDIA, 9 November 2026
- OWASP Secrets Management Cheat Sheet, OWASP Foundation, 15 September 2024
- OAuth 2.0 Security Best Current Practice (RFC 9700), Internet Engineering Task Force, 15 January 2025



