Skip to main content

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

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 for api.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 pathPattern must have at least two path segments (/repos/acme/widgets, not / or /user).
A route that violates either rule is rejected at creation time.

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 both Authorization: Bearer <token> and Authorization: token <token>; either injectFormat works.

4. Call through the proxy

The agent calls the github 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:
This:
  1. Creates a new encrypted version of the secret
  2. Routes automatically use the latest version
  3. No container redeployment needed — agents keep making the same proxy calls

Deleting a Secret

Deleting a secret will cause proxy requests that depend on it to fail with 403. Make sure no active routes reference the secret before deletion.

Managing Routes

List Routes

Update a Route

Delete a Route

Priority-Based Routing

When multiple routes match a request, the one with the highest priority wins: