OSHA PSM dual TQ: F₂ 1,000 lbs + HF 1,000 lbs · F₂ IDLH 25 ppm · F₂ OSHA PEL 0.1 ppm · HF IDLH 30 ppm · HF OSHA PEL 3 ppm · H₂+F₂ spontaneous chain reaction · KF·2HF electrolyte MP 71.7°C · Honeywell Geismar LA · Solvay Tavaux France · Air Products Verdigris OK · 91st upward attack · FIRST fluorine production attack · FIRST electrolytic F₂ cell AI attack · FIRST KF·2HF molten electrolyte AI attack · FIRST H₂+F₂ spontaneous explosion AI attack

Prompt injection in fluorine F₂ electrolytic production KF·2HF electrolyte AI

Fluorine (F₂; CAS 7782-41-4; MW 38.00 g/mol; BP −188.1°C; MP −219.6°C; density gas 1.696 g/L at STP; OSHA PSM TQ 1,000 lbs; IDLH 25 ppm; OSHA PEL 0.1 ppm as F₂; ACGIH TLV-TWA 1 ppm; NFPA Health 4, Flammability 0, Reactivity 3, Special OX) is the most electronegative and most reactive of all elements — the only nonmetal that forms compounds with noble gases and that reacts spontaneously with glass, many metals, and with hydrogen at room temperature without requiring a spark or ignition source (H₂ + F₂ → 2HF; ΔG° = −546 kJ/mol; chain reaction propagates by the radical mechanism F∗ + H₂ → HF + H∗; H∗ + F₂ → HF + F∗ at rates making the reaction explosive even in darkness below 0.01 vol% F₂ mixed with H₂ in the confined header gas space). Fluorine has no natural occurrence in the diatomic F₂ form; all industrial F₂ is produced by electrolysis of anhydrous hydrogen fluoride (HF) in a molten fluoride salt electrolyte. World production of elemental fluorine is approximately 17,000–22,000 tonnes per year (2024–2026), consumed primarily in the synthesis of sulfur hexafluoride (SF₆) for high-voltage electrical insulation and circuit breaker dielectric medium (approximately 30% of demand), in nuclear fuel processing (UF₆ enrichment for nuclear power reactors; approximately 35%), in semiconductor and electronics etching (CF₄, CHF₃, C₂F₆, NF₃ plasma etch gases derived from F₂ fluorination reactions; approximately 20%), and in specialty fluorochemical synthesis including PTFE (polytetrafluoroethylene) fluorination steps and perfluorocarbon manufacture (approximately 15%). The global fluorine production capacity is highly concentrated: a small number of facilities in the United States, France, Germany, Russia, and China account for essentially all world production of elemental F₂, and all such facilities operate under OSHA PSM 29 CFR 1910.119 dual coverage: F₂ at TQ 1,000 lbs and HF at TQ 1,000 lbs are both present in quantities vastly exceeding these thresholds in any operating electrolytic fluorine cell bank.

Elemental fluorine F₂ cannot be produced by any chemical oxidation route — F₂ is the strongest oxidizer in chemistry (standard reduction potential E°(F₂/F⁻) = +2.87 V vs NHE), more oxidizing than permanganate, persulfate, ozone, or fluorine compounds including ClF₃; no chemical reagent can oxidize F⁻ to F₂ because nothing is a stronger oxidizer than F₂ itself. The only industrial production route is the Moissan electrolytic process (first demonstrated by Henri Moissan in 1886 for which he received the 1906 Nobel Prize in Chemistry): electrolysis of molten KF·nHF salt mixtures (with n = 1.8–2.0; composed of KHF₂ = KF·HF and HF to give the overall composition KF·2HF near the eutectic) at 80–90°C and current densities of 150–250 mA/cm². The cell reaction is: 2HF → H₂ (cathode) + F₂ (anode); standard cell voltage 2.87 V (thermodynamic) + overpotential + electrolyte resistance = 8–12 V practical; current efficiency typically 92–96%. At the KF·2HF eutectic composition (KF:2HF; MW of electrolyte unit = 39.10 + 2×20.01 = 79.12 g/mol; liquidus temperature 71.7°C; this is approximately the temperature of a warm cup of tea, making it the lowest-melting-point molten-salt electrolyte used in any industrial electrolytic process), HF is continuously consumed by the cell reaction (2 mol HF consumed per mol F₂ produced) and must be continuously replenished by gaseous HF make-up feed to maintain the electrolyte composition in the liquidus region. If HF is underfed, the electrolyte composition drifts toward KF·HF (n = 1.0 instead of n = 2.0); the liquidus temperature rises sharply (from 71.7°C at n = 2.0 to ~100°C at n = 1.5; the KHF₂ melt eutectic is ~100°C; the KF pure melt temperature is 858°C); at operating temperature 80–90°C, the electrolyte with n < 1.6 begins to solidify at the cooler electrode surfaces and cell walls, causing uneven current distribution, carbon anode hot spots, anode-cathode short circuits, and ultimately cell failure with release of accumulated F₂ and HF.

