General engineering
AuraScore 89/100

Academic Dataset Sanitization and Scrubbing Script

Automate data scrubbing, PII redaction, and schema validation for sensitive academic research datasets.

Use this template when preparing raw experimental, educational, or survey data for public release or multi-institution collaboration. It generates a robust, standalone data sanitization script ensuring strict privacy compliance.

Template

Role: Senior Research Software Engineer specializing in reproducible data pipelines.

Context

  • Raw survey and experimental data format: {{source_data_format}}
  • Explicit direct and indirect identifiers requiring removal: {{pii_fields_to_redact}}
  • Target execution runtime and language: {{target_environment}}
  • Institutional governance and compliance threshold: {{retention_policy_rules}}
  • Volume and record batch size: {{dataset_size_scale}}
  • Quality assurance and statistical integrity standards: {{validation_criteria}}

Task

Construct a standalone, idempotent data sanitization and anonymization script that ingests raw participant records, strips restricted attributes according to research governance standards, and outputs clean analytical datasets ready for peer-reviewed distribution.

Method

  1. Parse input flags and configure stream buffers for {{dataset_size_scale}} processing.
  2. Inspect record schemas to verify structural compatibility with {{source_data_format}}.
  3. Apply deterministic hashing or zeroing functions to all targets identified in {{pii_fields_to_redact}}.
  4. Implement pseudo-identifier generalization aligned with {{retention_policy_rules}} without distorting variance.
  5. Execute pre-write validation checks against {{validation_criteria}} to guarantee schema completeness.
  6. Generate an immutable cryptographic manifest containing input hashes and output record counts.
  7. Write sanitized records safely to target destination using atomic write operations.

Constraints

  • MUST implement zero-dependency standard libraries where feasible in {{target_environment}}.
  • MUST NOT log or expose plaintext entries from {{pii_fields_to_redact}} in stdout, stderr, or debug logs.
  • Include structured error handling with non-zero exit codes on integrity failure.
  • The script must be fully self-contained and ready to execute via CLI.

Output format

Provide the response in two distinct sections:

  1. Executable Script: Clean, fully commented script code with robust CLI parameter handling.
  2. Operational Runbook: Markdown block detailing installation, execution syntax, exit codes, and verify instructions (maximum 200 words).

Self-review

  • Verify every variable from {{source_data_format}} to {{validation_criteria}} is explicitly referenced.
  • Check that no PII leakage paths exist in error stack traces or verbose logging flags.
  • Confirm all code syntax is syntactically valid for {{target_environment}}.
AuraScore breakdown
89/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification14/14 · Strong

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency7/10 · Adequate

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-general
research-productivity-operations
research
data-engineering
anonymization