feat(plugins): Add top-level API header injection#282
feat(plugins): Add top-level API header injection#282dcramer merged 4 commits intogetsentry:mainfrom
Conversation
Support providers that authenticate with fixed HTTP headers resolved from deployment env instead of OAuth or app-issued bearer tokens. This lets sandboxed tools call services like Better Stack through the existing host-managed header injection path without exposing real secrets inside the sandbox or requiring changes to the MCP credential model. Co-Authored-By: OpenAI ChatGPT <chatgpt@openai.com>
|
@carderne is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
|
tbqh i think the goal of this is totally reasonable. will take a look at make sure it hits our stability reqs as sometimes the test suite here isnt capable enough still |
Reject empty static header credential maps during manifest normalization so misconfigured providers fail at load time instead of crashing when a broker issues a lease. Keep optional empty maps omitted for existing credential and MCP config paths, and avoid assuming every credential type has an auth token env name. Refs getsentryGH-282 Co-Authored-By: GPT-5 Codex <codex@openai.com>
Reject empty static header credential maps during manifest normalization so misconfigured providers fail at load time instead of crashing when a broker issues a lease. Keep optional empty maps omitted for existing credential and MCP config paths, and avoid assuming every credential type has an auth token env name. Refs getsentryGH-282 Co-Authored-By: GPT-5 Codex <codex@openai.com>
Treat api-headers as plugin-level sandbox header injection instead of a credential type. Require header env placeholders to be declared in env-vars, forbid defaults for header secrets, and keep header-only plugins eligible for turn-scoped injection. Refs getsentryGH-282 Co-Authored-By: GPT-5 Codex <codex@openai.com>
Treat api-headers as plugin-level sandbox header injection instead of a credential type. Require header env placeholders to be declared in env-vars, forbid defaults for header secrets, and keep header-only plugins eligible for turn-scoped injection. Refs getsentryGH-282 Co-Authored-By: GPT-5 Codex <codex@openai.com>
Treat api-headers as plugin-level sandbox header injection instead of a credential type. Require header env placeholders to be declared in env-vars, forbid defaults for header secrets, and keep header-only plugins eligible for turn-scoped injection. Refs getsentryGH-282 Co-Authored-By: GPT-5 Codex <codex@openai.com>
Treat api-headers as plugin-level sandbox header injection instead of a credential type. Require header env placeholders to be declared in env-vars, forbid defaults for header secrets, and keep header-only plugins eligible for turn-scoped injection. Refs getsentryGH-282 Co-Authored-By: GPT-5 Codex <codex@openai.com>
|
@dcramer great. Happy for you to implement this however you like, or equally happy to take some nudges on this PR (just mention because going by commit history it seems a relatively private project). Either way I'll look a bit closer at the code this week, since I'm using this in production now. Two notes:
api-headers:
Authorization: "Bearer $TOKEN" // DOES NOT work
Authorization: "$AUTH_HEADER" // works |
|
im dropping the credentials bit here and just allow headers to be configured like this - should simplify the whole thing dont think there's any reason to require the extra step. just working through quality checks rn |
Document how token-backed credential headers interact with top-level API headers and rename the credential-header test for accuracy. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Pin how plugin-level API headers merge with token-backed credential headers and update the plugin security contract wording. Co-Authored-By: GPT-5 Codex <codex@openai.com>
|
Final implementation outcome after the cleanup pass: This PR no longer adds a new credential type. The final manifest shape is top-level API header injection: env-vars:
EXAMPLE_AUTH_HEADER:
api-domains:
- api.example.com
api-headers:
Authorization: ${EXAMPLE_AUTH_HEADER}
X-Api-Version: "2026-01-01"Key contract:
Security/runtime notes:
Validation done locally:
Remaining check noise is external to this patch: Vercel requires fork deploy authorization, and Warden can fail on fork PRs when required app secrets are unavailable. |
Add plugin-level API header injection for providers that authenticate through host-managed HTTP headers. Header-authenticated plugins now declare
api-domainsandapi-headersat the manifest top level, keeping real header values in deployment env and out of sandbox env vars.Manifest Shape
Header-only providers no longer use a credential type. Env-backed header values use declared
${NAME}placeholders, and API header env vars cannot define defaults.Before, header auth was modeled as a credential type:
After, headers are plugin-level request metadata:
Credential Interaction
credentials.typestays limited tooauth-bearerandgithub-app. Existingcredentials.api-headersremains only as extra token-backed headers, while top-level API headers can stand alone or combine with token credentials; token credential headers win on overlap.Runtime Safety
Header transforms are attached by the capability runtime to sandbox bash executions; the model-facing bash schema remains command-only. Eval mode uses deterministic dummy header values so test brokers never read deployment secrets.