Add runtime assertion authentication modes and an auth provider (#55636)

## What changed

Add `RuntimeAuthProvider` to resolve request authentication through the runtime auth manager. Support `dual_header` mode, which sends a bearer credential alongside `x-openai-agent-assertion`, and `assertion_only` mode, which uses `Authorization: AgentAssertion …`.

Replace stale authentication headers and sign a fresh assertion for each request attempt. Propagate registration failures without falling back to credential-only authentication, preserving policy errors and classifying transport failures, rate limits, and server errors as transient.

Add the disabled-by-default `features.runtime_agent_instances` configuration with independent `enabled` and `mode` settings, schema support, and structured override merging. Selecting a mode alone does not enable the feature.

## Testing

Add coverage for both modes with API key and ChatGPT credentials, stale header replacement, fresh assertions, credential refresh without runtime replacement, registration failures, and configuration parsing and merging.

GitOrigin-RevId: 9e93d25762600f0ff592c5248fe4c8c2c8182c8d
This commit is contained in:
cooper-oai
2026-10-20 17:29:40 +00:00
committed by copyberry
parent a13ab7e4ed
commit cb00a67569
12 changed files with 444 additions and 39 deletions
+46
View File
@@ -1162,6 +1162,9 @@
"rollout_budget": {
"$ref": "#/definitions/FeatureToml_for_RolloutBudgetConfigToml"
},
"runtime_agent_instances": {
"$ref": "#/definitions/FeatureToml_for_RuntimeAgentInstancesConfigToml"
},
"runtime_metrics": {
"type": "boolean"
},
@@ -1719,6 +1722,16 @@
}
]
},
"FeatureToml_for_RuntimeAgentInstancesConfigToml": {
"anyOf": [
{
"type": "boolean"
},
{
"$ref": "#/definitions/RuntimeAgentInstancesConfigToml"
}
]
},
"FeatureToml_for_SleepToolConfigToml": {
"anyOf": [
{
@@ -4274,6 +4287,36 @@
},
"type": "object"
},
"RuntimeAgentInstancesConfigToml": {
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean"
},
"mode": {
"$ref": "#/definitions/RuntimeAuthMode"
}
},
"type": "object"
},
"RuntimeAuthMode": {
"oneOf": [
{
"description": "Send the actor credential and a runtime assertion together during migration.",
"enum": [
"dual_header"
],
"type": "string"
},
{
"description": "Send only the runtime assertion as the request credential.",
"enum": [
"assertion_only"
],
"type": "string"
}
]
},
"SandboxMode": {
"enum": [
"read-only",
@@ -7574,6 +7617,9 @@
"rollout_budget": {
"$ref": "#/definitions/FeatureToml_for_RolloutBudgetConfigToml"
},
"runtime_agent_instances": {
"$ref": "#/definitions/FeatureToml_for_RuntimeAgentInstancesConfigToml"
},
"runtime_metrics": {
"type": "boolean"
},