Policy-Based Text Redaction
Given a dataset of records — each with a domain, a set of redaction policies, and a raw text — produce a redacted version of every text that complies with its own policies. The input is a JSON file of records, each with id, domain, policy (bulleted policy…
Runs on Jetty's managed sandbox. No setup. Free for your first 10 runs.
Real runs, real outputs.
10 professional-domain records (healthcare, education, legal)
Clinic emails, a discharge summary, school counselor notes, and privileged legal memos — each redacted against its own policy list. Scored 4.8/5 in a single pass: 5/5 on…
8 support & community records (e-commerce, forum, fintech)
Chat transcripts with card digits, order and tracking numbers, a parenting forum post naming a child's allergy and preschool, a fintech call summary with balances and a…
8 steps · start to finish.
- 1Step 1
Environment Setup
▶# No external packages required — pure Python stdlib (json) is sufficient # Create output directory mkdir -p {{results_dir}}Verify
{{input_file}}exists and is valid JSON before proceeding. If that path is absent, look in/app/assets/— files uploaded through the API are stored as<run_id>.NN.json— and use the single JSON file found there (record the actual path invalidation_report.json). Load it and confirm it parses as a list of records with the expected fields (id,domain,policy,policy_ids,text). - 2Step 2
Parse Input
▶Load {{input_file}} and for each record extract: - id, domain — carry through unchanged to the output - policy — the full bulleted policy text; parse it into individual policy statements (each bullet…
- 3Step 3
Redact Each Record
▶For each record, produce redacted_text by replacing only the spans that violate a stated policy with a marker in the {{redaction_marker}} style (e.g. [REDACTED: PERSON_NAME], [REDACTED: SCHEDULE]…
- 4Step 4
Evaluate Against Rubric
▶For each record, score redacted_text against each criterion on a 1-5 scale, then average across all records to get the overall per-criterion and overall scores.
- 5Step 5
Iterate on Weak Criteria (max 3 rounds)
▶If the rubric score is below the pass threshold:
- 6Step 6
Write Executive Summary
▶Write {{results_dir}}/summary.md with the following structure:
- 7Step 7
Write Validation Report
▶Write {{results_dir}}/validation_report.json. Use exactly this shape — every entry in stages has the keys name (string), passed (JSON boolean, not a status word) and message (string); the dashboard…
- 8Step 8
Final Checklist (MANDATORY — do not skip)
▶echo "=== FINAL OUTPUT VERIFICATION ===" RESULTS_DIR="{{results_dir}}" for f in "$RESULTS_DIR/redacted_dataset.json" "$RESULTS_DIR/summary.md" "$RESULTS_DIR/validation_report.json"; do if [ ! -s "$f"…