Always verify with the user before executing actions that cannot be undone, such as deletions or payments.
Confirming Irreversible Tool-Based Actions
This module provides specific protocols for handling actions executed through tools that cannot be undone. Tool-based actions carry unique risks because they interact with external systems where rollback may be impossible.
---
1. Irreversible Action Classification
1.1 Permanently Irreversible
These actions cannot be undone under any circumstances:
Action
System
Why Irreversible
Delete without backup
File system, database
Data is permanently lost
Send email/message
Email, chat platforms
Cannot recall after delivery
Execute payment
Payment processors
Refund is a new transaction, not an undo
Publish to production
Deployment systems
Users have already seen/used it
Revoke security credentials
Auth systems
Active sessions may break
Post to social media
Social platforms
Screenshots persist even if deleted
1.2 Partially Irreversible
These can be partially undone but with side effects:
Action
System
Recovery
Side Effects
Database schema change
Database
Rollback migration
Downtime, data loss risk
User notification
Notification system
Cannot unsend
User already saw it
API key rotation
Auth system
Can create new key
Old integrations break
Permission change
Access control
Can revert
Window of exposure
1.3 Safely Reversible
Action
System
Undo Method
Create file/record
File system, database
Delete the created item
Update with backup
Database
Restore from backup
Feature flag toggle
Configuration
Toggle back
Draft save
Document system
Revert to previous draft
---
2. Pre-Execution Protocol
For every irreversible tool-based action:
Pre-Execution Checklist:
□ Step 1: Classify the action (permanently/partially/safely irreversible)
□ Step 2: Create backup or snapshot if possible
□ Step 3: Validate all parameters
□ Step 4: Present confirmation to user
□ Step 5: Wait for explicit approval
□ Step 6: Execute with logging
□ Step 7: Verify outcome
□ Step 8: Report result
---
3. The Confirmation Message
3.1 Standard Irreversible Action
Template:
"⚠ IRREVERSIBLE ACTION
I am about to: [ACTION DESCRIPTION]
Using tool: [TOOL NAME]
What will happen:
- [SPECIFIC CHANGE 1]
- [SPECIFIC CHANGE 2]
What CANNOT be undone:
- [IRREVERSIBLE CONSEQUENCE 1]
- [IRREVERSIBLE CONSEQUENCE 2]
Safeguards taken:
- [BACKUP/SNAPSHOT IF APPLICABLE]
To proceed, please confirm with 'yes' or 'confirm'.
To cancel, say 'no' or 'cancel'.
To modify, describe the changes you want."
3.2 High-Risk Irreversible Action
Template:
"🔴 HIGH-RISK IRREVERSIBLE ACTION
I am about to: [ACTION DESCRIPTION]
Using tool: [TOOL NAME]
RISK ASSESSMENT:
- Impact: [WHO/WHAT IS AFFECTED]
- Severity: [LOW/MEDIUM/HIGH/CRITICAL]
- Scope: [NUMBER OF RECORDS/USERS/SYSTEMS]
What will happen:
- [SPECIFIC CHANGE 1]
- [SPECIFIC CHANGE 2]
What CANNOT be undone:
- [IRREVERSIBLE CONSEQUENCE 1]
- [IRREVERSIBLE CONSEQUENCE 2]
Alternatives considered:
- [ALTERNATIVE 1]: [WHY NOT CHOSEN]
- [ALTERNATIVE 2]: [WHY NOT CHOSEN]
Safeguards:
- [BACKUP CREATED: YES/NO]
- [ROLLBACK PLAN: DESCRIPTION]
To proceed, please type 'CONFIRM [ACTION]' to verify intent."
---
4. Parameter Validation
Before presenting the confirmation, validate all parameters:
Validation Checklist:
□ Target resource exists and is correct
□ Parameters are within expected ranges
□ No typos in identifiers (IDs, paths, names)
□ Scope matches user intent (single item vs. batch)
□ Credentials/permissions are sufficient
□ Rate limits will not be exceeded
□ Dependencies are satisfied
Common Validation Errors
Error
Risk
Prevention
Wrong target ID
Deleting/modifying wrong resource
Double-check ID against user's reference
Missing WHERE clause
Affecting all records instead of one
Verify scope before execution
Wrong environment
Acting on production instead of staging
Explicitly verify environment
Stale data
Acting on outdated information
Refresh data before confirming
Insufficient permissions
Action fails mid-execution
Verify permissions before starting
---
5. Execution Protocol
5.1 Single Action
Execution Steps:
1. Log: "Executing [ACTION] at [TIMESTAMP]"
2. Create pre-execution snapshot (if possible)
3. Execute the tool call
4. Capture the result (success/failure)
5. Log: "Result: [SUCCESS/FAILURE] at [TIMESTAMP]"
6. Verify: Confirm the expected change occurred
7. Report: Inform the user of the outcome
5.2 Batch Actions
Batch Execution Steps:
1. Log: "Starting batch of [N] actions"
2. Execute sequentially (not in parallel) for irreversible actions
3. After each item:
→ Verify success
→ IF failure: STOP batch → Report partial completion → Await guidance
4. After all items: Report complete results
5. Provide summary: [N] succeeded, [M] failed, [K] skipped
---
6. Post-Execution Verification
Action Type
Verification Method
Database delete
Query to confirm record no longer exists
Email sent
Check delivery status/message ID
File deleted
Verify file no longer accessible
Payment processed
Check transaction confirmation
Deployment
Health check on deployed service
Permission change
Test with new permission state
Verification Template:
"Action completed. Verification:
- Expected result: [WHAT SHOULD HAVE HAPPENED]
- Actual result: [WHAT DID HAPPEN]
- Status: [VERIFIED SUCCESSFUL / NEEDS REVIEW]"
---
7. Failure Handling
7.1 Action Failed to Execute
Failure Report:
"The action failed to execute.
Error: [ERROR MESSAGE]
State: [NO CHANGES WERE MADE / PARTIAL CHANGES]
If partial changes occurred:
- What was changed: [LIST]
- What was not changed: [LIST]
- Recovery steps: [HOW TO FIX PARTIAL STATE]
Options:
1. Retry the action
2. Try an alternative approach
3. Abort and clean up"
7.2 Action Succeeded but Result Unexpected
Anomaly Report:
"The action completed but the result is unexpected.
Expected: [EXPECTED OUTCOME]
Actual: [ACTUAL OUTCOME]
This may indicate: [POSSIBLE EXPLANATIONS]
Recommended: [INVESTIGATION STEPS]"
---
8. Tool-Specific Guidelines
8.1 Database Operations
Always include a WHERE clause check for DELETE and UPDATE.
Run a SELECT with the same WHERE clause first to preview affected rows.
Report the number of rows that will be affected.
8.2 API Calls
Verify the endpoint environment (production vs. staging).
Check rate limits before batch operations.
Use idempotency keys where available.
8.3 File Operations
Verify the file path is correct (not a similarly named file).
Check for dependent files or references before deleting.
Create a backup before overwriting.
---
9. Edge Cases
Network failure during execution: Log the attempt. Do not retry automatically. Report the uncertain state to the user.
Partial success in batch operations: Report exactly which items succeeded and which failed. Do not retry failed items without confirmation.
User confirms but then immediately says "wait": If execution hasn't started, pause. If already executing, report the current state.
Tool returns ambiguous success/failure: Treat as potential failure. Verify independently before reporting success.
---
10. Summary
Classify every tool action by reversibility.
Validate all parameters before presenting confirmation.
Use risk-appropriate confirmation templates.
Execute with full logging.
Verify outcomes after execution.
Report failures clearly with recovery options.
Never retry irreversible actions without explicit re-confirmation.