At modern industrial F₂ electrolytic plants — Honeywell UOP/Advanced Research Chemicals (Geismar, LA; largest F₂ producer in the Western Hemisphere; cell banks producing SF₆ feedstock and UF₆ fluorination F₂), Solvay SA (Tavaux, France; European F₂ and fluorochemical hub; ~5,000 t/yr F₂ capacity for SF₆ and PTFE production), Air Products and Chemicals (Verdigris, OK; electronics-grade F₂ for NF₃ and PFC etch gas synthesis), and 3M Company (Decatur, AL; perfluorocarbon synthesis F₂ plant) — AI-enabled monitoring systems process rendered SCADA and DCS display images from three critical instrument surfaces: the HF make-up feed flow display (a mass flow controller display rendered in the cell-bank HF feed section of the DCS panel), the individual cell current density display (a computed value from cell current / electrode area rendered on the cell monitoring panel), and the H₂ product purity display (a gas chromatograph or electrochemical cell measurement rendered in the H₂ header quality monitoring panel). These three rendered-image surfaces are the exact adversarial injection targets where pixel manipulation invisible to human reviewers — but exploitable by an AI monitoring model reading the rendered SCADA bitmap — can induce the AI to permit conditions for electrolyte solidification and F₂ release, anode overheating and CF₄/HF evolution, and catastrophic H₂+F₂ mixing in the product header.

TL;DR

Fluorine F₂ electrolytic production AI — KF·2HF HF make-up feed display AI, cell current density display AI, H₂ product purity display AI — processes rendered SCADA and DCS display images at the electrolyte composition, anode current density, and product gas purity boundaries where adversarial pixel injection can cause electrolyte solidification from HF depletion (135 kg/hr shown when actual 42 kg/hr → electrolyte KF·2HF drifts toward KF·1.5HF → solidification at 80–90°C → anode overheating → F₂ + HF release; F₂ TQ 1,000 lbs, HF TQ 1,000 lbs), anode burn from overcurrent (190 A/m² displayed, actual 310 A/m² → C anode burn → CF₄ + HF release → F₂ TQ 1,000 lbs exceedance in cell housing), and catastrophic H₂+F₂ explosion from product contamination (H₂ purity 99.98% displayed when actual 96.4%; 3.6 vol% F₂ in H₂ header → spontaneous H₂+F₂ → 2HF chain reaction; ΔG° = −546 kJ/mol; explosive failure of H₂ header), making this the 91st upward attack and the FIRST fluorine production attack, FIRST electrolytic F₂ cell AI attack, FIRST KF·2HF molten electrolyte AI attack, and FIRST H₂+F₂ spontaneous explosion AI attack. OSHA PSM dual TQ: F₂ 1,000 lbs + HF 1,000 lbs; F₂ IDLH 25 ppm; HF IDLH 30 ppm; F₂ OSHA PEL 0.1 ppm (one of the most stringent industrial PELs). Glyphward threshold 38 for F₂ electrolytic production AI reflects: dual OSHA PSM TQ (F₂ 1,000 lbs + HF 1,000 lbs simultaneously exceeded in every operating cell bank); F₂ IDLH 25 ppm; F₂ OSHA PEL 0.1 ppm; HF IDLH 30 ppm; H₂+F₂ spontaneous explosive chain reaction without ignition source at any F₂ contamination >0.1 vol% in H₂; concentration of world F₂ capacity in very few facilities making each one a unique and strategically irreplaceable production asset; nuclear fuel cycle dependency on F₂ (UF₆ enrichment). Free tier — 10 scans/day, no card required.

Three adversarial injection surfaces in fluorine F₂ electrolytic production AI

