warpdotdev/warp · warning · anyhow::Error
Refusing to delete secret without confirmation in non-intera
Error message
Refusing to delete secret without confirmation in non-interactive mode (use --force to bypass)
What it means
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.
Source
Thrown at app/src/ai/agent_sdk/secret.rs:316
let owner = match super::common::resolve_owner(team, personal, ctx) {
Ok(owner) => owner,
Err(err) => {
super::report_fatal_error(err, ctx);
return;
}
};
let secret_owner = match owner {
Owner::User { .. } => SecretOwner::CurrentUser,
Owner::Team { team_uid } => SecretOwner::Team {
team_uid: team_uid.uid(),
},
};
if !force {
if !io::stdin().is_terminal() {
super::report_fatal_error(
anyhow::anyhow!(
"Refusing to delete secret without confirmation in non-interactive mode (use --force to bypass)"
),
ctx,
);
return;
}
let scope = match owner {
Owner::User { .. } => "personal",
Owner::Team { .. } => "team",
};
let should_delete = match Confirm::new(&format!("Delete {scope} secret '{name}'?"))
.with_default(false)
.with_help_message("This action cannot be undone")
.prompt()
{
Ok(should_delete) => should_delete,View on GitHub (pinned to e72fd7aacb)
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
Example fix
# before (CI job) oz secret delete prod-token # Error: Refusing to delete secret without confirmation in non-interactive mode (use --force to bypass) # after oz secret delete prod-token --force
Defensive patterns
Strategy: validation
Validate before calling
use std::io::IsTerminal;
let interactive = std::io::stdin().is_terminal();
if !interactive && !args.force {
anyhow::bail!("non-interactive delete of '{}': pass --force or run in a TTY", args.name);
}
delete_secret(ctx, args).await?; Prevention
- 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
When it happens
Trigger: oz secret delete <name> inside a CI job, cron, pipe (curl | sh), or any context where io::stdin().is_terminal() is false, without --force.
Common situations: CI pipelines provisioning/cleaning secrets; scripts run under nohup or with redirected stdin; automated rotation jobs written before adding --force.
Related errors
- Secret name is required. Usage: oz secret create <NAME>
- Bedrock secrets require --bedrock-api-key and --region in no
- Bedrock access key secrets require --access-key-id, --secret
- Refusing to expire API key without confirmation in non-inter
- invalid value 'secret'
AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16).
Data as JSON: /api/errors/fa871cea538e850a.
Report an issue: GitHub.