Skill Tracer
Skills › Scientific Agent Skills › treatment-plans › security_validation.md

security_validation.md

82 lines · skills/treatment-plans/references/security_validation.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Security Validation Record
2
3Historical validation date: **2026-07-23**. Current local review: **2026-10-01**.
4

Security Validation Record

Historical validation date: 2026-07-23. Current local review: 2026-10-01.

Raw lines 1 to 4
5## Current refresh
6
7- Read all six JSON templates, eight helpers, and all references. Kept the documentation-only scope and schema version `2.0`; bumped skill metadata to `2.4`.
8- Refreshed official-source content, dates, redirects, and program applicability; see `source_ledger.md`. HTTP success alone was not treated as source validation.
9- Fixed malformed enum collections, deeply nested JSON and oversized integer parser failures, whitespace-only required strings, unknown-key/document-type leakage into reports, and broader-than-documented timestamp/date-filter acceptance.
10- Schedule generation now rejects cross-record inconsistencies before extracting dates. It preserves local calendar dates, not a converted timezone.
11- Replaced overwrite-capable publication with hard-link publication; a competing destination is preserved and temporary files are cleaned. Unsupported filesystems fail. A package is still not a transaction, and local-path checks are not a filesystem sandbox.
12- Replaced the misleading readiness output with `documentation_declarations_complete` and explicit `handoff_authorized_by_script: false`.
13- Agent Skills validator: **PASS**. Isolated Python 3.13.3 suite: **29 passed**. Standard-library CLI smoke: **20 invocations passed**, including all seven help paths, deliberately incomplete templates, complete synthetic records, existing-output refusal, malformed enum input, and strict filters. **8 scripts parsed**; generated schedule contained exactly **7 supplied-date events**; local POSIX output modes checked.
14- No patient data, clinical judgment, signature authentication, licensure, de-identification, live EHR integration, external reporting, Windows ACL behavior, or clinical validity was tested. Six JSON templates require no LaTeX/PDF compilation.
15- The aggregate repository security scan is coordinated separately. The scanner results below describe the historical July redesign, not a fresh scan of version 2.4.

Current refresh

  • Read all six JSON templates, eight helpers, and all references. Kept the documentation-only scope and schema version 2.0; bumped skill metadata to 2.4.
  • Refreshed official-source content, dates, redirects, and program applicability; see source_ledger.md. HTTP success alone was not treated as source validation.
  • Fixed malformed enum collections, deeply nested JSON and oversized integer parser failures, whitespace-only required strings, unknown-key/document-type leakage into reports, and broader-than-documented timestamp/date-filter acceptance.
  • Schedule generation now rejects cross-record inconsistencies before extracting dates. It preserves local calendar dates, not a converted timezone.
  • Replaced overwrite-capable publication with hard-link publication; a competing destination is preserved and temporary files are cleaned. Unsupported filesystems fail. A package is still not a transaction, and local-path checks are not a filesystem sandbox.
  • Replaced the misleading readiness output with documentation_declarations_complete and explicit handoff_authorized_by_script: false.
  • Agent Skills validator: PASS. Isolated Python 3.13.3 suite: 29 passed. Standard-library CLI smoke: 20 invocations passed, including all seven help paths, deliberately incomplete templates, complete synthetic records, existing-output refusal, malformed enum input, and strict filters. 8 scripts parsed; generated schedule contained exactly 7 supplied-date events; local POSIX output modes checked.
  • No patient data, clinical judgment, signature authentication, licensure, de-identification, live EHR integration, external reporting, Windows ACL behavior, or clinical validity was tested. Six JSON templates require no LaTeX/PDF compilation.
  • The aggregate repository security scan is coordinated separately. The scanner results below describe the historical July redesign, not a fresh scan of version 2.4.
Raw lines 5 to 16
17## Historical redesign evidence

Historical redesign evidence

Raw lines 17 to 18
19## Baseline
21The repository `SECURITY.md` entry recorded **11 findings** with maximum severity **CRITICAL**:
23- three CRITICAL cross-file/environment/network exfiltration findings;
24- one HIGH API-key transmission finding;
25- five MEDIUM findings involving environment harvesting, command chaining, and mandatory external-tool behavior;
26- two LOW findings involving unsafe template content and unpinned dependencies.
28The affected files included the former `generate_schematic.py`, `generate_schematic_ai.py`, `SKILL.md`, and `medical_treatment_plan.sty`.

Baseline

The repository SECURITY.md entry recorded 11 findings with maximum severity CRITICAL:

  • three CRITICAL cross-file/environment/network exfiltration findings;
  • one HIGH API-key transmission finding;
  • five MEDIUM findings involving environment harvesting, command chaining, and mandatory external-tool behavior;
  • two LOW findings involving unsafe template content and unpinned dependencies.

The affected files included the former generate_schematic.py, generate_schematic_ai.py, SKILL.md, and medical_treatment_plan.sty.

Raw lines 19 to 29
30## Remediation
32- Deleted both schematic-generation scripts.
33- Removed network requests, API keys, environment access, `.env` loading, subprocesses, external models, image generation, and cross-skill calls.
34- Deleted the hardcoded LaTeX style and all specialty templates containing clinical treatment content.
35- Replaced them with generic, fail-closed JSON records.
36- Rebuilt every remaining script as a dependency-free, bounded, deterministic local JSON helper.
37- Added strict duplicate-key, schema, unknown-field, collection, depth, path, symlink, and output controls.
38- Added minimized reports that do not echo clinician-authored content.
39- Added AST tests prohibiting network libraries, dynamic execution, executable serialization, subprocesses, and environment access.

