Set up an OpenMed de-identification policy
Use this skill before a de-identification pipeline when the privacy decisions
are not already recorded. It creates a small policy document; it does not
inspect, transform, upload, or retain clinical data. The setup is local-first,
deterministic, and has no mandatory network call.
The output is a draft configuration contract, not a compliance certification,
legal opinion, or guarantee of de-identification. A human must review and
approve the draft before it controls a run.
When to use this skill
Use it when a project needs to turn implicit privacy choices into a reviewable
DEID-POLICY.md file. Use the focused de-identification skills afterward to
apply or audit the selected policy.
Do not use this skill to collect a note, dataset row, identifier, model output,
secret, credential, or any other source payload. The setup questions accept
policy choices only. Keep logs, exceptions, reports, and fixtures free of raw
sensitive values.
Bounded decision contract
Collect these five decisions, one at a time. Do not invent a sixth field or
silently choose a value. The value written to the artifact must be the
lowercase canonical value in the right-hand column.
| Decision |
Bounded choices (canonical value) |
| Jurisdiction or operating context |
us, eu, canada, research, organization-defined |
| Recall floor |
0.90, 0.95, 0.99 |
| Surrogate strategy |
mask, remove, replace, hash |
| Model policy |
local-preinstalled, local-user-supplied, rules-only |
| Audit location |
separate-local-directory, controlled-artifact-store, no-retention |
The jurisdiction choices are context labels, not findings that a law applies.
For example, us may be used for a US/HIPAA-context workflow and eu for an
EU/GDPR-context workflow, but the generated document must not claim that the
workflow is compliant. research and organization-defined require the
project's own governance review.
The recall floor is a release target, not an observed score. Do not write a
metric, benchmark result, dataset name, or model claim into this artifact.
replace must use deterministic, synthetic surrogates when it is later
implemented; any re-identification mapping remains a separately protected
secret. hash is one-way for this policy document, but hashes can still be
sensitive linkage material.
Setup workflow
Follow this order exactly:
Explain that the result is a draft configuration and that human approval is
required. Ask only for the five decisions in the table.
Normalize each answer for comparison by trimming surrounding whitespace,
folding case, and treating spaces or underscores as hyphens. Match the
normalized answer against the bounded choices exactly. Do not accept a
free-form value, and do not infer a jurisdiction from prose.
If an answer is missing or invalid, stop before writing the artifact. Report
only the field name and the allowed canonical choices; never echo the
answer, a source value, or exception text.
Read the local DEID-POLICY.template.md
and replace only its five decision placeholders:
{{ jurisdiction }}
{{ recall_floor }}
{{ surrogate_strategy }}
{{ model_policy }}
{{ audit_location }}
Before substitution, require Template version: 1.0, Policy schema: 1,
and exactly one occurrence of each listed placeholder with no other
placeholder. If that contract differs, stop before writing and report only
that the template contract is invalid. Preserve the template version,
section order, checkboxes, and line endings. Do not add a timestamp, random
identifier, machine path, user identity, source text, detected span, model
output, or free-form rationale.
Resolve the user-requested project directory and require it to be an
existing local directory. The output target is exactly its direct child
DEID-POLICY.md; do not accept a different filename or derive one from an
answer. Refuse a symlink or any existing non-regular target. If a regular
file already exists, ask for explicit permission before replacing it; never
overwrite it implicitly or write through a symlink. Render to a uniquely
created sibling temporary file, flush and sync its bytes, recheck the
resolved parent and target immediately before replacement, and atomically
replace the target. If the target appeared after the first check and no
replacement was approved, stop. Clean up the temporary file on every
failure.
Report only that DEID-POLICY.md was written in the requested project
directory and that review is pending. Never print the absolute or parent
directory path, the collected answers, a source payload, or exception text.
The same five canonical choices and the same template version must produce
byte-for-byte identical output. Do not use the current time, environment
variables, network responses, or machine-specific paths in the artifact.
Local-only model rule
This setup does not download a model or call a hosted service. With
local-preinstalled, stop and ask the project owner to install or provide the
approved local model if it is absent. With local-user-supplied, record no
secret or personal path in DEID-POLICY.md; the caller supplies the model
outside the artifact. rules-only must remain deterministic and local. A
later pipeline may have its own explicitly approved setup step, but it is not
part of this skill and must never be mandatory here.
Human approval gate
The template always writes DRAFT — HUMAN APPROVAL REQUIRED. Stop after the
draft is written. A human reviewer must inspect the five choices, verify that
the intended local model and audit handling exist, and explicitly change the
status to approved through the project's review process. The setup workflow
must not self-approve, sign, certify, or claim a regulatory outcome.
Handoff
Those skills inherit this artifact's guardrails. Keep any audit report limited
to offsets, hashes, provenance, counts, and risk summaries; never put raw
identifiers into logs, exceptions, reports, fixtures, or the policy file.
1---2name: setup-openmed3description: Collect a bounded set of de-identification policy decisions and write a deterministic, reviewable DEID-POLICY.md from the versioned local template. Use when a project needs explicit jurisdiction, recall floor, surrogate strategy, model policy, audit location, and human approval before privacy work begins.4license: Apache-2.05---67# Set up an OpenMed de-identification policy89Use this skill before a de-identification pipeline when the privacy decisions10are not already recorded. It creates a small policy document; it does not11inspect, transform, upload, or retain clinical data. The setup is local-first,12deterministic, and has **no mandatory network call**.1314The output is a draft configuration contract, not a compliance certification,15legal opinion, or guarantee of de-identification. A human must review and16approve the draft before it controls a run.1718## When to use this skill1920Use it when a project needs to turn implicit privacy choices into a reviewable21`DEID-POLICY.md` file. Use the focused de-identification skills afterward to22apply or audit the selected policy.2324Do not use this skill to collect a note, dataset row, identifier, model output,25secret, credential, or any other source payload. The setup questions accept26policy choices only. Keep logs, exceptions, reports, and fixtures free of raw27sensitive values.2829## Bounded decision contract3031Collect these five decisions, one at a time. Do not invent a sixth field or32silently choose a value. The value written to the artifact must be the33lowercase canonical value in the right-hand column.3435| Decision | Bounded choices (canonical value) |36| --- | --- |37| Jurisdiction or operating context | `us`, `eu`, `canada`, `research`, `organization-defined` |38| Recall floor | `0.90`, `0.95`, `0.99` |39| Surrogate strategy | `mask`, `remove`, `replace`, `hash` |40| Model policy | `local-preinstalled`, `local-user-supplied`, `rules-only` |41| Audit location | `separate-local-directory`, `controlled-artifact-store`, `no-retention` |4243The jurisdiction choices are context labels, not findings that a law applies.44For example, `us` may be used for a US/HIPAA-context workflow and `eu` for an45EU/GDPR-context workflow, but the generated document must not claim that the46workflow is compliant. `research` and `organization-defined` require the47project's own governance review.4849The recall floor is a release target, not an observed score. Do not write a50metric, benchmark result, dataset name, or model claim into this artifact.51`replace` must use deterministic, synthetic surrogates when it is later52implemented; any re-identification mapping remains a separately protected53secret. `hash` is one-way for this policy document, but hashes can still be54sensitive linkage material.5556## Setup workflow5758Follow this order exactly:59601. Explain that the result is a draft configuration and that human approval is61 required. Ask only for the five decisions in the table.622. Normalize each answer for comparison by trimming surrounding whitespace,63 folding case, and treating spaces or underscores as hyphens. Match the64 normalized answer against the bounded choices exactly. Do not accept a65 free-form value, and do not infer a jurisdiction from prose.663. If an answer is missing or invalid, stop before writing the artifact. Report67 only the field name and the allowed canonical choices; never echo the68 answer, a source value, or exception text.694. Read the local [DEID-POLICY.template.md](assets/DEID-POLICY.template.md)70 and replace only its five decision placeholders:7172 - `{{ jurisdiction }}`73 - `{{ recall_floor }}`74 - `{{ surrogate_strategy }}`75 - `{{ model_policy }}`76 - `{{ audit_location }}`7778 Before substitution, require `Template version: 1.0`, `Policy schema: 1`,79 and exactly one occurrence of each listed placeholder with no other80 placeholder. If that contract differs, stop before writing and report only81 that the template contract is invalid. Preserve the template version,82 section order, checkboxes, and line endings. Do not add a timestamp, random83 identifier, machine path, user identity, source text, detected span, model84 output, or free-form rationale.855. Resolve the user-requested project directory and require it to be an86 existing local directory. The output target is exactly its direct child87 `DEID-POLICY.md`; do not accept a different filename or derive one from an88 answer. Refuse a symlink or any existing non-regular target. If a regular89 file already exists, ask for explicit permission before replacing it; never90 overwrite it implicitly or write through a symlink. Render to a uniquely91 created sibling temporary file, flush and sync its bytes, recheck the92 resolved parent and target immediately before replacement, and atomically93 replace the target. If the target appeared after the first check and no94 replacement was approved, stop. Clean up the temporary file on every95 failure.966. Report only that `DEID-POLICY.md` was written in the requested project97 directory and that review is pending. Never print the absolute or parent98 directory path, the collected answers, a source payload, or exception text.99100The same five canonical choices and the same template version must produce101byte-for-byte identical output. Do not use the current time, environment102variables, network responses, or machine-specific paths in the artifact.103104## Local-only model rule105106This setup does not download a model or call a hosted service. With107`local-preinstalled`, stop and ask the project owner to install or provide the108approved local model if it is absent. With `local-user-supplied`, record no109secret or personal path in `DEID-POLICY.md`; the caller supplies the model110outside the artifact. `rules-only` must remain deterministic and local. A111later pipeline may have its own explicitly approved setup step, but it is not112part of this skill and must never be mandatory here.113114## Human approval gate115116The template always writes `DRAFT — HUMAN APPROVAL REQUIRED`. Stop after the117draft is written. A human reviewer must inspect the five choices, verify that118the intended local model and audit handling exist, and explicitly change the119status to approved through the project's review process. The setup workflow120must not self-approve, sign, certify, or claim a regulatory outcome.121122## Handoff123124- Apply the selected profile with125 [`configuring-privacy-policies`](../configuring-privacy-policies/SKILL.md).126- Transform text with127 [`deidentifying-clinical-text`](../deidentifying-clinical-text/SKILL.md).128- Check coverage with129 [`auditing-deidentification-runs`](../auditing-deidentification-runs/SKILL.md).130131Those skills inherit this artifact's guardrails. Keep any audit report limited132to offsets, hashes, provenance, counts, and risk summaries; never put raw133identifiers into logs, exceptions, reports, fixtures, or the policy file.