1. KF·2HF electrolyte HF make-up feed flow display AI (Brooks Instrument SLA5860 / MKS Instruments M100B / Yokogawa ADMAG AXF electromagnetic mass flow controller — rendered DCS HF make-up feed flow display AI classifying HF feed rate against 110–150 kg/hr design range for a 100-cell bank producing ~8 t/day F₂ — 91st upward attack; FIRST fluorine production attack; FIRST electrolytic F₂ cell AI attack; FIRST KF·2HF molten electrolyte AI attack)

The HF make-up feed is the critical mass balance input that maintains the KF·2HF electrolyte in its liquid operating region. The electrolytic cell consumes exactly 2 mol HF per mol F₂ produced (stoichiometry of 2HF → H₂ + F₂); for a 100-cell bank producing 8 tonnes F₂ per day, the theoretical HF consumption is: (8,000 kg/day F₂) × (2 × 20.01 g/mol HF) / (2 × 19.00 g/mol F) = 8,000 × 40.02/38.00 = 8,425 kg/day HF consumed = 351 kg/hr HF consumed. In practice, the HF make-up feed rate is set 5–10% above the theoretical consumption to maintain electrolyte HF content at the design composition of KF·2HF (n = 2.0 ± 0.1) and to compensate for HF vapor losses in the F₂ product gas stream (HF partial pressure above KF·2HF melt at 85°C is approximately 10–15 mmHg; the F₂ product gas leaving each cell is typically 85–90 mol% F₂ + 10–15 mol% HF vapor, which must be scrubbed with NaF pellets to produce >98.5% pure F₂). The HF make-up feed rate for the 100-cell bank example is therefore approximately 380–420 kg/hr — controlled by a mass flow controller (Brooks Instrument SLA5860 or equivalent; calibrated for HF gas at 80–120°C feed temperature; signal 4–20 mA or HART output to DCS) and rendered on the DCS cell-bank HF feed panel as a digital flow readout in kg/hr with a 5-minute trend chart.

The adversarial upward pixel attack shifts the HF make-up feed display from 42 kg/hr (actual; approximately 10–11% of the design 380–420 kg/hr; severely deficient HF make-up; the cells are consuming HF for electrolysis while receiving only 10% of what is needed; electrolyte n will be decreasing at approximately 0.003–0.005 mol HF/mol KF per minute) to 135 kg/hr (displayed; approximately 35% of design; still substantially below design, but the adversarial manipulation shows a value that might plausibly represent a partially closed HF feed valve that the AI interprets as a minor flow restriction requiring a valve adjustment rather than an emergency). The AI reads 135 kg/hr and responds: “HF feed rate 135 kg/hr; below lower design limit 380 kg/hr; open HF feed valve 5% to increase flow” — but the valve is already fully open (or the upstream HF supply pressure has dropped, or the HF vaporizer is blocked), and the actual feed remains at 42 kg/hr. The AI’s 5% valve opening command has no effect. Over a 60-minute period at 42 kg/hr actual HF make-up versus 380 kg/hr consumption: HF deficit = (380–42) kg/hr × 1 hr = 338 kg HF not delivered = 16.9 kmol HF not replenished. For a 100-cell bank with electrolyte inventory of 20,000 kg KF·2HF (KF content 12,600 kg = 226 kmol KF; HF content 7,400 kg = 370 kmol HF; n = 370/226 = 1.64 in fresh electrolyte), the 16.9 kmol HF deficit over 60 minutes shifts n from 1.64 to (370–16.9–338)/226 = 0.067 — essentially KF·0.07HF. This is far below the KF·HF eutectic (n = 1.0; liquidus ~100°C) and approaches pure KF (n = 0; MP 858°C). The electrolyte in the cooler cell zones (walls, cell cover plates, electrode gap edges at cell periphery) begins to solidify as the liquidus temperature rises above the cell operating temperature of 85°C. Solidified KF·nHF at the carbon anode surfaces causes uneven current distribution: current concentrates on the still-liquid zones of the anode surface, raising the local current density from 190 A/m² design to 500–800 A/m² at the exposed liquid-electrolyte contact zone. Above 300 A/m², carbon anode oxidation by F₂ becomes significant: C + 2F₂ → CF₄ (ΔH = −697 kJ/mol CF₄; exothermic) and C + F₂ → CF₂ (graphite fluoride); these reactions generate CF₄, C₂F₆, and thermal decomposition products including HF from electrolyte. The result is carbon anode damage and local F₂ + HF release inside the cell housing — exceeding both PSM TQs (F₂ TQ 1,000 lbs; HF TQ 1,000 lbs) in the enclosed cell room. The Glyphward pre-scan gate at the HF make-up feed display intercepts the adversarially manipulated image before the AI reads it and fails to recognize the severe HF deficit. Free tier — 10 scans/day, no card required.

