Managing Secrets
This guide covers creating encrypted credentials, configuring injection routes, and rotating keys — all without redeploying agent containers.Prerequisites
- Tenant-level API key (secrets require tenant auth)
- API credentials to store (OpenAI key, Anthropic key, etc.)
Creating a Secret
Creating a Route
Routes tell the proxy how to inject credentials when an agent makes a request:Common Route Examples
OpenAI
OpenAI
Anthropic
Anthropic
Birdeye (Custom Header)
Birdeye (Custom Header)
GitHub (Fine-Grained PAT)
GitHub (Fine-Grained PAT)
Credentials are injected as request headers only. Query-parameter and
request-body injection are not supported: upstream responses can reflect query
strings and bodies, which would risk leaking the injected credential back to
the agent.
GitHub Fine-Grained Tokens
GitHub is an allowlisted credential host, but routes forapi.github.com are
held to an extra narrowness standard so a single token can only be attached
to the exact endpoint you intend:
- The route must specify an explicit
method(no wildcard*). - The
pathPatternmust have at least two path segments (/repos/acme/widgets, not/or/user).
1. Mint a fine-grained PAT
Create a fine-grained personal access token in GitHub with the minimum scope for the job:- Resource owner / repositories: select only the specific repositories the
agent needs (for example
acme/widgets), never “All repositories.” - Permissions: grant only what the endpoint requires (for example Issues: Read and write for posting issue comments). Leave everything else at No access.
- Expiration: set a short expiration and rotate on schedule.
2. Store the token as a secret
3. Create a narrow route
Scope the route to one method and one deep path. GitHub accepts bothAuthorization: Bearer <token> and Authorization: token <token>; either
injectFormat works.
4. Call through the proxy
The agent calls thegithub alias with its own agent token. The proxy matches
the route, injects the PAT as the Authorization header, and forwards the
request. The supported agent caller receives the provider response, not the stored token.
Mutating proxy requests (POST, PUT, PATCH, DELETE) require an
Idempotency-Key header.Listing Secrets
Rotating a Secret
When you need to update a credential (e.g., API key rotation), use the rotate endpoint:- Creates a new encrypted version of the secret
- Routes automatically use the latest version
- No container redeployment needed — agents keep making the same proxy calls
Deleting a Secret
Managing Routes
List Routes
Update a Route
Delete a Route
Priority-Based Routing
When multiple routes match a request, the one with the highestpriority wins:
Related
- Secret Vault Concepts — How encryption works
- Proxy Gateway — How injection works in the proxy
- Secrets API — Full REST API reference
- Routes API — Route management API