{"record":{"id":"fa871cea538e850a","repo":"warpdotdev/warp","slug":"refusing-to-delete-secret-without-confirmation-in","errorCode":null,"errorMessage":"Refusing to delete secret without confirmation in non-interactive mode (use --force to bypass)","messagePattern":"Refusing to delete secret without confirmation in non-interactive mode \\(use --force to bypass\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"app/src/ai/agent_sdk/secret.rs","lineNumber":316,"sourceCode":"            let owner = match super::common::resolve_owner(team, personal, ctx) {\n                Ok(owner) => owner,\n                Err(err) => {\n                    super::report_fatal_error(err, ctx);\n                    return;\n                }\n            };\n\n            let secret_owner = match owner {\n                Owner::User { .. } => SecretOwner::CurrentUser,\n                Owner::Team { team_uid } => SecretOwner::Team {\n                    team_uid: team_uid.uid(),\n                },\n            };\n\n            if !force {\n                if !io::stdin().is_terminal() {\n                    super::report_fatal_error(\n                        anyhow::anyhow!(\n                            \"Refusing to delete secret without confirmation in non-interactive mode (use --force to bypass)\"\n                        ),\n                        ctx,\n                    );\n                    return;\n                }\n\n                let scope = match owner {\n                    Owner::User { .. } => \"personal\",\n                    Owner::Team { .. } => \"team\",\n                };\n\n                let should_delete = match Confirm::new(&format!(\"Delete {scope} secret '{name}'?\"))\n                    .with_default(false)\n                    .with_help_message(\"This action cannot be undone\")\n                    .prompt()\n                {\n                    Ok(should_delete) => should_delete,","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/secret.rs#L298-L334","documentation":"delete_secret refuses to destroy a managed secret when --force is absent and stdin is not a terminal, because no interactive confirmation is possible in that context. This is a deliberate safety rail so piped/CI invocations cannot silently delete secrets. Adding --force (or running interactively to get the prompt) is the only way forward.","triggerScenarios":"oz secret delete <name> inside a CI job, cron, pipe (curl | sh), or any context where io::stdin().is_terminal() is false, without --force.","commonSituations":"CI pipelines provisioning/cleaning secrets; scripts run under nohup or with redirected stdin; automated rotation jobs written before adding --force.","solutions":["Add --force once you are certain of the target secret and owner","Run the command in a real interactive terminal to get the confirmation prompt","In scripts, gate --force behind an explicit, reviewed variable so it is never accidental"],"exampleFix":"# before (CI job)\noz secret delete prod-token\n# Error: Refusing to delete secret without confirmation in non-interactive mode (use --force to bypass)\n\n# after\noz secret delete prod-token --force","handlingStrategy":"validation","validationCode":"use std::io::IsTerminal;\nlet interactive = std::io::stdin().is_terminal();\nif !interactive && !args.force {\n    anyhow::bail!(\"non-interactive delete of '{}': pass --force or run in a TTY\", args.name);\n}\ndelete_secret(ctx, args).await?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide interactivity up front and branch on stdin::is_terminal in wrappers","Keep --force behind an explicit, reviewed script variable","Never blind-pipe delete commands in CI"],"tags":["agent-sdk","secrets","cli","safety","non-interactive"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}