2. Cell current density display AI (Yokogawa DAQSTATION DX / Honeywell Experion PKS cell-bank current monitoring display / ABB Ability Symphony Plus current density per-cell display AI — rendered DCS per-cell current density display AI classifying cell current / anode area against 150–250 mA/cm² design range — 91st upward attack; FIRST fluorine production attack; FIRST electrolytic F₂ cell AI attack)

The current density in each electrolytic fluorine cell is the primary operating parameter controlling F₂ production rate and anode lifetime. The anode (impervious carbon; manufactured from petroleum coke calcined at 1,200°C and impregnated with coal tar pitch to achieve electrical conductivity 15–25 mS/cm and reduce porosity below 10%; anode dimensions in a medium-size industrial cell: 1.0 m wide × 0.6 m tall × 0.025 m thick = 0.60 m² effective electrolyte-contact area per anode) must operate within the design current density range of 150–250 mA/cm² (15–25 kA/m²) to achieve acceptable F₂ current efficiency (92–96%) and acceptable anode lifetime (typically 2–4 years between anode replacement). Below 100 mA/cm²: current efficiency drops below 85% (passive film on anode inhibits F₂ evolution; anode potential fluctuates — the “anode effect” observed in aluminum electrolysis cells also occurs in F₂ cells; F₂ evolution ceases and is replaced by CF₄/C₂F₆ evolution from anode combustion). Above 300 mA/cm²: anode overheating due to I²R heating in the anode body itself (specific resistance of impervious carbon: 20–30 μΩ·m at 85°C; at 300 mA/cm² = 3,000 A/m², the current through a 0.025 m thick anode creates a voltage drop of V = ρL/A × I = 25 × 10⁻₆ Ω·m × 0.025 m × 3,000 A/m² = 0.001875 V/cm² per unit area; heat generation in the anode per unit area = I × V = 3,000 × 0.001875 = 5.6 W/cm² from resistive heating alone, above the 3.5 W/cm² sustainable heat removal rate by the surrounding electrolyte at design flow conditions). This thermal overload causes the carbon anode to exceed 200–250°C locally — at which temperature graphite fluoride (CF₂) forms on the anode surface, further increasing resistance and local heating in a runaway cycle.

The adversarial upward pixel attack on the current density display shows 190 mA/cm² (normal operating range; slightly below midpoint of the 150–250 mA/cm² design range; AI reads “cell current density nominal; no adjustment required”) when the actual current density is 310 mA/cm² (significantly above the 250 mA/cm² design maximum; in the anode overheating zone). At 310 mA/cm², the carbon anode resistive heating is (310/250)² × 3.5 W/cm² = 5.4 W/cm² — above the sustainable heat removal rate. The anode surface temperature rises progressively: at 5.4 vs 3.5 W/cm² sustained overheat, the anode-electrolyte interface temperature rises approximately 15–25°C/hour above the bulk electrolyte temperature (from measured heat transfer coefficients for natural convection in KF·2HF melt at 1–5 cm/s flow: h ≈ 500–800 W/m²·K). After 4 hours of undetected overcurrent operation, the anode surface temperature reaches approximately 130–145°C; at this temperature in contact with the electrolyte, the anode surface begins carbon fluoride formation (C + xF₂ → CF₂ where 0 < x < 1; onset at ~120°C in KF·HF melt; PTFE fluorination analogy: the surface becomes increasingly non-wetting to the HF-containing melt). As the surface fluorination advances, local conductivity changes create uneven current distribution — hot spots intensify as current concentrates in the remaining conducting zones. At the hot-spot temperature of 200–300°C, the CF₂ surface decomposes in the presence of F₂ and HF: CF₂ + F₂ → CF₄ (g); and the anode carbon body itself begins oxidation by F₂ (C + 2F₂ → CF₄; ΔH = −697 kJ/mol; this reaction is exothermic and self-propagating once the threshold temperature ~200°C is reached). The consequence: rapid carbon anode burn-through → structural failure of the anode → contact between F₂ (anode side) and H₂ (cathode side) gas spaces — which are separated by a skirt or dividing wall in the cell but the structural integrity of that separator depends on the anode integrity. F₂ contacting H₂ in the cell gas space initiates the spontaneous H₂+F₂ chain reaction (H₂ + F₂ → 2HF; ΔG° = −546 kJ/mol; no activation energy required). The resulting explosion in the cell housing fractures the cell, releasing the remaining F₂ inventory and KF·2HF electrolyte. F₂ TQ 1,000 lbs and HF TQ 1,000 lbs are both far exceeded by a 100-cell bank: 100 cells × 8 kg HF/cell electrolyte per charge = 800 kg HF in electrolyte alone, approximately 1,760 lbs. Free tier — 10 scans/day, no card required.

