airgapllm 0.6.0
Flagship Ecosystem Polish & Automated Live PDF Publishing
- Wired TinyTeX (
r-lib/actions/setup-tinytex@v2) and fail-fast PDF builds (docs/airgapllm-manual.pdfviaR CMD Rd2pdfanddocs/airgapllm-guide.pdfviarmarkdown::render()) directly into.github/workflows/pkgdown.yaml(normalized workflow name topkgdown), eliminating live GitHub Pages PDF 404s. - Added bespoke package hex logo (
man/figures/logo.png), live GitHub Actions (R-CMD-check,pkgdown) andMITlicense badges, and a Quantitative Research Suite cross-reference table inREADME.md. - Completed final CRAN submission polish across
DESCRIPTION(expandedTitlewithout unexpanded acronyms and updatedDescriptioncovering k-anonymity/l-diversity, consensus extraction, hardware sizing, and compliance packets),inst/CITATION,inst/guides/airgapllm-guide.Rmd, andcran-comments.md.
airgapllm 0.5.2
- Upgraded
is_symlink_path()inR/security.Rwith canonical parent-vs-self reparse-point comparison to reliably detect Windows NTFS file symlinks (while excluding Windows 8.3 short-name directory aliases likeRUNNER~1), fixed case-insensitiveNO_PROXY/no_proxyenv var setup in Windows tests, and relaxed the shared-VM ReDoS timing ceiling from 2s to 10s.
airgapllm 0.5.1
Cross-Platform Windows CI Compatibility Fixes
- Fixed false-positive
person_nameaudit PII rejection on Windowsos_infostrings (e.g.,"Windows Server 2022 x64 (build 20348)") by scanningos_infoagainst high-precision direct PII classes innormalize_audit_entry()and adding unambiguous OS/platform terms topii_name_stopwords()while preserving full strict PII scanning on all user-controllable audit fields (run_id,decoding_params,metadata,model_name,event_type). - Hardened cross-platform path validation in
R/security.R(assert_safe_host_path(),assert_safe_write_target(),assert_path_confined()) andR/pii.R(pii_vault_save(),pii_vault_rotate_key()) to handle Windows drive prefixes (C:\,C:/), backslash separators, 8.3 short paths (RUNNER~1) via deepest-existing-ancestor canonicalization, case-insensitive path comparisons, and safe Windows file replacement while still blocking colon bind-mount injection,..traversal, shell metacharacters, and symlinks. - Guarded unprivileged Windows
file.symlink()calls intests/testthat/test-adversarial-security.Rand added permanent Windows/Linux/macOSos_infoand drive-path regression tests intests/testthat/test-peer-redteam.R.
airgapllm 0.5.0
Independent Peer Red-Team Security, Privacy & Robustness Hardening
Addresses all 21 confirmed findings (2 CRITICAL, 9 HIGH, 7 MEDIUM, 3 LOW) from the independent peer red-team security audit, backed by permanent regression tests in tests/testthat/test-peer-redteam.R:
Critical Fixes
-
Eliminated
cliGlue Expression Injection / RCE (C-01): Escaped dynamic diagnostic strings across all untrusted-inputcli::cli_abort()call sites (R/audit.R,R/irb.R,R/workflow.R,R/runtime.R,R/container.R,R/pii.R) via centralizedescape_cli_braces(), preventing arbitrary R code execution from tampered audit logs, malicious endpoint URLs, invalid model paths, metadata keys, or malformed regexes. -
Closed Audit Log & IRB Compliance Packet PHI Leakage (
C-02): Enforced finite non-negative integer validation onrow_counts,pii_counts, andoutput_pii_leaks, strict ISO-8601 UTCtimestampvalidation, and full built-in PII scanning acrossdecoding_params,run_id,event_type,model_name, and all scalar string audit fields. Upgradedexport_irb_compliance_packet()to pre-scan protocol header fields and scan every exported artifact (includingirb_protocol_narrative.md,irb_protocol_narrative.qmd, container specs, andpacket_manifest.json) across all built-in direct PII classes before settingzero_pii_verified = TRUE.
High-Severity Security & Privacy Fixes
-
Forged Pseudonym Token Detection & Nonce Sentinels (
H-01):scan_and_handle_output_pii()now verifies<<TYPE_HEX>>tokens strictly against active vault token allowlists, flagging forged hex-digit exfiltration tokens asforged_pseudonym_token, and protects genuine tokens with per-call 64-bit random nonces (__AGVTOK_<nonce>_...__) and single-pass restoration to prevent placeholder collisions. -
Protected Container Offline/Loopback Environment Controls (
H-02): Blocked overridingHF_HUB_OFFLINE,TRANSFORMERS_OFFLINE,HF_DATASETS_OFFLINE,DO_NOT_TRACK,OLLAMA_NOHISTORY,OLLAMA_HOST,OLLAMA_MODELS, and proxy variables (HTTP_PROXY/HTTPS_PROXY/ALL_PROXY/NO_PROXY/etc.) inairgap_container_spec(env = ...), re-validated inbuild_container_env(), and added a requiredcontainer_env_isolationcheck inpreflight_isolation_check(). -
Vault Encryption Downgrade Defense (
H-03):pii_vault_load()now acceptsrequire_encrypted = !is.null(key)and aborts withairgap_vault_errorif an unencrypted JSON vault is encountered when a decryptionkeyis supplied orrequire_encrypted = TRUE. -
Symlink Write Confinement & Pre-Write
0600Permissions (H-04): Addedassert_safe_write_target()acrossexport_irb_compliance_packet(),pii_vault_save(),pii_vault_rotate_key(backup = TRUE),audit_log_append(),airgap_extract(checkpoint_path = ...),generate_irb_narrative(file = ...), and container emitters, ensuring symlink targets can never be overwritten and temporary vault/backup files receive0600permissions before bytes are written. -
Model Digest Hidden-File & Parent-Symlink Confinement (
H-05):verify_model_digest()now enumerates hidden dotfiles (all.files = TRUE, no.. = TRUE) and walks all parent directory components to block parent-directory symlinks even whenroot_dir = NULL. -
Unicode Combining-Mark, ALL-CAPS EHR & Accented Name PII Coverage (
H-06): Extendedcanonicalize_pii_text()to strip Unicode combining diacritics and transliterate Latin accented letters with exact original span mapping; added case-insensitive clinical title/role matching and ALL-CAPS role-prefixed name detection (PATIENT: JOHN DOE,DR. JANE DOE,ATTENDING ROBERT MILLER). -
Pre-Inference
prompt_templatePHI Gate (H-07):airgap_extract()andairgap_extract_consensus()now scan supplied prompt templates for raw PII and reject pre-rendered templates embedding unsanitized input rows whenpii_policy != "verified_deidentified". -
Injective -Anonymity Keys & Fail-Closed
include_na = FALSE(H-08): Replaced\x1f/"<NA>"equivalence keys with strictly injective length-prefixed encoding (N:vsV<bytes>:<value>); preventedNA-QI rows from escaping suppression/masking underinclude_na = FALSE; rejectedmask_value = NAwithinclude_na = FALSE; failed closed when all non-empty rows are excluded; and addedairgap_anonymity_warningwhenever post-anonymization targets remain unmet. -
Checkpoint Model Identity, Input-Drift Verification & Zero-PHI Error Hygiene (
H-09):checkpoint_load()now verifiesheader$modelmatches the active runtime model; resume logic verifies per-rowinput_sha256against sanitized input text; andvalidate_extraction()omits untrusted raw LLM extra keys and raw enum values from persisted.errormessages.
Medium & Low Reliability & Interoperability Fixes
-
Consensus Token Allowlisting & Integrity (
M-01,M-02): Propagated active vault tokens intoairgap_extract_consensus()inner passes so genuine all-digit pseudonym tokens (e.g.,<<PAT_0123456789>>) are preserved cleanly; rejected duplicateprompt_templatesnames and schema field collisions withid_color consensus columns; returnedNA_real_agreement when fewer than 2 passes succeed; and eliminatedInfoverflow on wide numeric bounds ([-1e308, 1e308]). -
Uniform Finite Integer Validation (
M-03): Centralizedassert_scalar_int()rejectingInf,NaN, non-integers, and out-of-range doubles across all numeric/integer entry points. -
Chunker Progress & Exact Character Overlap (
M-04): Enforcedmin_cut >= overlap_chars + 1Linchunk_clinical_texts()to prevent nested duplicate-chunk explosions and gated word-boundary overlap snapping to non-character split modes. -
IPv6
[::1]Proxy Audit & Container Flag Hardening (M-05): Updateddetect_outbound_proxies()to require::1inNO_PROXYwhen targeting[::1]; blocked--trust-remote-code,--download-dir, and leading-dashmodel_dirpaths. -
Single-Pass
pii_reidentify()& Consensus IRB Parity (M-06): Upgradedpii_reidentify()to single-pass left-to-right token replacement; addedairgap_consensussupport toexport_irb_compliance_packet()and"consensus_extraction_run"selection ingenerate_irb_narrative(). -
Hardware Auto-Tuner OOM Warnings & Input Validation (
M-07): Addedrecommended$feasibleflag +airgap_hardware_warningon infeasible VRAM fallback, strictly cappedcontainer_memory_limitat physicalram_gb, and hardenedcorpus_size,preview_n, andpreview_charschecks. -
Prompt-Sensitive Mock Variance, Multiline Addresses & Delimiter Sanitization (
L-01,L-02,L-03): Mixed prompt template instruction hashes intoruntime_mock()deterministic outputs for realistic multi-prompt consensus variance; extendedstreet_addressregex across newline-separated city/state/ZIP lines; rejected shell metacharacters inunix:///paths; and broadenedneutralize_prompt_delimiters()to match whitespace/attribute tag variants.
airgapllm 0.4.0
New Research-Workflow Capabilities
-
Quasi-Identifier & k-Anonymity / l-Diversity Risk Auditor (
R/anonymity.R):- Added
assess_reidentification_risk()quantifying equivalence class distributions, minimum/median , sample uniques, -anonymity violations, prosecutor and journalist re-identification risk metrics, and optional distinct -diversity for sensitive outcomes—never logging raw participant values. - Added
apply_k_anonymity()supporting safe row suppression ("suppress_rows") and progressive rare-class masking ("mask_rare", automatically absorbing smallest residual classes so masked fallback groups strictly satisfyk_minandl_min), returning privacy-safe tables alongside before/after risk reductions.
- Added
-
Multi-Pass Consensus & Self-Consistency Extraction (
R/consensus.R):- Added
airgap_extract_consensus()running deterministic multi-pass extractions across multiple random seeds and/or prompt variants (including full crossedseeds x prompt_templatesdesigns), aggregating categorical/logical fields by majority vote (tie_policy = c("first", "na")) and numeric/integer fields by median, trimmed mean, or mean. - Added
consensus_passes()(long-format pass table directly compatible with psychometric generalizability / reliability studies with zero hard dependencies) andconsensus_diagnostics()(per-field agreement, unanimity, and tie counts), with seamless integration intoextraction_manifest(),audit_log_append(), andgenerate_irb_narrative().
- Added
-
Hardware-Aware Auto-Tuner & Runtime Benchmarker (
R/benchmark.R):- Added
recommend_runtime_config()selecting OOM-safe open-weights parameter tiers, quantizations, context windows, batch sizes, KV precisions, and hardened container memory limits for workstation GPUs, multi-GPU HPC nodes, and CPU-only hosts. - Added
benchmark_local_runtime()profiling pilot throughput (rows/sec), p50/p95 latency, schema validation success rate, repair retry rate, and projected full-corpus ETA cleanly on local or mock runtimes.
- Added
Coverage-Driven Bug Fixes & Documentation
- Conducted a comprehensive
covraudit raising package line coverage from 89.3% to >94% and resolving five latent edge cases:- Fixed 0-byte pre-existing checkpoint files failing to initialize a header record before appending rows in
airgap_extract(). - Hardened output PII masking sentinels when combining
pii_policy = "pseudonymize"withoutput_pii_action = "redact". - Added malformed tail guards to
audit_log_append(..., verify_existing = FALSE). - Removed unreachable dead branches in
resolve_overlapping_spans(). - Suppressed spurious base PCRE compilation warnings before throwing structured validation errors on invalid custom regexes in
schema_field()andpii_config().
- Fixed 0-byte pre-existing checkpoint files failing to initialize a header record before appending rows in
- Added a fifth executable vignette (
vignettes/consensus-and-kanonymity.Rmd), updated the standalone PDF Field Guide,pkgdownreference site, andREADME.md.
airgapllm 0.3.0
Production Clinical & HPC Workflow Capabilities
- Added
chunk_clinical_texts()for deterministic paragraph-, sentence-, or character-aligned overlapping chunking of long therapy transcripts and interviews with preserveddoc_id,chunk_id,chunk_index, and character offset provenance. - Added
pii_audit_dataframe()for non-destructive pre-inference privacy dry-runs producing aggregate entity coverage, high-PII-density row flags, HIPAA Safe Harbor and Unicode advisories, and strictly redacted preview snippets containing zero raw PII. - Added
estimate_vram_requirements()to estimate total GPU VRAM (model weights + GQA KV-cache + runtime overhead) across parameter counts, quantizations (Q4_K_M,Q6_K,Q8_0,FP16), context windows, batch sizes, and GPU hardware tiers. - Added
pii_vault_rotate_key()for atomic in-place or target-path master key rotation of encryptedairgapllm_vault_v2vaults with fresh HKDF-SHA256 salts, fresh IVs, and preserved historical token mappings. - Added
export_irb_compliance_packet()to assemble a self-contained, strictly PII-free, SHA-256-sealed IRB/HIPAA review directory containing the verified audit log, pre-flight attestation, hardened container definitions, Markdown/Quarto IRB narratives, andpacket_manifest.json. - Added bundled 100% fictional teaching dataset
synthetic_notes(data/synthetic_notes.rda) spanning synthetic clinical therapy notes, EMA journals, student writing, HIPAA Safe Harbor cases, and a multi-paragraph transcript. - Hardened
airgap_extract()and PII helpers with safe Latin-1 / Windows-1252 to UTF-8 normalization (normalize_text_utf8()), graceful 0-row data frame handling, and actionable checkpoint schema/prompt/policy mismatch diagnostics.
CRAN Readiness, Documentation & Website
- Expanded to 4 executable offline vignettes:
getting-started,privacy-and-compliance,irb-hipaa-compliance-walkthrough, andhpc-gpu-deployment. - Added package-level documentation (
?airgapllm),inst/CITATION, runnable example scripts ininst/examples/, standalone PDF Field Guide (inst/guides/airgapllm-guide.Rmd),inst/WORDLISTfor zero-misspelling checks,cran-comments.md,_pkgdown.yml, and GitHub Actions CI workflows (R-CMD-check.yaml,pkgdown.yaml).
airgapllm 0.2.0
Security Hardening & Red-Team Upgrades
- Added centralized security, cryptography, and sanitization module (
R/security.R) with constant-time byte comparisons (constant_time_equal()), RFC 5869 HKDF-SHA256 key derivation (hkdf_sha256()), strict SSRF/URL parsing, container injection guards, symlink/path confinement, and Unicode canonicalization. -
Air-Gap SSRF & Proxy Hardening:
is_loopback_endpoint()andpreflight_isolation_check()now reject CRLF/control characters, backslashes, URL fragments, percent-encoded authorities, IPv6-mapped IPv4 ([::ffff:169.254.169.254],[::ffff:7f00:1]), non-canonical IPv6, octal/hex/decimal/shorthand IPv4 notations (0177.0.0.1,2130706433,0x7f000001,127.1), and DNS-rebinding tricks.preflight_isolation_check()now audits all*_proxyenvironment variables case-insensitively and fails closed by default (strict_proxy = TRUE) when outbound proxies lack explicit127.0.0.1andlocalhostentries inNO_PROXY. -
Container & Symlink Injection Defense:
airgap_container_spec(),emit_docker_run(),emit_docker_compose(), andemit_apptainer_def()now block newline/shell/YAML/Apptainer%postinjection, bind-mount:option injection,..traversal, dangerous linker/shell env vars (LD_PRELOAD,BASH_ENV), and security-override flags (--privileged,--cap-add, non-loopback--host), and POSIX-quote all Apptainer%runscriptarguments.verify_model_digest()now rejects symbolic links by default (allow_symlinks = FALSE) and enforces canonicalroot_dirconfinement. -
Vault v2 Cryptography: Upgraded
pii_vault_save()andpii_vault_load()toairgapllm_vault_v2using RFC 5869 HKDF-SHA256 domain-separated keys with per-save random 128-bit salts, fresh random 128-bit IVs, full AAD header authentication, constant-time Encrypt-then-MAC verification strictly before decryption, and uniform error messages eliminating padding oracles (while retaining backward-compatible constant-time verification for v1 vaults). -
HIPAA Safe Harbor, Unicode Defense & ReDoS Hardening:
- Added
hipaa_restricted_zip3()and built-in"age_over_89"and"zip_code"HIPAA Safe Harbor entity detectors (covering ages > 89, 5-digit/ZIP+4 postal codes, and the 17 HHS restricted 3-digit ZIP prefixes). - Added index-preserving Unicode canonicalization defeating zero-width obfuscators (
U+200B,U+FEFF,U+00AD), Unicode dashes, fullwidth ASCII, and Cyrillic/Greek homoglyphs. - Hardened all PII regular expressions with bounded quantifiers, fixed sentence-ending period lookahead for emails, and upgraded overlap resolution and span replacement to O(M log M + N).
- Added
-
Prompt-Injection Framing, Output PII Scan & Resilient Checkpoints:
- Framed untrusted research text inside
<UNTRUSTED_RESEARCH_RECORD>delimiters with tag-breakout neutralization and hardened local runtime system prompts. - Added post-inference output PII leakage scanning (
output_pii_action = c("redact", "error", "warn", "none")) inairgap_extract(), recording integeroutput_pii_leakscounts in manifests and audit logs. - Hardened JSONL checkpoint and audit readers (
read_jsonl_raw_lines()) against truncated UTF-8 and NUL byte corruption, scrubbed PII from persisted checkpoint error messages, and switchedaudit_log_verify()to constant-time digest checks.
- Framed untrusted research text inside
- Added
SECURITY.mddocumenting all v0.2.0 red-team findings and mitigations, plustests/testthat/test-adversarial-security.R.
airgapllm 0.1.0
- Initial CRAN-grade release providing the four core pillars: air-gapped Docker/Compose/Apptainer container lifecycle manager, pure-R pre-inference PII redaction & HMAC-SHA256 pseudonymization engine, crash-resumable schema-enforced batch extractor with local HTTP and deterministic mock runtimes, and tamper-evident SHA-256 hash-chained JSONL audit trail with IRB/HIPAA protocol narrative generator.
