agcodex_common/
approval_presets.rs1use agcodex_core::protocol::AskForApproval;
2use agcodex_core::protocol::SandboxPolicy;
3
4#[derive(Debug, Clone)]
6pub struct ApprovalPreset {
7    pub id: &'static str,
9    pub label: &'static str,
11    pub description: &'static str,
13    pub approval: AskForApproval,
15    pub sandbox: SandboxPolicy,
17}
18
19pub fn builtin_approval_presets() -> Vec<ApprovalPreset> {
23    vec![
24        ApprovalPreset {
25            id: "read-only",
26            label: "Read Only",
27            description: "Codex can read files and answer questions. Codex requires approval to make edits, run commands, or access network",
28            approval: AskForApproval::OnRequest,
29            sandbox: SandboxPolicy::ReadOnly,
30        },
31        ApprovalPreset {
32            id: "auto",
33            label: "Auto",
34            description: "Codex can read files, make edits, and run commands in the workspace. Codex requires approval to work outside the workspace or access network",
35            approval: AskForApproval::OnRequest,
36            sandbox: SandboxPolicy::new_workspace_write_policy(),
37        },
38        ApprovalPreset {
39            id: "full-access",
40            label: "Full Access",
41            description: "Codex can read files, make edits, and run commands with network access, without approval. Exercise caution",
42            approval: AskForApproval::Never,
43            sandbox: SandboxPolicy::DangerFullAccess,
44        },
45    ]
46}