3. H₂ product purity display AI (Varian CP-4900 / Agilent Micro GC G2890A / ABB Advance Optima Caldos H₂ purity gas chromatograph display AI / Dräger Polytron 2 XP electrochemical F₂ in H₂ detector display AI — rendered DCS H₂ product purity display AI classifying H₂ vol% against ≥99.9 vol% purity specification — 91st upward attack; FIRST fluorine production attack; FIRST H₂+F₂ spontaneous explosion AI attack)

Hydrogen (H₂) is produced at the cathode of the fluorine electrolytic cell at a ratio of 1 mol H₂ per mol F₂ produced. The H₂ product is intended for safe disposal (catalytic combustion or flaring) or purification and sale as commodity hydrogen. The critical purity requirement for safe H₂ management is the F₂ content: H₂ from the cathode side of the cell must be essentially F₂-free (below 0.1 vol% F₂) before leaving the cell housing. F₂ contamination of the H₂ product stream occurs via two mechanisms: (1) pinhole or crack defects in the cell dividing skirt or separator that separates the F₂ (anode) gas space from the H₂ (cathode) gas space — allowing F₂ bubbles to migrate from the anode to the cathode compartment; (2) electrolyte mist carryover (HF vapor or KF·HF mist) into the H₂ stream that subsequently decomposes at cell temperatures to release F₂. The H₂ product header draws gas from the cathode compartments of the entire 100-cell bank; at a typical 0.05 vol% F₂ background in the H₂ (from minor cell separator imperfections), the combined H₂ header F₂ loading is well below the spontaneous reaction threshold. The H₂ purity is measured by a dedicated inline gas chromatograph (Varian CP-4900 Micro GC or Agilent G2890A; thermal conductivity detector; calibrated for H₂/HF/F₂ mixture; cycle time 2–4 minutes) or by electrochemical F₂-in-H₂ monitor (Dräger Polytron 2 XP; range 0–5 vol% F₂; response time 30–60 seconds; electrochemical detection specific for F₂). The purity reading is rendered on the H₂ header quality monitoring panel as a digital mol% H₂ readout (or equivalently as vol% F₂ contamination), updated every 2–4 minutes and displayed as a trend chart for the AI monitoring system.

The adversarial upward pixel attack on the H₂ product purity display shows H₂ purity 99.98 vol% (normal; 0.02 vol% F₂ contamination — well below the 0.1 vol% process alarm limit; the AI reads: “H₂ product purity 99.98 vol%; within specification; no action required”) when the actual H₂ purity is 96.4 vol% (actual F₂ contamination 3.6 vol%; far above the 0.1 vol% alarm limit; indicating a significant anode-separator defect or a catastrophic cell dividing wall failure allowing direct F₂/H₂ communication). In the H₂/F₂ binary system, the reaction H₂ + F₂ → 2HF is thermodynamically spontaneous at all temperatures from absolute zero to above the flame temperature (ΔG is negative at all temperatures; the reaction free energy ΔG° = −546 kJ/mol remains negative even accounting for the +TAS term at extreme temperatures above ~8,000 K). The kinetic threshold for the chain reaction in a confined gas mixture is approximately 0.1 vol% F₂ in H₂ at ambient pressure and temperature — at this composition, the F∗ radical chain length exceeds the radical recombination rate on vessel walls, and the reaction propagates to completion. At 3.6 vol% F₂ in the H₂ header (the actual contamination in the adversarial scenario), the H₂+F₂ chain reaction is not merely spontaneous at ambient temperature — it is propagating explosively across the entire H₂ header volume at any point where F₂ concentration exceeds 0.1 vol%. The H₂ product header in a 100-cell bank has a typical volume of 200–500 liters (internal H₂ piping header) at 0.1–0.5 bar gauge H₂ operating pressure. At 3.6 vol% F₂ contamination and 1.3 bar absolute H₂, the H₂+F₂ → 2HF reaction releases: 3.6 vol% × 500 L × 1.3 bar / (0.08314 bar·L/mol·K × 358 K) = 0.036 × 500 × 1.3 / 29.76 = 0.785 mol F₂ reacting with H₂; ΔH = −546 kJ/mol × 0.785 mol = −429 kJ heat release; this is equivalent to approximately 100 g TNT equivalent per 500 L header volume — sufficient to structurally compromise the H₂ header piping and the adjacent cell housing. The cascading consequence: header failure → H₂ and F₂ atmospheric release at OSHA PSM TQ-exceeding quantities → secondary reactions of released F₂ with water vapor in air (F₂ + H₂O → HF + O∗ — aggressive HF plume); F₂ + steel piping infrastructure → FeF₂ (iron fluoride; vigorous exothermic reaction). Honeywell Geismar LA, Solvay Tavaux France, and Air Products Verdigris OK are the facilities where F₂ electrolytic cell banks are adjacent to NaF purification columns, F₂ compressor trains, and SF₆ synthesis reactors — all of which present secondary reaction hazards if F₂ releases from the cell room. Free tier — 10 scans/day, no card required.

