mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Add opt-in MCP user-verification transport (#43352)
## Why Device-authenticated verification needs an app response outside automated approval and review. Previously, MCP user-verification requests were always cancelled. ## What changed - Add typed `openai/userVerification` elicitations carrying a title, description, and challenge through core and app-server. - Route verification to one connection enabled by trusted host activation. Restrict responses to that owner, exclude requests from replay, and cancel on disconnect or authentication changes, including account switches away and back. - Return proofs in `content`, discard response metadata, and cancel malformed acceptances. Suppress verification response logging and analytics, and send only a generic verification notice to realtime. - Keep the mode experimental and exclude it from stable schema exports. Capability advertisement remains disabled, and the TUI cancels verification requests. ## Testing Add coverage for owner isolation, disconnect and authentication races, proof response handling, automated-review bypass, inactive-host cancellation, stable schema filtering, and realtime payload exclusion. Update the MCP integration test to verify that an activated request holds the tool until the client responds. GitOrigin-RevId: c8c7b6691a3f7756682bbcca9def1df0d1feb906
This commit is contained in:
@@ -45,6 +45,7 @@ mod unsupported_media;
|
||||
mod update_plan_instructions;
|
||||
mod user_instructions;
|
||||
mod user_shell_command;
|
||||
mod user_verification_notice;
|
||||
pub(crate) mod world_state;
|
||||
|
||||
pub(crate) use approved_command_prefix_saved::APPROVED_COMMAND_PREFIX_SAVED_MESSAGE_PREFIX;
|
||||
@@ -114,4 +115,5 @@ pub(crate) use unsupported_media::UnsupportedMedia;
|
||||
pub use update_plan_instructions::without_update_plan_instructions;
|
||||
pub(crate) use user_instructions::UserInstructions;
|
||||
pub(crate) use user_shell_command::UserShellCommand;
|
||||
pub(crate) use user_verification_notice::UserVerificationNotice;
|
||||
pub(crate) use world_state::ManagedDeveloperInstructions;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
//! A bounded realtime notice that never includes verification challenge or display text.
|
||||
|
||||
use super::ContextualUserFragment;
|
||||
use codex_protocol::models::ContentItemKind;
|
||||
|
||||
pub(crate) struct UserVerificationNotice;
|
||||
|
||||
impl ContextualUserFragment for UserVerificationNotice {
|
||||
fn role(&self) -> &'static str {
|
||||
"developer"
|
||||
}
|
||||
|
||||
fn content_kind(&self) -> ContentItemKind {
|
||||
ContentItemKind("user_verification.notice".to_string())
|
||||
}
|
||||
|
||||
fn markers(&self) -> (&'static str, &'static str) {
|
||||
Self::type_markers()
|
||||
}
|
||||
|
||||
fn type_markers() -> (&'static str, &'static str) {
|
||||
("<user_verification_notice>", "</user_verification_notice>")
|
||||
}
|
||||
|
||||
fn body(&self) -> String {
|
||||
"User verification is required. Please respond in the app.".to_string()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user