core-agent-ide/codex-rs/app-server-protocol/schema/json/v1
Michael Bolin 425fff7ad6
feat: add Reject approval policy with granular prompt rejection controls (#12087)
## Why

We need a way to auto-reject specific approval prompt categories without
switching all approvals off.

The goal is to let users independently control:
- sandbox escalation approvals,
- execpolicy `prompt` rule approvals,
- MCP elicitation prompts.

## What changed

- Added a new primary approval mode in `protocol/src/protocol.rs`:

```rust
pub enum AskForApproval {
    // ...
    Reject(RejectConfig),
    // ...
}

pub struct RejectConfig {
    pub sandbox_approval: bool,
    pub rules: bool,
    pub mcp_elicitations: bool,
}
```

- Wired `RejectConfig` semantics through approval paths in `core`:
  - `core/src/exec_policy.rs`
    - rejects rule-driven prompts when `rules = true`
    - rejects sandbox/escalation prompts when `sandbox_approval = true`
- preserves rule priority when both rule and sandbox prompt conditions
are present
  - `core/src/tools/sandboxing.rs`
- applies `sandbox_approval` to default exec approval decisions and
sandbox-failure retry gating
  - `core/src/safety.rs`
- keeps `Reject { all false }` behavior aligned with `OnRequest` for
patch safety
    - rejects out-of-root patch approvals when `sandbox_approval = true`
  - `core/src/mcp_connection_manager.rs`
    - auto-declines MCP elicitations when `mcp_elicitations = true`

- Ensured approval policy used by MCP elicitation flow stays in sync
with constrained session policy updates.

- Updated app-server v2 conversions and generated schema/TypeScript
artifacts for the new `Reject` shape.

## Verification

Added focused unit coverage for the new behavior in:
- `core/src/exec_policy.rs`
- `core/src/tools/sandboxing.rs`
- `core/src/mcp_connection_manager.rs`
- `core/src/safety.rs`
- `core/src/tools/runtimes/apply_patch.rs`

Key cases covered include rule-vs-sandbox prompt precedence, MCP
auto-decline behavior, and patch/sandbox retry behavior under
`RejectConfig`.
2026-02-19 11:41:49 -08:00
..
AddConversationListenerParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
AddConversationSubscriptionResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ArchiveConversationParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ArchiveConversationResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
AuthStatusChangeNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
CancelLoginChatGptParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
CancelLoginChatGptResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ExecOneOffCommandParams.json feat: make sandbox read access configurable with ReadOnlyAccess (#11387) 2026-02-11 18:31:14 -08:00
ExecOneOffCommandResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ForkConversationParams.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
ForkConversationResponse.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
GetAuthStatusParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
GetAuthStatusResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
GetConversationSummaryParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
GetConversationSummaryResponse.json chore: streamline phase 2 (#11712) 2026-02-13 13:21:11 +00:00
GetUserAgentResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
GetUserSavedConfigResponse.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
GitDiffToRemoteParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
GitDiffToRemoteResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
InitializeParams.json feat: opt-out of events in the app-server (#11319) 2026-02-10 18:04:52 +00:00
InitializeResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
InterruptConversationParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
InterruptConversationResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ListConversationsParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ListConversationsResponse.json chore: streamline phase 2 (#11712) 2026-02-13 13:21:11 +00:00
LoginApiKeyParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
LoginApiKeyResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
LoginChatGptCompleteNotification.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
LoginChatGptResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
LogoutChatGptResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
NewConversationParams.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
NewConversationResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
RemoveConversationListenerParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
RemoveConversationSubscriptionResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
ResumeConversationParams.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
ResumeConversationResponse.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
SendUserMessageParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SendUserMessageResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SendUserTurnParams.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
SendUserTurnResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SessionConfiguredNotification.json feat: add Reject approval policy with granular prompt rejection controls (#12087) 2026-02-19 11:41:49 -08:00
SetDefaultModelParams.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
SetDefaultModelResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00
UserInfoResponse.json feat: vendor app-server protocol schema fixtures (#10371) 2026-02-01 23:38:43 -08:00