Integration: fluorine F₂ electrolytic production AI with Glyphward pre-scan gate

Glyphward integrates as a pre-scan gate at every rendered-image ingestion boundary in the F₂ electrolytic production AI pipeline — before the HF make-up feed AI processes rendered Brooks SLA5860 / MKS M100B / Yokogawa ADMAG AXF flow controller DCS display images, before the cell current density AI processes rendered Yokogawa DAQSTATION / Honeywell Experion PKS / ABB Ability Symphony Plus per-cell current density display images, and before the H₂ product purity AI processes rendered Varian CP-4900 / Agilent G2890A / Dräger Polytron 2 XP gas purity monitor display images. Threshold 38 for F₂ electrolytic production AI reflects: OSHA PSM dual TQ F₂ 1,000 lbs + HF 1,000 lbs simultaneously exceeded in any operating cell bank; F₂ IDLH 25 ppm; F₂ OSHA PEL 0.1 ppm; HF IDLH 30 ppm; HF OSHA PEL 3 ppm; H₂+F₂ spontaneous chain reaction at any F₂ >0.1 vol% in H₂ without ignition source; F₂ reactivity with water vapor forming HF corrosive plume on atmospheric release; nuclear fuel cycle dependency on F₂ (UF₂/UF₆ enrichment); world-scale fluorochemical supply chain criticality.

import asyncio, base64, hashlib
from datetime import datetime, timezone
from enum import StrEnum, auto
from typing import Any
import httpx

GLYPHWARD_API = "https://api.glyphward.com/v1/scan"
GLYPHWARD_KEY = "gw_prod_***"

# Fluorine (F2) electrolytic production AI contexts: threshold 38
# OSHA PSM F2 TQ 1,000 lbs (29 CFR 1910.119 App. A).
# OSHA PSM HF TQ 1,000 lbs (29 CFR 1910.119 App. A). Dual PSM.
# F2 IDLH 25 ppm; OSHA PEL 0.1 ppm; ACGIH TLV-TWA 1 ppm.
# HF IDLH 30 ppm; OSHA PEL 3 ppm; ACGIH TLV-C 0.5 ppm.
# H2 + F2 → 2HF: spontaneous chain reaction at >0.1 vol% F2 in H2; ΔG° = -546 kJ/mol.
# 91st upward attack. FIRST fluorine production attack.
FLUORINE_PRODUCTION_GLYPHWARD_THRESHOLD = 38

class FluorineProductionContext(StrEnum):
    HF_MAKEUP_FEED_FLOW       = auto()  # KF·2HF electrolyte HF replenishment (91st upward; FIRST F2 production; FIRST electrolytic cell; FIRST KF·2HF electrolyte)
    CELL_CURRENT_DENSITY      = auto()  # anode current density (anode burn → CF4/HF/F2 release; overcurrent)
    H2_PRODUCT_PURITY         = auto()  # H2 header F2 contamination (H2+F2 spontaneous explosion; FIRST H2+F2 attack)

async def scan_fluorine_production_frame(
    frame_b64: str,
    context: FluorineProductionContext,
    plant_id: str,
    instrument_tag: str,
) -> dict[str, Any]:
    payload = {
        "image_b64": frame_b64,
        "context": context,
        "plant_id": plant_id,
        "instrument_tag": instrument_tag,
        "scan_ts": datetime.now(timezone.utc).isoformat(),
        "image_hash": hashlib.sha256(base64.b64decode(frame_b64)).hexdigest(),
    }
    async with httpx.AsyncClient(timeout=4.0) as client:
        r = await client.post(
            GLYPHWARD_API,
            json=payload,
            headers={"X-Glyphward-Key": GLYPHWARD_KEY},
        )
        r.raise_for_status()
        return r.json()

