Inspect

Egress secrets

Egress secrets let an agent call an authenticated API without reading its credential. Inspect adds the secret as an HTTP header when an HTTPS request leaves the sandbox for the configured host. The sandbox receives a reference to the secret, not its value.

Use an egress secret when a tool only needs to send a credential in a request header. Use an environment variable when a process must read the value itself.

Permissions and scope

Organization egress secrets require the Manage secrets role to view or change. They apply to all sessions, including sessions without a GitHub repository. Repository egress secrets apply to sessions using that repository; changing them requires the Edit repositories role. Users who can view repository settings can view the configured hosts and header names, but saved values are not returned.

Read-only users cannot change egress secrets. See Users and roles.

Configure an egress secret

  1. Open Environment → Egress secrets for an organization secret. For a repository secret, open Repositories, select the repository, and choose Egress secrets.
  2. Choose Add egress secret.
  3. Set Host to the exact API hostname, such as api.example.com.
  4. Set Header to the header the API expects, such as Authorization, and Value to the complete header value, such as Bearer YOUR_TOKEN.
  5. Choose Add secret.

Secrets added through settings target HTTPS on port 443. Do not include a port in Host. Host matching is exact: api.example.com does not grant the same header to example.com or another subdomain. Wildcard hosts are not accepted.

Inspect normalizes hostnames and header names to lowercase. A repository secret takes precedence over an organization secret for the same host, port, and header. Different headers for the same host are separate secrets.

Update or remove a secret

Edit a secret to change its header or replace its value. Leave New value blank to keep the stored value. You cannot move an existing secret to another host or port; add a new secret for that destination instead.

Deleting a secret stops sessions from sending it, but the proxy may continue using a cached value for up to 60 seconds.

Limits

  • Effective secrets per session: 16, after repository overrides replace matching organization entries.
  • Host: up to 253 characters; a DNS hostname, without wildcards.
  • Header name: 1 to 128 characters; must be a valid HTTP header name.
  • Value: nonempty, up to 8,192 bytes, without control characters or line breaks.

Inspect rejects headers that control the connection or proxy itself: host, content-length, transfer-encoding, connection, proxy-authorization, proxy-authenticate, upgrade, trailer, and te.

Troubleshooting