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
- Open Environment → Egress secrets for an organization secret. For a repository secret, open Repositories, select the repository, and choose Egress secrets.
- Choose Add egress secret.
- Set Host to the exact API hostname, such as
api.example.com. - Set Header to the header the API expects, such as
Authorization, and Value to the complete header value, such asBearer YOUR_TOKEN. - 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
Confirm the request uses HTTPS, the exact configured hostname, and port 443. Check the header name
and include any required value prefix, such as Bearer .
Choose the API's authentication header instead of a connection or proxy header.
Edit the existing entry for that host, port, and header instead of adding a duplicate.
Remove unused entries or replace a matching organization entry with a repository override. The limit applies to the effective combined set.
Egress secret storage is unavailable for your organization; Inspect cannot accept a new value.