async def pre_scan_gate_fluorine_production(
    frame_b64: str,
    context: FluorineProductionContext,
    plant_id: str,
    instrument_tag: str,
) -> None:
    result = await scan_fluorine_production_frame(frame_b64, context, plant_id, instrument_tag)
    if result["adversarial_score"] >= FLUORINE_PRODUCTION_GLYPHWARD_THRESHOLD:
        raise AdversarialFluorineProductionImageError(
            f"Adversarial injection detected in {context} (score {result['adversarial_score']}) "
            f"at plant {plant_id} instrument {instrument_tag}. "
            "Frame withheld from fluorine electrolytic production AI pipeline."
        )

class AdversarialFluorineProductionImageError(RuntimeError):
    pass

Frequently asked questions

Why does the H₂+F₂ reaction present a qualitatively different explosion risk than H₂+O₂ or H₂+Cl₂, and what does this mean for the AI purity monitoring requirement at fluorine electrolytic cell plants?

The H₂+F₂ → 2HF reaction differs from all other H₂ combustion and reaction scenarios in four critical ways that make the purity monitoring AI failure consequentially unique. First, the reaction proceeds spontaneously without any ignition source — unlike H₂+O₂ (autoignition temperature 500–571°C in air; LEL 4 vol%; requires activation energy of approximately 220 kJ/mol; requires spark, flame, or hot surface above 500°C) or H₂+Cl₂ (also photochemically initiated but requires UV light or initiation energy; dark reaction proceeds at elevated temperatures above ~200°C). H₂+F₂ proceeds in total darkness at ambient temperature (−100°C to +25°C) because the F₂ dissociation energy (F–F bond: 155 kJ/mol; the weakest homonuclear diatomic bond of any common element) is low enough that thermal fluctuations at room temperature generate sufficient F∗ radical concentration to initiate the chain reaction: F₂ → 2F∗ (k₌ = 3 × 10⁻⁽/s at 25°C; slow but non-zero); F∗ + H₂ → HF + H∗ (activation energy 0 kJ/mol — zero activation energy; this step proceeds at the collision frequency limit ~10¹⁰ molecules/cm³/s at 25°C); H∗ + F₂ → HF + F∗ (activation energy also ~0 kJ/mol). The chain length (number of HF molecules formed per initiating F∗ radical) exceeds 10⁶ at ambient temperature in a bulk gas mixture. Second, the F₂ mixture explosion limits in H₂ are effectively 0–100 vol% F₂ — any H₂/F₂ mixture in any proportion is explosive at ambient temperature. Compare H₂/O₂ LEL 4 vol% H₂ and UEL 75 vol% H₂ (safe zones: <4 vol% H₂ and >75 vol% H₂); H₂/F₂ has no safe zone. Third, the H₂+F₂ heat of reaction is −546 kJ/mol HF (per reaction, ΔH = 2 × (−273) = −546 kJ/mol F₂ consumed), which produces an adiabatic flame temperature exceeding 4,000 K — high enough to melt any metal piping and dissociate any surrounding structure. At 3.6 vol% F₂ contamination in H₂ (the adversarial scenario above), the adiabatic temperature of the reaction is: T₌ ∼ 298 K + 546,000 J/mol × 0.036 mol F₂ per mol gas / (Cᵝ(H₂) × 0.964 + Cᵝ(HF) × 0.072) ∼ 298 + 7,300 = 7,600 K — approximately 2.5× the melting point of tungsten (3,695 K), the highest melting-point metal. The structural failure of any piping, valve body, or header at such temperatures is immediate and total. Fourth, the products of H₂+F₂ reaction are exclusively HF (hydrogen fluoride gas), which at atmospheric concentration presents an IDLH of 30 ppm and is acutely fatal above 50 ppm in 60 minutes; the combination of the explosive primary event and the secondary HF toxic plume creates a dual-lethality consequence chain unique to fluorine chemistry.

