core-agent-ide/codex-rs/app-server-protocol/schema/json/v2
Charley Cunningham bc24017d64
Add Smart Approvals guardian review across core, app-server, and TUI (#13860)
## Summary
- add `approvals_reviewer = "user" | "guardian_subagent"` as the runtime
control for who reviews approval requests
- route Smart Approvals guardian review through core for command
execution, file changes, managed-network approvals, MCP approvals, and
delegated/subagent approval flows
- expose guardian review in app-server with temporary unstable
`item/autoApprovalReview/{started,completed}` notifications carrying
`targetItemId`, `review`, and `action`
- update the TUI so Smart Approvals can be enabled from `/experimental`,
aligned with the matching `/approvals` mode, and surfaced clearly while
reviews are pending or resolved

## Runtime model
This PR does not introduce a new `approval_policy`.

Instead:
- `approval_policy` still controls when approval is needed
- `approvals_reviewer` controls who reviewable approval requests are
routed to:
  - `user`
  - `guardian_subagent`

`guardian_subagent` is a carefully prompted reviewer subagent that
gathers relevant context and applies a risk-based decision framework
before approving or denying the request.

The `smart_approvals` feature flag is a rollout/UI gate. Core runtime
behavior keys off `approvals_reviewer`.

When Smart Approvals is enabled from the TUI, it also switches the
current `/approvals` settings to the matching Smart Approvals mode so
users immediately see guardian review in the active thread:
- `approval_policy = on-request`
- `approvals_reviewer = guardian_subagent`
- `sandbox_mode = workspace-write`

Users can still change `/approvals` afterward.

Config-load behavior stays intentionally narrow:
- plain `smart_approvals = true` in `config.toml` remains just the
rollout/UI gate and does not auto-set `approvals_reviewer`
- the deprecated `guardian_approval = true` alias migration does
backfill `approvals_reviewer = "guardian_subagent"` in the same scope
when that reviewer is not already configured there, so old configs
preserve their original guardian-enabled behavior

ARC remains a separate safety check. For MCP tool approvals, ARC
escalations now flow into the configured reviewer instead of always
bypassing guardian and forcing manual review.

## Config stability
The runtime reviewer override is stable, but the config-backed
app-server protocol shape is still settling.

- `thread/start`, `thread/resume`, and `turn/start` keep stable
`approvalsReviewer` overrides
- the config-backed `approvals_reviewer` exposure returned via
`config/read` (including profile-level config) is now marked
`[UNSTABLE]` / experimental in the app-server protocol until we are more
confident in that config surface

## App-server surface
This PR intentionally keeps the guardian app-server shape narrow and
temporary.

It adds generic unstable lifecycle notifications:
- `item/autoApprovalReview/started`
- `item/autoApprovalReview/completed`

with payloads of the form:
- `{ threadId, turnId, targetItemId, review, action? }`

`review` is currently:
- `{ status, riskScore?, riskLevel?, rationale? }`
- where `status` is one of `inProgress`, `approved`, `denied`, or
`aborted`

`action` carries the guardian action summary payload from core when
available. This lets clients render temporary standalone pending-review
UI, including parallel reviews, even when the underlying tool item has
not been emitted yet.

These notifications are explicitly documented as `[UNSTABLE]` and
expected to change soon.

This PR does **not** persist guardian review state onto `thread/read`
tool items. The intended follow-up is to attach guardian review state to
the reviewed tool item lifecycle instead, which would improve
consistency with manual approvals and allow thread history / reconnect
flows to replay guardian review state directly.

## TUI behavior
- `/experimental` exposes the rollout gate as `Smart Approvals`
- enabling it in the TUI enables the feature and switches the current
session to the matching Smart Approvals `/approvals` mode
- disabling it in the TUI clears the persisted `approvals_reviewer`
override when appropriate and returns the session to default manual
review when the effective reviewer changes
- `/approvals` still exposes the reviewer choice directly
- the TUI renders:
- pending guardian review state in the live status footer, including
parallel review aggregation
  - resolved approval/denial state in history

## Scope notes
This PR includes the supporting core/runtime work needed to make Smart
Approvals usable end-to-end:
- shell / unified-exec / apply_patch / managed-network / MCP guardian
review
- delegated/subagent approval routing into guardian review
- guardian review risk metadata and action summaries for app-server/TUI
- config/profile/TUI handling for `smart_approvals`, `guardian_approval`
alias migration, and `approvals_reviewer`
- a small internal cleanup of delegated approval forwarding to dedupe
fallback paths and simplify guardian-vs-parent approval waiting (no
intended behavior change)

Out of scope for this PR:
- redesigning the existing manual approval protocol shapes
- persisting guardian review state onto app-server `ThreadItem`s
- delegated MCP elicitation auto-review (the current delegated MCP
guardian shim only covers the legacy `RequestUserInput` path)

---------

Co-authored-by: Codex <noreply@openai.com>
2026-03-13 15:27:00 -07:00
..
AccountLoginCompletedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
AccountRateLimitsUpdatedNotification.json feat: support multiple rate limits (#11260) 2026-02-10 20:09:31 -08:00
AccountUpdatedNotification.json [codex] include plan type in account updates (#13181) 2026-03-01 13:43:37 -08:00
AgentMessageDeltaNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
AppListUpdatedNotification.json add @plugin mentions (#13510) 2026-03-06 00:03:39 +00:00
AppsListParams.json [apps] Add thread_id param to optionally load thread config for apps feature check. (#11279) 2026-02-09 23:10:26 -08:00
AppsListResponse.json add @plugin mentions (#13510) 2026-03-06 00:03:39 +00:00
CancelLoginAccountParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
CancelLoginAccountResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
CommandExecOutputDeltaNotification.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecParams.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecResizeParams.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecResizeResponse.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecResponse.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecTerminateParams.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecTerminateResponse.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecutionOutputDeltaNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
CommandExecWriteParams.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
CommandExecWriteResponse.json app-server: Add streaming and tty/pty capabilities to command/exec (#13640) 2026-03-06 17:30:17 -08:00
ConfigBatchWriteParams.json [app-server] Support hot-reload user config when batch writing config. (#13839) 2026-03-08 17:38:01 -07:00
ConfigReadParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ConfigReadResponse.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ConfigRequirementsReadResponse.json Rename reject approval policy to granular (#14516) 2026-03-12 16:38:04 -07:00
ConfigValueWriteParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ConfigWarningNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ConfigWriteResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ContextCompactedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
DeprecationNoticeNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ErrorNotification.json change model cap to server overload (#11388) 2026-02-11 17:16:27 -08:00
ExperimentalFeatureListParams.json [app-server] Add a method to list experimental features. (#10721) 2026-02-05 20:04:01 +00:00
ExperimentalFeatureListResponse.json Add stage field for experimental flags. (#10793) 2026-02-05 23:31:04 +00:00
ExternalAgentConfigDetectParams.json Support external agent config detect and import (#12660) 2026-02-25 02:11:51 -08:00
ExternalAgentConfigDetectResponse.json Support external agent config detect and import (#12660) 2026-02-25 02:11:51 -08:00
ExternalAgentConfigImportParams.json Support external agent config detect and import (#12660) 2026-02-25 02:11:51 -08:00
ExternalAgentConfigImportResponse.json Support external agent config detect and import (#12660) 2026-02-25 02:11:51 -08:00
FeedbackUploadParams.json Add ability to attach extra files to feedback (#12370) 2026-02-20 22:26:14 +00:00
FeedbackUploadResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
FileChangeOutputDeltaNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
FsCopyParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsCopyResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsCreateDirectoryParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsCreateDirectoryResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsGetMetadataParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsGetMetadataResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsReadDirectoryParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsReadDirectoryResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsReadFileParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsReadFileResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsRemoveParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsRemoveResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsWriteFileParams.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
FsWriteFileResponse.json app-server: add v2 filesystem APIs (#14245) 2026-03-13 14:42:20 -07:00
GetAccountParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
GetAccountRateLimitsResponse.json feat: support multiple rate limits (#11260) 2026-02-10 20:09:31 -08:00
GetAccountResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
HookCompletedNotification.json start of hooks engine (#13276) 2026-03-10 04:11:31 +00:00
HookStartedNotification.json start of hooks engine (#13276) 2026-03-10 04:11:31 +00:00
ItemCompletedNotification.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ItemGuardianApprovalReviewCompletedNotification.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ItemGuardianApprovalReviewStartedNotification.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ItemStartedNotification.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ListMcpServerStatusParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ListMcpServerStatusResponse.json feat: replace custom mcp-types crate with equivalents from rmcp (#10349) 2026-02-02 17:41:55 -08:00
LoginAccountParams.json fix(app-server): for external auth, replace id_token with chatgpt_acc… (#11240) 2026-02-09 20:48:58 -08:00
LoginAccountResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
LogoutAccountResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
McpServerOauthLoginCompletedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
McpServerOauthLoginParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
McpServerOauthLoginResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
McpServerRefreshResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
McpToolCallProgressNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ModelListParams.json fix: send unfiltered models over model/list (#11793) 2026-02-13 16:26:32 -08:00
ModelListResponse.json Add model availability NUX metadata (#12972) 2026-02-26 22:02:57 -08:00
ModelReroutedNotification.json Feat: add model reroute notification (#12001) 2026-02-17 11:02:23 -08:00
PlanDeltaNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
PluginInstallParams.json support plugin/list. (#13540) 2026-03-05 21:58:50 -05:00
PluginInstallResponse.json feat: add plugin/read. (#14445) 2026-03-12 16:52:21 -07:00
PluginListParams.json feat: Allow sync with remote plugin status. (#14176) 2026-03-11 12:33:08 -07:00
PluginListResponse.json chore: use AVAILABLE and ON_INSTALL as default plugin install and auth policies (#14407) 2026-03-11 20:33:17 -07:00
PluginReadParams.json feat: add plugin/read. (#14445) 2026-03-12 16:52:21 -07:00
PluginReadResponse.json feat: add plugin/read. (#14445) 2026-03-12 16:52:21 -07:00
PluginUninstallParams.json chore: plugin/uninstall endpoint (#14111) 2026-03-09 12:40:25 -07:00
PluginUninstallResponse.json chore: plugin/uninstall endpoint (#14111) 2026-03-09 12:40:25 -07:00
RawResponseItemCompletedNotification.json feat: search_tool migrate to bring you own tool of Responses API (#14274) 2026-03-11 17:51:51 -07:00
ReasoningSummaryPartAddedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ReasoningSummaryTextDeltaNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ReasoningTextDeltaNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ReviewStartParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ReviewStartResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ServerRequestResolvedNotification.json app-server: Replay pending item requests on thread/resume (#12560) 2026-02-27 12:45:59 -08:00
SkillsChangedNotification.json feat(app-server): add a skills/changed v2 notification (#13414) 2026-03-03 17:01:00 -08:00
SkillsConfigWriteParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SkillsConfigWriteResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SkillsListParams.json feat: extend skills/list to support additional roots. (#10835) 2026-02-09 13:30:38 -08:00
SkillsListResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SkillsRemoteReadParams.json app-server: Emit thread archive/unarchive notifications (#12030) 2026-02-17 14:53:58 -08:00
SkillsRemoteReadResponse.json feat: add APIs to list and download public remote skills (#10448) 2026-02-03 14:09:37 -08:00
SkillsRemoteWriteParams.json Add remote skill scope/product_surface/enabled params and cleanup (#11801) 2026-02-17 11:05:22 -08:00
SkillsRemoteWriteResponse.json app-server: Emit thread archive/unarchive notifications (#12030) 2026-02-17 14:53:58 -08:00
TerminalInteractionNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadArchivedNotification.json app-server: Emit thread archive/unarchive notifications (#12030) 2026-02-17 14:53:58 -08:00
ThreadArchiveParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadArchiveResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadClosedNotification.json feat(app-server): thread/unsubscribe API (#10954) 2026-02-25 13:14:30 -08:00
ThreadCompactStartParams.json Add thread/compact v2 (#10445) 2026-02-03 18:15:55 -08:00
ThreadCompactStartResponse.json Add thread/compact v2 (#10445) 2026-02-03 18:15:55 -08:00
ThreadForkParams.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ThreadForkResponse.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ThreadListParams.json feat: add search term to thread list (#12578) 2026-02-25 09:59:41 +00:00
ThreadListResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ThreadLoadedListParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadLoadedListResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadMetadataUpdateParams.json Add thread metadata update endpoint to app server (#13280) 2026-03-03 15:56:11 -08:00
ThreadMetadataUpdateResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ThreadNameUpdatedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadReadParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadReadResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ThreadRealtimeClosedNotification.json Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
ThreadRealtimeErrorNotification.json Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
ThreadRealtimeItemAddedNotification.json Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
ThreadRealtimeOutputAudioDeltaNotification.json Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
ThreadRealtimeStartedNotification.json Add app-server v2 thread realtime API (#12715) 2026-02-25 09:59:10 -08:00
ThreadResumeParams.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ThreadResumeResponse.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ThreadRollbackParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadRollbackResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ThreadSetNameParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadSetNameResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadStartedNotification.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ThreadStartParams.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ThreadStartResponse.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
ThreadStatusChangedNotification.json app-server: expose loaded thread status via read/list and notifications (#11786) 2026-02-18 15:20:03 -08:00
ThreadTokenUsageUpdatedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadUnarchivedNotification.json app-server: Emit thread archive/unarchive notifications (#12030) 2026-02-17 14:53:58 -08:00
ThreadUnarchiveParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ThreadUnarchiveResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
ThreadUnsubscribeParams.json feat(app-server): thread/unsubscribe API (#10954) 2026-02-25 13:14:30 -08:00
ThreadUnsubscribeResponse.json feat(app-server): thread/unsubscribe API (#10954) 2026-02-25 13:14:30 -08:00
TurnCompletedNotification.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
TurnDiffUpdatedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
TurnInterruptParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
TurnInterruptResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
TurnPlanUpdatedNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
TurnStartedNotification.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
TurnStartParams.json Add Smart Approvals guardian review across core, app-server, and TUI (#13860) 2026-03-13 15:27:00 -07:00
TurnStartResponse.json Include spawn agent model metadata in app-server items (#14410) 2026-03-11 19:25:21 -07:00
TurnSteerParams.json feat(app-server): turn/steer API (#10821) 2026-02-06 00:35:04 +00:00
TurnSteerResponse.json feat(app-server): turn/steer API (#10821) 2026-02-06 00:35:04 +00:00
WindowsSandboxSetupCompletedNotification.json app-server support for Windows sandbox setup. (#12025) 2026-02-18 13:03:16 -08:00
WindowsSandboxSetupStartParams.json app-server: include experimental skill metadata in exec approval requests (#13929) 2026-03-08 18:07:46 -07:00
WindowsSandboxSetupStartResponse.json app-server support for Windows sandbox setup. (#12025) 2026-02-18 13:03:16 -08:00
WindowsWorldWritableWarningNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00