This prompt is for data platform engineers and architects who need to design a defensible, tiered data retention and archival strategy for a specific table or dataset. It takes a schema, access patterns, and regulatory requirements as input and outputs a structured plan covering hot/warm/cold storage tiers, retention periods, archival triggers, retrieval SLAs, and compliance alignment. Use this prompt before implementing lifecycle policies in your database, data warehouse, or object store. It is not a replacement for legal review of regulatory requirements, but it ensures the technical plan accounts for the regulations you specify.
Prompt
Data Retention and Archival Strategy Prompt

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and boundaries for the Data Retention and Archival Strategy Prompt.
The ideal user brings a concrete dataset definition—table schema, current volume, growth rate, and known access patterns—along with the specific regulatory frameworks that apply (GDPR, HIPAA, SOC 2, PCI DSS, or internal data governance policies). The prompt works best when you can articulate who queries this data, how fresh it must be, and what the cost of retrieval latency actually is. Do not use this prompt for abstract 'best practices' generation without a real table; it will produce generic advice that fails under production constraints. Do not use it as a substitute for legal or compliance review—the prompt will map technical controls to regulations you name, but it cannot interpret novel regulatory obligations or assess your organization's specific legal exposure.
Before running this prompt, gather the table DDL, a representative sample of query patterns (with frequencies and latency requirements), and the exact regulatory clauses or internal policy documents that govern retention. If you lack any of these inputs, the output will contain placeholders and assumptions that must be validated before implementation. After receiving the strategy, treat it as an engineering proposal: review the tier assignments against actual query logs, validate the archival trigger conditions with a dry run on non-production data, and have your compliance team confirm that the retention periods satisfy all applicable obligations. The next section provides the copy-ready prompt template you can adapt with your specific inputs.
Use Case Fit
Where the Data Retention and Archival Strategy Prompt delivers value and where it introduces unacceptable risk. Use these cards to decide whether this prompt fits your current context before investing in integration.
Good Fit: Greenfield Retention Policy Design
Use when: You are designing retention rules for a new dataset or table and need a structured starting point aligned with common regulatory frameworks. Guardrail: Always require a human reviewer to confirm the generated policy against your specific jurisdictional requirements before implementation.
Bad Fit: Real-Time Deletion Execution
Avoid when: You need the model to execute or schedule actual data deletion jobs. The prompt generates a strategy document, not executable infrastructure code. Guardrail: Route the approved strategy output to a separate, tested, and audited data lifecycle management tool or script; never let the model trigger destructive operations directly.
Required Input: Complete Data Classification
Risk: Without clear input on data sensitivity, PII presence, and business criticality, the generated tiers will be generic and potentially non-compliant. Guardrail: The prompt harness must validate that classification metadata (e.g., 'PII: true', 'Criticality: High') is provided for each table before generating a strategy; otherwise, abort and request missing inputs.
Operational Risk: Stale Compliance Assumptions
Risk: The model may generate retention periods based on outdated or hallucinated regulations (e.g., inventing a GDPR article number). Guardrail: Post-generation, run a validation step that checks all cited regulations against a trusted, up-to-date internal knowledge base. Flag any citation not found in the source of truth for human review.
Bad Fit: Single-Table Analysis Without Dependencies
Avoid when: You need a holistic strategy across interdependent tables with foreign key relationships. Analyzing one table in isolation can recommend conflicting archival triggers. Guardrail: For related datasets, batch the inputs and add a system instruction to check for cross-table consistency in archival timing and referential integrity before finalizing the plan.
Good Fit: Audit Evidence Generation
Use when: You need to produce a documented rationale for why specific retention periods were chosen, linking business needs to compliance requirements. Guardrail: The output must include a dedicated 'Compliance Mapping' section that explicitly ties each retention rule to a specific regulatory article or business policy, making the reasoning auditable.
Copy-Ready Prompt Template
A copy-ready prompt that generates a structured, tiered data retention and archival strategy from a dataset specification, designed for direct validation and ingestion by downstream automation.
This prompt template is the core engine for generating a data retention and archival strategy. It is designed to be copied directly into your AI harness, where you will replace the square-bracket placeholders with your specific dataset context. The prompt instructs the model to act as a data platform architect and produce a strictly structured JSON output. This output is not just a text document; it's a machine-readable specification that can be automatically validated against your compliance requirements and ingested by a data lifecycle management tool.
textYou are a data platform architect. Your task is to design a tiered data retention and archival strategy for the dataset described below. You must produce a single, valid JSON object as your entire output, conforming to the [OUTPUT_SCHEMA] provided. Do not include any explanatory text outside the JSON object. **Dataset Context:** [CONTEXT] **Output Schema:** [OUTPUT_SCHEMA] **Constraints:** [CONSTRAINTS] **Examples for Reference:** [EXAMPLES] **Risk Level and Review Requirements:** [RISK_LEVEL]
To adapt this template, start by populating the [CONTEXT] placeholder with a detailed description of the dataset. This should include the table or dataset name, a description of its contents, its current storage technology (e.g., PostgreSQL, S3), its approximate size, and its primary access patterns. Next, define the [OUTPUT_SCHEMA] as a strict JSON schema. This schema is your contract; it should specify the exact structure for each storage tier (e.g., hot, warm, cold, archive), including fields for tier_name, storage_medium, retention_period, archival_trigger, retrieval_sla, and compliance_rationale. The [CONSTRAINTS] placeholder is where you inject non-negotiable business rules, such as "All PII must be anonymized after 365 days" or "Financial records must be retained for 7 years per regulation XYZ." Use the [EXAMPLES] section to provide one or two correct input-output pairs, which is the most effective way to teach the model the desired level of detail and tone. Finally, set the [RISK_LEVEL] to high if the data is subject to legal hold or strict compliance, which will trigger a note in the prompt for mandatory human review of the final plan.
Before integrating this prompt into a production pipeline, you must test it with several known datasets and constraints. Validate the output JSON against your schema to catch structural errors. More importantly, conduct an evaluation where a domain expert checks if the generated compliance_rationale correctly interprets the regulatory constraints you provided. A common failure mode is the model inventing plausible-sounding but incorrect legal justifications. Always treat the generated plan as a sophisticated first draft that requires human approval, especially for high-risk datasets. The next step is to wire this prompt into an application harness that can automatically validate the JSON output and flag plans for review before any changes are applied to a production database.
Prompt Variables
Each placeholder must be replaced with concrete, accurate data. Incomplete or incorrect inputs will produce a strategy that fails compliance review.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DATASET_IDENTIFIER] | Uniquely identifies the table, collection, or dataset under review. |
| Must resolve to a single schema object. Validate against the data catalog or |
[DATA_CLASSIFICATION_TIER] | The internal sensitivity or criticality label for the data. |
| Must match an approved tier from the organization's data classification policy. Reject free-text values. |
[APPLICABLE_REGULATIONS] | A list of specific regulatory frameworks that govern retention and deletion. |
| Parse as a JSON array of strings. Each string must match a known regulation slug in the compliance registry. Null allowed if no external regulations apply. |
[ACCESS_PATTERNS] | Describes how the data is queried over time, including hot, warm, and cold periods. |
| Must be a structured string or JSON object defining time windows and access types. Validate that windows are non-overlapping and sequential. |
[STORAGE_BACKENDS_AVAILABLE] | A list of available storage tiers and their capabilities. |
| Parse as a JSON array of strings. Each string must match a pre-registered storage backend ID. Reject unknown backends to prevent hallucinated capabilities. |
[RETRIEVAL_SLA_TARGET] | The maximum acceptable time to retrieve archived data. |
| Must be a human-readable duration string. Validate against a regex for time units. Required for any archival tier. |
[BUSINESS_OWNER] | The accountable person or team for the data lifecycle. |
| Must be a valid email address or team identifier string. Used for approval routing in the harness, not just documentation. |
Implementation Harness Notes
How to wire the Data Retention and Archival Strategy Prompt into a reliable, repeatable application workflow with validation, logging, and compliance checks.
This prompt is designed to be integrated into a data platform governance pipeline, not used as a one-off chat interaction. The harness should treat the prompt as a deterministic policy engine that consumes structured metadata about a dataset and returns a machine-readable strategy. The primary integration points are a data catalog (for table metadata), a compliance registry (for regulatory requirements), and a storage tier configuration service (for target tier definitions). The harness must validate that all required inputs are present before invocation, because missing data volume statistics or undefined compliance obligations will produce a strategy that looks plausible but is operationally unsafe.
The implementation should wrap the prompt in a service function that first assembles the context from upstream systems: query the data catalog for table size, row counts, partition columns, and access patterns; query the compliance registry for applicable regulations and their retention minimums/maximums; and load the organization's defined storage tiers with their cost, latency, and durability properties. The prompt is then called with these structured inputs. The output must be parsed as JSON and validated against a strict schema that includes required fields for each tier assignment, retention period, archival trigger condition, and retrieval SLA. Any output that fails schema validation should trigger a retry with the validation errors injected into the [CONSTRAINTS] block, up to a maximum of two retries before escalating for human review.
For high-risk datasets containing PII, financial records, or healthcare data, the harness must enforce a human-in-the-loop approval gate. After successful schema validation, the generated strategy should be written to a pending-review state in the data catalog and flagged for approval by the data governance team. The approval UI should display the prompt's inputs, the generated strategy, and a diff against any existing retention policy. Only after approval should the strategy be applied to the storage tier configuration and the archival job scheduler. Log every invocation with the input context hash, output strategy, validation results, retry count, and reviewer identity to create an audit trail that satisfies SOC 2 and GDPR accountability requirements.
Model choice matters for consistency. Use a model with strong JSON mode and low temperature (0.1-0.2) to reduce variance in retention period calculations. Avoid models that tend to hallucinate regulatory citations; the prompt already provides the applicable regulations in the [COMPLIANCE_REQUIREMENTS] input, so the model should not be asked to recall legal requirements from training data. If the prompt is used in a RAG configuration, ground the compliance requirements in a vector store of internal policy documents rather than relying on the model's parametric knowledge. The harness should also include a periodic reconciliation job that compares applied retention policies against the latest compliance registry and flags any drift for re-evaluation.
Expected Output Contract
The JSON fields the prompt must return, their types, and validation rules for automated checking. Use this contract to validate the model's output before it enters downstream workflows.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
retention_plan | Array of objects | Schema check: array length >= 1. Each object must contain tier_name, storage_medium, retention_period, and archival_trigger fields. | |
tier_name | String | Enum check: value must be one of [HOT, WARM, COLD, ARCHIVE, PURGE]. Case-insensitive match allowed. | |
storage_medium | String | Non-empty string. Must reference a concrete storage technology (e.g., 'PostgreSQL', 'S3 Standard', 'Glacier Deep Archive'). Generic terms like 'cloud' or 'disk' fail validation. | |
retention_period | String | Format check: must match ISO 8601 duration pattern (e.g., 'P30D', 'P1Y', 'P7Y'). Null or empty string fails. Must be parseable by a standard duration library. | |
archival_trigger | String | Non-empty string describing the condition that moves data to this tier. Must contain a time-based or event-based predicate (e.g., 'After 90 days of no access', 'When status = CLOSED'). Vague triggers like 'when needed' fail. | |
retrieval_sla | String | Format check: must match pattern 'PT<digits><H|M>' (e.g., 'PT15M', 'PT4H'). Null allowed only for PURGE tier. Values exceeding 72 hours require a compliance_note in the parent object. | |
compliance_alignment | Array of strings | Schema check: array length >= 0. Each string must reference a specific regulation or policy by identifier (e.g., 'GDPR Art.17', 'SOC2 DS-3', 'HIPAA 164.310'). Generic references like 'privacy laws' fail. Empty array allowed only if no regulations apply and a justification_note is present. | |
data_classification | String | Enum check: value must be one of [PUBLIC, INTERNAL, CONFIDENTIAL, RESTRICTED, PII, PHI, PCI]. Case-insensitive match allowed. Mismatch with compliance_alignment entries triggers a review flag. |
Common Failure Modes
What breaks first when using a Data Retention and Archival Strategy Prompt in production, and how to guard against it.
Regulatory Obligation Omission
What to watch: The model proposes a retention period that violates a jurisdiction-specific regulation (e.g., GDPR, HIPAA, FINRA) because the regulation was not explicitly listed in the prompt's [COMPLIANCE_STANDARDS] input. Guardrail: Maintain a mandatory, hard-coded checklist of applicable regulations in the harness. Validate the output's retention periods against this checklist programmatically before accepting the plan.
Ambiguous Retrieval SLAs
What to watch: The model generates vague retrieval targets like 'fast' or 'reasonable' instead of concrete SLAs (e.g., 'hot data: <50ms, cold data: <4 hours'). This makes the archival plan non-actionable for engineering. Guardrail: Require a strict [OUTPUT_SCHEMA] with non-negotiable fields for retrieval latency in milliseconds or seconds per tier. Use a post-generation validator to reject any plan with missing or non-numeric SLA values.
Ignoring Data Dependencies
What to watch: The strategy isolates a single table for archival without considering foreign key relationships, downstream views, or application joins. Archiving the table breaks dependent queries and ETL pipelines. Guardrail: The prompt must require a [DATA_LINEAGE] input that maps dependencies. Add an eval step that checks if the proposed archival plan explicitly addresses each dependent object.
Unenforceable Archival Triggers
What to watch: The model suggests triggers based on business logic (e.g., 'archive when user is inactive') that cannot be implemented without application-level changes, creating a gap between the strategy and execution. Guardrail: Constrain the prompt to accept only [TRIGGER_TYPES] that are available in the target data infrastructure (e.g., time-based partition expiry, row age). Validate that every trigger in the output maps to an allowed type.
Cost Projection Hallucination
What to watch: The model fabricates storage cost estimates for archival tiers without access to real cloud pricing or internal cost data, leading to inaccurate TCO analysis. Guardrail: Do not ask the model to generate costs. Instead, have the prompt output a structured [STORAGE_VOLUME_ESTIMATE] per tier. Pipe this estimate into a separate, deterministic cost calculation function in the application harness.
Missing Data Destruction Protocol
What to watch: The strategy defines when data moves to an archive but fails to specify a secure destruction policy for when the final retention period expires, creating a compliance and security risk. Guardrail: Add a mandatory [DESTRUCTION_CERTIFICATION] section to the output schema. The harness must reject any plan that does not include a verifiable destruction method (e.g., cryptographic erasure) and a compliance sign-off step.
Evaluation Rubric
Score each criterion on a pass/fail basis. A production-ready Data Retention and Archival Strategy Prompt must pass all criteria before deployment.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Regulatory Coverage | Output references all applicable regulations from [REGULATORY_FRAMEWORKS] input and maps each to at least one retention rule | Missing regulation reference or retention rule with no regulatory justification | Parse output for regulation names; verify each framework in input appears in output with associated retention period |
Tier Completeness | Output defines at least 3 storage tiers (hot, warm, cold, archive, purge) with distinct retention periods, access latency, and cost profiles | Fewer than 3 tiers defined or tiers missing retention period, latency, or cost dimension | Count distinct tier names; check each tier object has non-null values for retention_period, access_latency, and cost_profile fields |
Archival Trigger Logic | Each tier transition includes a concrete trigger condition using time-based, event-based, or hybrid criteria with explicit threshold values | Trigger described as vague policy without specific threshold or condition expression | Validate trigger field contains comparison operator or time expression; reject triggers containing only 'when appropriate' or 'as needed' |
Retrieval SLA Specification | Output specifies retrieval time objective for each archival tier in concrete units (minutes, hours, days) with confidence level | Retrieval SLA missing, expressed as 'best effort', or using undefined time units | Parse retrieval_sla field per tier; confirm numeric value with time unit; reject null, 'N/A', or qualitative-only descriptions |
Compliance Alignment Mapping | Each retention rule maps to a specific compliance requirement with citation to regulation section or policy clause | Retention rule stated without compliance citation or citation references nonexistent regulation | Cross-reference retention rules against [REGULATORY_FRAMEWORKS]; verify each rule has citation field matching an input framework |
Data Classification Handling | Output applies different retention rules based on [DATA_CLASSIFICATION] levels provided in input | Same retention period applied across all classification levels when input specifies multiple levels | Group retention rules by classification; verify distinct retention periods exist for each classification level in input |
Purge and Destruction Procedure | Output includes verifiable destruction method, timing, and certification requirement for data reaching end of retention | Purge described as 'delete' without method, verification step, or destruction certification | Check purge section for method field, verification field, and certification_required boolean; all must be present and non-null |
Exception Handling Rules | Output defines legal hold, investigation hold, and data subject request override procedures with escalation path | No exception handling section or exceptions described without concrete procedure steps | Search output for legal_hold, investigation_hold, and data_subject_request keys; verify each contains procedure array with at least one step |
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
Use the base prompt with a single table and a simplified compliance requirement. Drop the strict output schema and ask for a narrative recommendation first. Replace [REGULATORY_FRAMEWORKS] with a single framework like "GDPR" and set [RETRIEVAL_SLA_TARGET] to a single tier. This lets you validate the model's reasoning about hot/warm/cold placement before adding schema enforcement.
Prompt snippet
codeYou are a data architect. Given the table [TABLE_NAME] with schema [SCHEMA_DEFINITION] and access pattern [ACCESS_PATTERN_SUMMARY], propose a tiered storage strategy with retention periods. Consider only [SINGLE_REGULATION] as the compliance requirement. Output as a markdown plan.
Watch for
- The model inventing retention periods not present in the regulation
- Overly aggressive archival recommendations that ignore query access patterns
- Missing retrieval SLA discussion entirely

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