This prompt is designed for privacy engineers and platform operators who must automate the discovery and deletion of a data subject's information across a heterogeneous set of storage tools. It produces a cascading deletion plan that identifies primary records, backups, logs, and derived datasets, with explicit verification steps for each target. Use this prompt when an agent has access to multiple storage backends and must execute a right-to-delete request under GDPR, CCPA, or internal data retention policies. The prompt assumes the agent has tool access to list, search, and delete operations across the connected storage systems, and that the data subject identifier is known and verified before invocation.
Prompt
Right-to-Delete Enforcement Prompt for Storage Tools

When to Use This Prompt
Defines the operational context, ideal user, and boundaries for the Right-to-Delete Enforcement Prompt for Storage Tools.
Do not use this prompt for single-database cleanup scripts or when the storage topology is fully known and static; those cases are better served by deterministic code. This prompt is also inappropriate when the agent lacks delete permissions on all target systems, when data subject identity verification has not been completed, or when legal holds, regulatory retention obligations, or litigation preservation requirements are active on the subject's data. In those scenarios, the prompt must be paired with a human approval gate and a legal hold check before any deletion plan is generated. The prompt is not a substitute for a data inventory or data mapping exercise—it operates on systems the agent can already reach and interrogate.
Before deploying this prompt, ensure the agent's tool definitions include explicit dry_run parameters for every destructive operation, and that the deletion plan output is routed through a human review step before execution. The prompt includes verification steps, but production deployments should also log the full plan, tool calls, and confirmation responses to an immutable audit trail. If your storage systems include append-only or immutable backends, the prompt should be adapted to produce a deletion-or-suppression plan that accounts for those constraints rather than assuming all targets support physical deletion.
Use Case Fit
Where the Right-to-Delete Enforcement Prompt works, where it fails, and the operational conditions required before deploying it in a production storage tool pipeline.
Good Fit: Structured Storage Backends
Use when: the agent has access to structured storage tools (databases, object stores, search indexes) with well-defined schemas and record-level identifiers. The prompt excels at tracing a subject ID across primary tables, foreign-key relationships, and indexed logs. Guardrail: Provide the agent with a data catalog or schema map; without it, the prompt cannot reliably discover all related records.
Bad Fit: Unstructured or Opaque Backups
Avoid when: the deletion target includes monolithic database dumps, compressed archive files, or opaque binary blobs where individual records cannot be addressed without full extraction and reconstruction. The prompt cannot guarantee complete deletion from un-indexed storage. Guardrail: Flag these targets for manual review and require a human operator to confirm physical media destruction or cryptographic erasure.
Required Inputs: Subject Identity and Tool Catalog
Risk: The prompt produces an incomplete or incorrect deletion plan if it receives only a name or email address. Guardrail: Require a stable, system-wide subject identifier (e.g., user_uuid) plus a tool capability manifest listing each connected storage tool, its record types, and the fields that may contain subject data. Without both, the prompt should refuse to generate a plan.
Operational Risk: Orphan Record Detection
Risk: The prompt identifies primary records but misses derived datasets, materialized views, analytics exports, or cached copies that contain the subject's data without a direct foreign-key link. Guardrail: Pair the prompt with a post-plan verification step that scans all accessible storage for the subject identifier using full-text or pattern matching, and flag any hits not covered by the original plan.
Operational Risk: Deletion Confirmation Gaps
Risk: The prompt generates a deletion plan with verification steps, but the agent may mark a record as deleted before the storage tool confirms the operation completed. Guardrail: Require synchronous confirmation from each storage tool before advancing to the next deletion target. Log every confirmation or failure with timestamps, and halt the cascade if any target fails to confirm within a timeout window.
Regulatory Boundary: Exemption Handling
Risk: The prompt may attempt to delete records that are subject to legal holds, regulatory retention requirements, or active disputes. Guardrail: Provide the agent with a live exemption registry or legal-hold database. The prompt must check each deletion target against this registry and skip any record flagged as exempt, logging the skip with the specific exemption reason for audit purposes.
Copy-Ready Prompt Template
A reusable prompt template for generating cascading deletion plans across storage tools with verification steps.
This prompt instructs the model to act as a privacy enforcement engine that produces a structured, verifiable deletion plan. It is designed for privacy engineers who need to map all locations of a data subject's information across connected storage tools—primary records, backups, logs, and derived datasets—before executing a right-to-delete request. The template uses square-bracket placeholders that must be replaced with concrete values from your environment before sending to the model.
textYou are a data deletion enforcement agent operating within a governed storage environment. Your task is to produce a cascading deletion plan for a data subject exercising their right to deletion. You must identify every storage location containing the subject's data and define verification steps for each deletion target. ## Input - Data Subject Identifier: [SUBJECT_ID] - Deletion Request Scope: [DELETION_SCOPE] - Connected Storage Tools: [TOOL_LIST] - Data Classification Taxonomy: [CLASSIFICATION_TAXONOMY] - Retention Policy Rules: [RETENTION_POLICY] - Regulatory Framework: [REGULATORY_FRAMEWORK] ## Constraints - Do not delete data required for legal holds, regulatory retention, or active disputes. - Flag any record that cannot be deleted and provide the specific exemption reason. - For each deletion target, include a verification method that confirms the data is irrecoverable. - Respect data residency boundaries: [DATA_RESIDENCY_RULES] - Log every deletion action with timestamp, target, and outcome for audit purposes. ## Output Schema Return a JSON object with the following structure: { "deletion_plan_id": "string", "subject_id": "string", "generated_at": "ISO8601 timestamp", "targets": [ { "target_id": "string", "storage_tool": "string", "storage_path": "string", "data_category": "string", "record_type": "primary | backup | log | derived", "deletion_method": "string", "verification_steps": ["string"], "exemption": null | { "reason": "string", "policy_ref": "string", "review_required": boolean }, "estimated_completion": "ISO8601 timestamp" } ], "orphan_record_check": { "detected_orphans": ["string"], "resolution_plan": "string" }, "audit_log_reference": "string" } ## Instructions 1. Parse the connected storage tools and identify all locations where [SUBJECT_ID] appears. 2. Classify each location by record type: primary, backup, log, or derived. 3. For each location, determine the appropriate deletion method (hard delete, overwrite, crypto-shred, or logical delete with tombstone). 4. Check each target against the retention policy and regulatory framework. Flag exemptions explicitly. 5. Define verification steps that confirm deletion, such as query-after-delete, checksum comparison, or access audit. 6. Run an orphan record check: identify any references to [SUBJECT_ID] that remain in indexes, materialized views, or join tables after primary record deletion. 7. Generate a unique audit log reference for this deletion plan.
Replace each placeholder with values from your environment before execution. The [TOOL_LIST] placeholder should contain structured descriptions of each connected storage tool, including its type, access method, and data categories it holds. The [DELETION_SCOPE] should specify whether this is a full deletion, partial deletion, or deletion with retention exceptions. After generating the plan, validate the output against the schema before passing it to any execution harness. For high-risk deletions involving financial, health, or legal data, route the plan through a human approval step before any destructive action.
Prompt Variables
Every variable required by the Right-to-Delete Enforcement Prompt. Validate each before sending to prevent incomplete deletion plans or orphaned records.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DATA_SUBJECT_IDENTIFIER] | Unique identifier for the individual requesting deletion | user_829104 or email:jane.doe@example.com | Must match exactly one identity record in the identity provider. Reject if ambiguous or resolves to multiple subjects. |
[DATA_SUBJECT_ATTRIBUTES] | Known PII attributes to match across storage tools | {"email": "jane.doe@example.com", "phone": "+15551234567"} | Schema must include at least one unique identifier. Validate each attribute against the data catalog's indexed fields. Reject if attributes are empty. |
[TOOL_REGISTRY] | List of connected storage tools with their capabilities and data classifications | {"tools": [{"name": "prod-postgres", "type": "database", "tables": ["users", "events"]}]} | Must be a valid JSON array. Each tool entry requires name, type, and data_locations fields. Reject if registry is empty or contains tools without data location metadata. |
[RETENTION_POLICY] | Legal and business rules governing data retention exceptions | {"exempt_categories": ["financial_tx_7yr"], "legal_holds": ["case_442"]} | Must include exempt_categories and legal_holds arrays. Validate each exemption against the organization's registered policy codes. Reject if policy references unknown exemption codes. |
[DELETION_TIMESTAMP] | ISO 8601 timestamp marking when the deletion request was verified | 2025-03-15T14:30:00Z | Must be a valid ISO 8601 string in UTC. Must not be in the future. Used for audit trail anchoring and legal hold comparison. |
[AUDIT_LOG_DESTINATION] | Target system where deletion audit records will be written | {"type": "immutable_store", "endpoint": "audit-log.internal/v1/events"} | Must include type and endpoint. Validate endpoint against allowed audit log sinks. Reject if destination is not an approved immutable or append-only store. |
[VERIFICATION_METHOD] | How each deletion target will be confirmed before the plan is marked complete | {"strategy": "row_count_compare", "pre_check_required": true} | Must specify strategy and pre_check_required boolean. Supported strategies: row_count_compare, checksum_verify, null_check, manual_review. Reject if strategy is unsupported. |
[MAX_CASCADE_DEPTH] | Maximum number of derived dataset levels to traverse during deletion discovery | 3 | Must be an integer between 1 and 10. Prevents infinite recursion through materialized views, cached aggregations, and derived tables. Reject if non-integer or out of range. |
Implementation Harness Notes
How to wire the Right-to-Delete Enforcement prompt into a secure, auditable application workflow.
This prompt is not a standalone chatbot interaction; it is a structured reasoning step inside a deletion orchestration pipeline. The application layer must first collect the data subject's identifier, the applicable regulation (e.g., GDPR, CCPA), and a list of connected storage tools with their capabilities. The prompt then produces a cascading deletion plan, but the application is responsible for executing each step, verifying completion, and maintaining the audit trail. The model's output is a plan, not an action. Treat it as a high-stakes instruction set that requires deterministic enforcement.
To integrate this prompt, build a service that constructs the [CONTEXT] object by querying your data catalog or configuration management database for all systems that could contain the subject's data. This includes primary databases, read replicas, backup snapshots, log aggregators, and derived datasets. The service should then call the LLM with the prompt template, parse the JSON output against the [OUTPUT_SCHEMA], and validate that every target in the plan maps to a known, accessible tool. Before any deletion command is issued, the plan must be presented for human approval through a review queue. After approval, the application executes each deletion step sequentially, recording the tool name, arguments, timestamp, and response code in an immutable audit log. Any failure must halt the pipeline and trigger an alert, never silently skipping a target.
Model choice matters here. Use a model with strong instruction-following and structured output capabilities, such as GPT-4o or Claude 3.5 Sonnet, and set the temperature to 0 to maximize determinism. Implement a retry loop with a maximum of 2 attempts if the output fails schema validation. For the evaluation layer, build a test harness that injects known data subjects with synthetic records across mock storage tools and verifies that the generated plan includes every expected target and no false positives. Common failure modes include the model hallucinating storage systems not provided in the context, omitting backup or log-derived copies, and generating unverifiable deletion confirmation steps. Each of these must be caught by the validation layer before the plan reaches the approval queue. Do not allow the model to directly invoke deletion APIs; the application must mediate every tool call.
Expected Output Contract
The model must return a valid JSON object matching this schema. Each field includes a concrete validation rule that can be checked programmatically before the deletion plan is executed.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
deletion_plan_id | string (UUID v4) | Must parse as a valid UUID v4. Reject if empty or malformed. | |
subject_identifier | string | Must match the [SUBJECT_ID] input exactly. Reject on mismatch or truncation. | |
data_stores | array of objects | Array length must be >= 1. Reject if empty or not an array. | |
data_stores[].store_name | string | Must be a non-empty string matching a known tool name from [AVAILABLE_STORES]. Reject unknown store names. | |
data_stores[].primary_records | array of strings | Each entry must be a non-empty record path or ID. Reject if any entry is empty or contains only whitespace. | |
data_stores[].backup_locations | array of strings | If present, each entry must be a non-empty path. Null allowed if no backups exist for that store. | |
data_stores[].derived_datasets | array of strings | If present, each entry must be a non-empty dataset identifier. Null allowed if no derived data exists. | |
data_stores[].verification_method | string (enum) | Must be one of: 'query_confirmation', 'checksum_compare', 'admin_audit_log', 'null_record_check'. Reject unknown values. | |
deletion_timestamp | string (ISO 8601 UTC) | Must parse as a valid ISO 8601 datetime in UTC. Reject if in the future or unparseable. | |
approval_required | boolean | Must be true if any store in data_stores has backup_locations or derived_datasets with length > 0. Reject if false when cascading deletion is implied. |
Common Failure Modes
Right-to-delete enforcement prompts fail in predictable ways when the model misunderstands scope, skips verification, or treats deletion as a single-step operation. These cards cover the most common production failure modes and how to guard against them.
Incomplete Cascade: Missing Backup and Derived Data
What to watch: The model generates a deletion plan that covers primary records but omits database replicas, log streams, analytics warehouses, and materialized views containing the subject's data. This happens when the tool registry is incomplete or the prompt doesn't explicitly enumerate storage tiers. Guardrail: Require the prompt to produce a mandatory inventory step that queries all registered storage tools for data presence before generating the deletion plan. Validate the plan against a known storage topology manifest.
Deletion Confirmation Without Verification
What to watch: The model treats a tool's success response as proof of deletion without requesting evidence such as pre/post record counts, checksum comparisons, or tombstone record verification. Storage systems may return 200 OK while silently retaining data in immutable layers. Guardrail: Add a post-deletion verification step to the prompt contract that requires each tool to return a verifiable confirmation payload (e.g., row count delta, nil query result) before marking the step complete.
Orphan Record Retention in Unregistered Tools
What to watch: The deletion plan only covers tools explicitly listed in the prompt context. Subject data in newly added services, shadow IT storage, or tools registered after prompt authoring is silently retained. Guardrail: Include a dynamic tool discovery step at execution time that queries the live tool registry for all storage-capable tools, not just a static allowlist. Flag any tool that cannot be queried for manual review.
Scope Drift: Over-Deletion Across Tenants or Subjects
What to watch: Ambiguous subject identifiers (e.g., non-unique email, partial name match) cause the deletion plan to target records belonging to other data subjects or shared system records. This is catastrophic in multi-tenant systems. Guardrail: Require exact-match subject resolution using a primary key (e.g., tenant ID + user UUID) before any deletion step. Add a pre-deletion dry-run that returns affected record counts for human approval when counts exceed expected thresholds.
Partial Execution: Silent Failure Mid-Cascade
What to watch: A tool in the middle of the deletion cascade fails (timeout, auth error, rate limit), but the agent continues to subsequent steps or reports overall success. This leaves the subject's data partially deleted across the system. Guardrail: Design the prompt to enforce strict sequential execution with abort-on-failure semantics. Each step must gate the next. On failure, the prompt must produce a partial-execution report identifying exactly which tools succeeded and which require manual remediation.
Log and Audit Trail Contamination
What to watch: The deletion plan removes application data but ignores the fact that the deletion operation itself writes the subject's identifiers into audit logs, access logs, and tool execution traces, creating new records that must themselves be managed. Guardrail: Add a final cleanup step that identifies and redacts subject identifiers from logs generated during the deletion workflow. Validate that the audit trail itself complies with the retention policy for deletion evidence.
Evaluation Rubric
Run these checks against a golden set of deletion scenarios before shipping the Right-to-Delete Enforcement Prompt. Each criterion targets a specific failure mode observed in cascading deletion plans.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Primary Record Coverage | All primary records containing [SUBJECT_ID] across connected storage tools are identified in the deletion plan | Plan omits a known primary record location from the golden test set | Diff the plan's primary record list against the golden set's expected primary record inventory |
Derived Dataset Discovery | All derived datasets, materialized views, and aggregates built from primary records are included as deletion targets | Plan misses a derived dataset that the golden set confirms contains subject data | Check plan against a pre-mapped lineage graph of primary-to-derived dependencies for the test tenant |
Backup and Snapshot Inclusion | All backup systems, snapshots, and replication targets holding the subject's data are listed with deletion or expiration instructions | Plan omits a known backup target or suggests deletion is impossible without a documented reason | Verify backup target coverage against the golden set's infrastructure manifest for the test environment |
Log and Audit Trail Identification | All log streams, audit tables, and observability sinks containing [SUBJECT_ID] are identified with a deletion or masking strategy | Plan ignores log data or claims no logs contain the subject when the golden set includes seeded log entries | Query seeded log entries in the test environment and confirm each log source appears in the plan |
Deletion Verification Step | Each deletion target includes a concrete verification step that confirms record removal before the plan marks the target complete | Plan declares deletion success without describing how removal was confirmed for a target | Parse the plan for each target's verification method; flag any target with a missing or tautological verification step |
Orphan Record Detection | Plan includes a post-deletion scan for orphaned references, foreign key violations, or dangling pointers to the deleted subject | Plan completes without checking for orphan records in a test scenario where the golden set includes a known orphan | Run the plan's orphan detection logic against the golden set's seeded orphan record and confirm it is flagged |
Cascading Order Correctness | Deletion targets are ordered so that dependent records are removed before or alongside their parent records, preventing referential integrity failures | Plan orders a derived dataset deletion before its source primary record deletion, causing a mid-plan integrity error | Topologically sort the plan's target list and verify no target depends on a target scheduled later in the sequence |
Deletion Confirmation Output Schema | Final output includes a structured confirmation record per target with target ID, status, timestamp, and verifier result matching [OUTPUT_SCHEMA] | Output is missing required fields, uses unstructured prose, or omits a target's confirmation entirely | Validate the plan's final output against the [OUTPUT_SCHEMA] JSON Schema; reject on missing required fields or type mismatches |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a single storage tool. Replace the multi-tool cascade with a flat list of known storage locations. Use a simpler output schema with just target_id, target_type, and deletion_status. Skip verification steps and audit trail generation.
codeYou are a data deletion planner. Given a [DATA_SUBJECT_ID] and a single storage tool [TOOL_NAME], produce a list of deletion targets. For each target, return: - target_id: unique identifier of the record - target_type: primary | backup | log | derived - deletion_status: pending | requires_approval Do not execute deletions. Only produce the plan.
Watch for
- Missing backup and log targets when only primary records are listed
- Overly broad deletion scope that includes shared or system records
- No distinction between soft-delete and hard-delete operations
- Silent failures when the tool schema doesn't match the prompt's assumptions

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us