Remediation

  • Deleted both schematic-generation scripts.
  • Removed network requests, API keys, environment access, .env loading, subprocesses, external models, image generation, and cross-skill calls.
  • Deleted the hardcoded LaTeX style and all specialty templates containing clinical treatment content.
  • Replaced them with generic, fail-closed JSON records.
  • Rebuilt every remaining script as a dependency-free, bounded, deterministic local JSON helper.
  • Added strict duplicate-key, schema, unknown-field, collection, depth, path, symlink, and output controls.
  • Added minimized reports that do not echo clinician-authored content.
  • Added AST tests prohibiting network libraries, dynamic execution, executable serialization, subprocesses, and environment access.
Raw lines 30 to 40
41## Historical validation results
43- Agent Skills reference validator: **PASS**
44- Dependency-free CLI help checks: **PASS**
45- Synthetic standard-library tests: **21 passed**
46- Explicit AST parse with bytecode disabled: **8 scripts parsed**
47- Bytecode artifacts after cleanup: **0**
48- IDE lints: **0**
49- Documented local-path check: **PASS**
50- External source links: **PASS** (HTTP 403 from HHS/AHRQ is access control; REMS@FDA returned HTTP 200 with a browser user agent)
51- Direct behavioral security scan: **SAFE, 0 findings**
52- Pull-request gate with `--fail-on HIGH`: **PASS**
53 - CRITICAL: 0
54 - HIGH: 0
55 - LOW: 2
57The first direct scan reported a CRITICAL test-only false positive because the synthetic AST test contained literal names for dynamic-execution functions and used a subprocess to exercise `--help`. The help test was changed to call each parser directly and the prohibited names were constructed without executable references. The final direct scan is clean.

Historical validation results

  • Agent Skills reference validator: PASS
  • Dependency-free CLI help checks: PASS
  • Synthetic standard-library tests: 21 passed
  • Explicit AST parse with bytecode disabled: 8 scripts parsed
  • Bytecode artifacts after cleanup: 0
  • IDE lints: 0
  • Documented local-path check: PASS
  • External source links: PASS (HTTP 403 from HHS/AHRQ is access control; REMS@FDA returned HTTP 200 with a browser user agent)
  • Direct behavioral security scan: SAFE, 0 findings
  • Pull-request gate with --fail-on HIGH: PASS
  • CRITICAL: 0
  • HIGH: 0
  • LOW: 2

The first direct scan reported a CRITICAL test-only false positive because the synthetic AST test contained literal names for dynamic-execution functions and used a subprocess to exercise --help. The help test was changed to call each parser directly and the prohibited names were constructed without executable references. The final direct scan is clean.

Raw lines 41 to 58
59## Historical residual LOW findings
61The LLM-assisted pull-request scan reported:
631. **Missing `allowed-tools` declaration** — informational. The field is optional. The compatibility statement and body explicitly limit bundled tools to local standard-library JSON processing, and the direct behavioral scan confirms no network, credential, process, model, or image behavior.
642. **Invented missing-file variants** — scanner false positive. It claimed files under `templates/` and swapped `assets/` and `references/` paths that do not appear in the skill. The deterministic documented-local-path test resolves every actual local path and passes.
66Neither LOW finding permits data transmission or clinical decision-making. The recorded July scan reported no actual CRITICAL or HIGH finding after review. The repository-level `SECURITY.md` is intentionally not edited in this scoped refresh; its generated snapshot will update through the repository's normal process.

Historical residual LOW findings

The LLM-assisted pull-request scan reported:

  1. **Missing allowed-tools declaration** — informational. The field is optional. The compatibility statement and body explicitly limit bundled tools to local standard-library JSON processing, and the direct behavioral scan confirms no network, credential, process, model, or image behavior.
  2. Invented missing-file variants — scanner false positive. It claimed files under templates/ and swapped assets/ and references/ paths that do not appear in the skill. The deterministic documented-local-path test resolves every actual local path and passes.

Neither LOW finding permits data transmission or clinical decision-making. The recorded July scan reported no actual CRITICAL or HIGH finding after review. The repository-level SECURITY.md is intentionally not edited in this scoped refresh; its generated snapshot will update through the repository's normal process.

Raw lines 59 to 67
68## Reproduction
70```bash
71PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover \
72 -s tests/treatment-plans -p 'test_*.py' -v
74uv run skills-ref validate skills/treatment-plans
76uv run skill-scanner scan skills/treatment-plans --use-behavioral
78uv run python scan_pr_skills.py \
79 --fail-on HIGH \
80 --output /tmp/treatment-plans-pr-scan.md \
81 skills/treatment-plans
82```

Reproduction

PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover \
  -s tests/treatment-plans -p 'test_*.py' -v

uv run skills-ref validate skills/treatment-plans

uv run skill-scanner scan skills/treatment-plans --use-behavioral

uv run python scan_pr_skills.py \
  --fail-on HIGH \
  --output /tmp/treatment-plans-pr-scan.md \
  skills/treatment-plans
Raw lines 68 to 82
Runs code python scan_pr_skills.py :78