feat: add run task identity primitives#19047
Conversation
c588673 to
c74a2f3
Compare
3254ce5 to
0324e8a
Compare
0324e8a to
2685c9e
Compare
2685c9e to
55dced3
Compare
8d2470f to
c5d5e7c
Compare
baf2618 to
110e2a4
Compare
tigrantsat-openai
left a comment
There was a problem hiding this comment.
Let's ensure full set of features + launching internally before enabling into codex.
0e79c01 to
03963fc
Compare
03963fc to
8810088
Compare
8810088 to
ef4a89f
Compare
1d62ce5 to
f220d79
Compare
134085f to
d13cbcc
Compare
7026cbc to
d7289e0
Compare
2b9ca9a to
7f15c05
Compare
7f15c05 to
796f8f0
Compare
|
|
||
| pub fn agent_identity_jwks_url(chatgpt_base_url: &str) -> String { | ||
| let trimmed = chatgpt_base_url.trim_end_matches('/'); | ||
| pub fn agent_identity_jwks_url(agent_identity_jwt_base_url: &str) -> String { |
There was a problem hiding this comment.
i think in future this should be the standard issuer derivation (i.e. https://[agent_id].something.something/.well-known) so this doesn't have to be so specific
| task_id: task_id.to_string(), | ||
| timestamp: timestamp.clone(), | ||
| signature: sign_agent_assertion_payload(key, target.task_id, ×tamp)?, | ||
| signature: sign_agent_assertion_payload(key, task_id, ×tamp)?, |
There was a problem hiding this comment.
In future let's remove the signature collision via JSON.stringify([ field_1, field_2, field_3 ]) or something to that effect.
| ) -> String { | ||
| agent_identity_authapi_url( | ||
| agent_identity_authapi_base_url, | ||
| &format!("/v1/agent/{agent_runtime_id}/task/register"), |
There was a problem hiding this comment.
the agent_runtime_id needs to be escaped, clamped or have other URL parts stripped
| )) | ||
| fn agent_identity_authapi_url(agent_identity_authapi_base_url: &str, api_path: &str) -> String { | ||
| let base_url = normalize_agent_identity_authapi_base_url(agent_identity_authapi_base_url); | ||
| format!("{base_url}{api_path}") |
There was a problem hiding this comment.
would be great to do this via a proper URL construction rather than a naiive string concatenation
|
|
||
| pub fn agent_identity_authapi_base_url_from_chatgpt_base_url(chatgpt_base_url: &str) -> String { | ||
| let mut base_url = chatgpt_base_url.trim_end_matches('/').to_string(); | ||
| for suffix in [ |
There was a problem hiding this comment.
this seems very brittle but is probably fine for v0
| break; | ||
| } | ||
| } | ||
| if matches!( |
There was a problem hiding this comment.
perhaps we can build all these mappings statically? so there's no ambiguity at runtime?
796f8f0 to
d7994fd
Compare
d7994fd to
bcf4294
Compare
Stack
This is PR 1 of the simplified HAI single-run-task stack:
#19054 collapsed out of the active stack because the simplified design no longer needs a separate background/control-plane task helper.
Summary
The simplified POC shape is one backend-owned task per Agent Identity run. This PR makes the first layer match that final shape directly instead of introducing task targets, caller-owned external task refs, or intermediate wrappers that later PRs would need to undo.
What changed:
AgentAssertionwire payload asagent_runtime_id,task_id,timestamp, andsignatureregister_agent_taskas the single task-registration helper for both existing Agent Identity JWT auth and the ChatGPT-registration path added later in the stackcodex-agent-identityThis PR intentionally does not enable ChatGPT-derived Agent Identity. That opt-in and config gate are added in the next PR.
Testing
just test -p codex-agent-identity