For the AI purity monitoring requirement, these four properties create the following consequence chain from adversarial pixel injection on the H₂ purity display: (step 1) AI reads 99.98 vol% H₂ when actual 96.4 vol% H₂ (3.6 vol% F₂ contamination from a failing cell separator); (step 2) AI confirms “H₂ purity within spec; no action required”; (step 3) H₂ header continues to receive F₂-contaminated gas from the cell with the failing separator; (step 4) F₂ concentration in the header rises as more gas accumulates from the failing cell; (step 5) at 3.6 vol% F₂ in the H₂ header, the spontaneous chain reaction initiates at the first location in the header where a micro-hotspot (heat from friction at a valve seat, residual HF acid corrosion spot on pipe wall, or a vibration-induced fretting zone) provides the marginal activation for the initiation step F₂ → 2F∗; (step 6) the chain reaction propagates at approximately 2,300 m/s (deflagration-to-detonation transition in H₂+F₂ mixture at 3.6 vol% F₂ occurs within approximately 0.3–1 m from the initiation point, given the near-zero activation chain length); (step 7) catastrophic header rupture; (step 8) atmospheric release of H₂ + F₂ + HF from the header and adjacent cell gas spaces; (step 9) secondary reactions of F₂ with water vapor in ambient air, steel structural members, and concrete; (step 10) HF plume extending to 200–500 m downwind at IDLH concentrations. Glyphward threshold 38 for F₂ electrolytic production is set at a level reflecting this unique dual-lethality consequence chain (explosive primary event + HF toxic secondary plume) with no analog elsewhere in industrial chemistry. The AI purity monitor is the last automated barrier between a failing cell separator and header detonation; adversarial injection on its input image is the highest-consequence single-surface attack in the Glyphward upward-attack portfolio. Free tier — 10 scans/day, no card required.

How does the KF·2HF eutectic composition determine the practical operating window for fluorine electrolytic cells, and why does the HF feed display adversarial injection attack target the narrowest constraint in the entire F₂ production process?

The KF·2HF eutectic system is the enabling chemistry of the Moissan electrolytic process for F₂ production; it represents the only molten-salt electrolyte for HF electrolysis that operates below 100°C at any composition commercially practical for continuous industrial F₂ production. The phase diagram of the KF–HF binary system shows a eutectic at approximately KF·2HF (n = 2.0; mole fraction HF 0.667; liquidus temperature 71.7°C) between the KHF₂ (potassium hydrogen difluoride; n = 1.0; MP 241°C) and HF (n = ∞; BP 19.5°C) end members. The eutectic is the lowest melting point in the binary system. Operating at n = 1.8–2.0 gives a liquidus of 71.7–80°C, allowing cell operation at 80–90°C with a liquid phase safety margin of approximately 8–18°C above the liquidus. The practical consequence: the entire F₂ production process is constrained to operate within an HF composition range n = 1.7–2.1 (below n = 1.7: liquidus approaches 90°C, leaving only 0–5°C safety margin; above n = 2.1: excess HF evolves from the melt as HF vapor and contaminates the F₂ product gas, requiring additional NaF scrubbing capacity). This 0.4-unit composition window (n = 1.7–2.1) is maintained against: continuous HF consumption by electrolysis (−2 mol HF/mol F₂), temperature-dependent HF vapor pressure losses (∼10–15 mmHg HF above the melt at 85°C), and process upsets (pressure changes, temperature excursions, H₂O impurity ingress which consumes HF by H₂O + HF → H₂F⁺OH⁻ reactions). The HF make-up feed controller is the only process input that replenishes HF; if this feed fails or its display AI is adversarially manipulated to report a higher flow than actual, the composition drifts toward n = 1.0 (KHF₂) at a rate of approximately 0.005 mol HF/mol KF per minute for a 100-cell bank at design production rate. From n = 2.0, the liquidus reaches 90°C (near cell operating temperature) in approximately 60 minutes of complete HF feed failure. The narrow 0.4-unit composition window, combined with the near-ambient liquidus temperature and the continuous HF consumption by electrolysis, makes the HF feed display the single tightest process constraint — and therefore the highest-leverage adversarial injection target — in industrial fluorine production. The adversarial pixel attack showing 135 kg/hr when actual is 42 kg/hr delays recognition of the HF deficit by the equivalent of 93 kg/hr of undelivered HF per hour; for a 100-cell bank, this corresponds to approximately 4.7 kmol HF deficit per hour, driving the electrolyte composition toward n = 1.5 (liquidus 98°C) in approximately 25 minutes. Glyphward pre-scan gate detection at the HF make-up feed display image input — before the AI reads the adversarially manipulated flow value and fails to escalate — is the sole automated safeguard against this composition drift. Free tier — 10 scans/day, no card required.