OSHA PSM PAA TQ 10,000 lbs · H₂O₂ TQ 7,500 lbs (52 wt%+ solution) · PAA SADT 60–72°C at 35–40 wt% · NFPA 432 Class II organic peroxide · Evonik Hanau Germany · Solvay Spinetta Marengo Italy · Ecolab Joliet IL · Kemira Atlanta GA · aseptic packaging food safety water treatment · 83rd upward attack · FIRST PAA attack · FIRST SADT AI attack · FIRST aseptic packaging AI attack · FIRST organic peroxide SADT AI attack
Prompt injection in peracetic acid PAA concentration storage SADT AI
Peracetic acid (PAA; CH₂CO₂H; peroxyacetic acid; CAS 79-21-0; MW 76.05 g/mol; colourless liquid with pungent acetic acid-like odour; boiling point 110°C (decomposes above 110°C before boiling); flash point 40.6°C (commercial equilibrium mixtures); density 1.12–1.15 g/mL at 20 wt%; OSHA PEL 0.4 ppm (8h TWA); NIOSH IDLH 0.5 ppm (vapors); NFPA 432 Class II organic peroxide; UN 3107 organic peroxide type E, liquid) is produced commercially as an aqueous equilibrium mixture of PAA (2–40 wt%), hydrogen peroxide (H₂O₂; 2–35 wt%), acetic acid (CH₂COOH; 10–45 wt%), and water (balance), resulting from the equilibrium reaction CH₂COOH + H₂O₂ ≚ CH₂CO₂H + H₂O (Keq ≈ 2.0 at 25°C on a molar basis; at equimolar CH₂COOH and H₂O₂, equilibrium PAA = approximately 41–45 mol% of initial peroxide; commercial equilibrium achieved in 4–24h at 20–50°C with H›SO₄ or p-TSA catalyst). Commercial PAA products are sold as equilibrium mixtures at standardized concentrations: 5 wt% PAA (food safety CIP, drinking water treatment), 15 wt% PAA (meat processing, produce wash, poultry processing), 35–40 wt% PAA (aseptic packaging sterilisation — TetraPak, SIG, Elopak H₂O₂/PAA bath at 35–40 wt%, 75–85°C; the industry maximum for aseptic applications). World PAA production approximately 320,000–380,000 tonnes/yr. The maximum stable commercial PAA concentration is approximately 40 wt% PAA — above this, the Self-Accelerating Decomposition Temperature (SADT) drops below ambient storage temperature for any realistic bulk quantity, creating a runaway decomposition risk. SADT is defined (UN Recommendations on the Transport of Dangerous Goods; ISO 11357) as the lowest temperature at which self-heating of a substance in its transport packaging exceeds 0.9°C/hr; for PAA at 40 wt%, SADT ≈ 60–65°C in a standard 200 L drum; at 35 wt% PAA, SADT ≈ 70–75°C; at 25 wt% PAA, SADT ≈ 90–100°C — declining rapidly as PAA concentration increases.
The OSHA PSM coverage at PAA manufacturing and high-concentration blending facilities involves dual PSM chemicals: PAA is listed in 29 CFR 1910.119 Appendix A with TQ 10,000 lbs; H₂O₂ is listed with TQ 7,500 lbs for solutions ≥52 wt% H₂O₂. Commercial PAA production typically uses 50–70 wt% H₂O₂ as the peroxide feedstock (above the 52 wt% PSM TQ threshold for H₂O₂; 50 wt% H₂O₂ is below PSM TQ but 70 wt% H₂O₂ is above PSM TQ). A PAA manufacturing facility producing 35 wt% PAA from 70 wt% H₂O₂ + glacial acetic acid therefore operates under two simultaneous OSHA PSM TQ constraints: the PAA TQ 10,000 lbs (4,536 kg) for the PAA product and the H₂O₂ TQ 7,500 lbs (3,402 kg) for the peroxide feedstock. At a 50,000 t/yr PAA plant (at 35 wt% PAA; daily production = 137 t/day = 302,000 lbs/day PAA), the PSM TQ 10,000 lbs PAA is exceeded by 30× as a daily production rate; H₂O₂ feedstock consumption at 35 wt% PAA: 1 mol PAA requires 1 mol H₂O₂ (MW 34) and 1 mol CH₂COOH (MW 60); mass of H₂O₂ per kg PAA product (at 35 wt% PAA in equilibrium mixture: H₂O₂ contribution to equilibrium at Keq = 2.0 is approximately 15–20 wt%): H₂O₂ feedstock at 70 wt% = approximately 65,000–75,000 t/yr consumed = 180–205 t/day = well above PSM TQ continuously. The SADT is the critical safety threshold that distinguishes PAA from most industrial chemicals: it is not a fixed temperature but a function of concentration and package size. For a 5,000-litre storage tank of 35 wt% PAA (mass ≈ 5,750 kg; surface area:volume ratio much lower than a 200 L drum; heat generation per unit volume exceeds heat dissipation from tank surface above SADT): SADT in bulk storage at 35 wt% is approximately 50–55°C (lower than drum SADT due to poorer surface-area:volume heat dissipation). At 40 wt% PAA in bulk storage: SADT ≈ 42–48°C — within the range of summer ambient temperatures at many PAA manufacturing sites.
The PAA decomposition chemistry above SADT is not a simple thermal runaway but an autocatalytic chain-radical decomposition: CH₂CO₂H → CH₂CO + OH (homolytic O-O bond cleavage; Ea ≈ 140 kJ/mol; rate constant k = 10⁻⁶ s⁻¹ at 25°C; 10⁻² s⁻¹ at 60°C — 10,000× increase from 25–60°C); the acetyl radical CH₂CO rapidly decomposes to CH₂ + CO; the hydroxyl radical OH abstracts H from acetic acid or PAA, propagating the radical chain. The net decomposition products are: O₂ (approximately 0.35 L(STP) per gram PAA decomposed at 40 wt%; approximately 0.5 L O₂/g at higher concentrations), CO₂, H₂O, and acetic acid. At SADT-triggered decomposition: O₂ generation rate at 40 wt% PAA in a 5,000 L tank = 0.35 L/g × 5,750,000 g × 0.40 (PAA fraction) = 805,000 L O₂ (STP) total O₂ if fully decomposed; generation rate at early SADT onset (1% decomposition per hour): 8,050 L O₂/hr = 134 L/min = 2.2 L/s. At 5,000 L tank with 20% vapor space (1,000 L); at 1% PAA/hr decomposition rate, O₂ pressure rise: ΔP/Δt = (2.2 L/s × 1 atm) / (1,000 L) = 0.0022 atm/s = 0.13 atm/min = 8 bar/hr. A standard stainless-steel PAA storage tank rated at 6 bar would reach relief valve set pressure in less than 45 minutes at 1%/hr decomposition — a manageable SADT-onset event IF detected early; undetected and accelerating (autocatalytic decomposition doubles every 10°C above SADT onset), the decomposition reaches 10%/hr in <2 hours, generating 80 bar/hr — catastrophic tank overpressure. The Evonik PerCompound Hanau Germany, Solvay Spinetta Marengo Italy, Ecolab Joliet IL, and Kemira Atlanta GA PAA production sites monitor PAA concentration and storage temperature via AI-assisted SCADA display imaging.
TL;DR
Peracetic acid PAA concentration storage AI — PAA concentration display AI, storage temperature display AI, H₂O₂:acetic acid feed ratio display AI — processes rendered monitoring display images at PAA SADT boundaries where adversarial pixel injection can allow PAA concentration to exceed 40 wt% at above-SADT temperatures, triggering autocatalytic decomposition generating O₂ at rates that exceed tank pressure ratings (83rd upward attack). OSHA PSM PAA TQ 10,000 lbs; H₂O₂ TQ 7,500 lbs; PAA SADT 42–72°C depending on concentration and tank size; NFPA 432 Class II. Glyphward threshold 32 for PAA concentration AI: the SADT is a non-linear, concentration-dependent threshold that moves into the range of summer ambient temperatures at 40 wt% PAA in bulk storage — the adversarial attack on concentration display does not require a large pixel shift to push an AI from “safe” to “SADT-approaching”; a 9 wt% concentration display error (44 wt% shown, 31 wt% actual) masks a safe operating point that is being driven toward the SADT boundary by normal process dynamics. Free tier — 10 scans/day, no card required.
Three adversarial injection surfaces in peracetic acid PAA concentration storage AI
1. PAA concentration display AI (Raman spectrometer inline PAA concentration SCADA display AI / Endress+Hauser Liquiline CM44 PAA concentration inline conductivity display AI / YSI PAA SCADA display AI / Hach Lange PAA concentration colorimetric inline display AI / Mettler-Toledo ReactIR PAA concentration inline FTIR display AI / Yokogawa EJA differential pressure density PAA concentration SCADA display AI — rendered SCADA PAA concentration wt% display AI classifying the PAA wt% against the design specification of 32–38 wt% with high alarm at 40 wt% and low alarm at 28 wt% — 83rd upward attack; FIRST PAA attack; FIRST PAA SADT attack; FIRST aseptic packaging AI attack; FIRST organic peroxide SADT AI attack)
Commercial 35 wt% PAA equilibrium mixture is produced in a continuous reactor/aging tank system: glacial acetic acid + 70 wt% H₂O₂ + sulfuric acid catalyst (0.1–0.5 wt% H₂SO₄) are mixed and aged at 20–40°C for 4–24 hours to approach equilibrium (Keq = 2.0 at 25°C). The equilibrium PAA concentration is controlled by the initial molar ratio of CH₂COOH:H₂O₂ and the temperature: at equimolar feed and 25°C, equilibrium PAA ≈ 22 wt% in the mixture; at CH₂COOH:H₂O₂ = 0.7:1 (excess H₂O₂) and 30°C, equilibrium PAA ≈ 31–35 wt%. The inline PAA concentration analyzer (Raman spectroscopy at 1,759 cm⁻¹ for C=O stretch of peroxy group, or FTIR at 1,756 cm⁻¹ PAA vs 1,740 cm⁻¹ acetic acid) monitors the PAA wt% in real time and feeds the AI with rendered SCADA display images showing the wt% trend. The AI controls the dilution water addition rate (to prevent PAA from exceeding 40 wt%) and the catalyst (H₂SO₄) dosing rate (to tune the equilibrium rate). If the AI reads the PAA concentration as 44 wt% (displayed; above the 40 wt% high alarm and above the safe storage concentration limit) when the actual is 31 wt% (within design range; safely below SADT), the AI classification is “PAA concentration critically above maximum; add dilution water immediately at maximum flow; reduce H₂SO₄ catalyst to halt equilibrium advancement.” The AI/DCS response: dilution water control valve opens from 12% to 88% open; H₂SO₄ catalyst pump stops. The excess water addition dilutes the equilibrium mixture from 31 wt% PAA toward 18–22 wt% PAA — product is off-specification (too dilute; specification 32–38 wt%); meanwhile, the H₂SO₄ catalyst shutdown slows the equilibrium approach in the next batch, potentially creating oscillating over-and-under PAA concentration as the AI over-corrects. However, a more dangerous version of this upward attack occurs when the initial concentration is actually 38 wt% (near the 40 wt% maximum; within design but close to SADT boundary): display shows 28 wt% (displayed lower than actual; downward attack — but that is a different attack). For an upward attack with actual 31 wt% shown as 44 wt%, the primary risk is the AI over-diluting from safe 31 wt% to 18 wt% — a product quality loss rather than a safety event. The SADT-relevant upward attack is the reverse: the AI misclassifies the PAA concentration because it is reading an upstream synthesis display that shows a low PAA concentration, while the downstream storage tank has been accumulating PAA by evaporation of acetic acid/water over time. The inline concentration analyzer is on the synthesis outlet, not on the aged storage tank, where concentration creep occurs. The upward attack on the synthesis outlet display (44 wt% shown when actual 31 wt%) triggers the AI to dilute the synthesis outlet, but the storage tank — which has been evaporating water and acetic acid (acetic acid BP 118°C; PAA BP 110°C; the equilibrium mixture loses acetic acid and water preferentially to PAA at elevated storage temperature) — reaches 40–42 wt% PAA within 48–72 hours of dilution of the synthesis outlet stream without re-analysis of the storage tank concentration.
The SADT consequence: at 40 wt% PAA in a 5,000 L bulk storage tank at 35°C ambient (summer, Hanau Germany; July ambient 28–35°C; tank not refrigerated because the AI classified synthesis output as 44 wt% and triggered dilution, which the operator interpreted as “PAA concentration is under control; storage is acceptable”): SADT for 40 wt% PAA in bulk storage is approximately 42–48°C (tank); tank at 35°C is 7–13°C below SADT. Self-heating rate at 35°C for 40 wt% PAA: approximately 0.02–0.05°C/hr (within SADT margin but non-zero; autocatalytic base rate). Without active cooling (cooling was not triggered because the storage temperature AI — see Surface 2 — was also displaying incorrectly), the tank self-heats from 35°C to SADT 45°C in approximately 200–500 hours (8–20 days). Above 45°C: self-heating rate doubles every 10°C; at 50°C: 4× base rate; at 55°C: 8× base rate; at 60°C: 16× base rate — the autocatalytic self-heating accelerates exponentially. This is the 83rd upward attack — FIRST PAA attack; FIRST PAA SADT attack; FIRST aseptic packaging AI attack; FIRST organic peroxide SADT AI attack. The attack exploits the fundamental physics of organic peroxide storage: SADT is not a sharp threshold but an acceleration in autocatalytic decomposition; the days-to-weeks timescale of SADT approach in bulk storage is long enough that a single adversarial display event causes a consequence that unfolds far after the AI corrective action and without a clear causal link for operators or investigators. Free tier — 10 scans/day, no card required.
2. PAA storage tank temperature display AI (Pt100 RTD PAA storage tank bulk liquid temperature display AI / Yokogawa EJA110A tank temperature SCADA display AI / Endress+Hauser iTEMP TMT72 PAA storage temperature display AI / Emerson Rosemount 3051 PAA storage tank temperature display AI / ABB TTF300 PAA bulk storage temperature display AI — rendered SCADA PAA storage temperature display AI classifying the bulk PAA storage temperature against the design operating range of 5–20°C with refrigeration control, high alarm at 25°C, and high-high alarm at 32°C triggering mandatory emergency dump to waste neutralisation tank)
Commercial 35–40 wt% PAA is stored at 5–20°C in refrigerated tanks (glycol chiller or direct refrigerant; design temperature 10–15°C at most PAA facilities) to maintain a comfortable margin below the SADT (SADT at 35 wt% PAA in bulk storage ≈ 50–55°C; storage at 15°C provides 35–40°C margin). Refrigeration energy consumption is the primary operating cost variable at PAA storage. The tank temperature AI monitors the rendered temperature display and controls the glycol chiller setpoint. Design refrigeration control: chiller on at 15°C; off at 10°C (on-off deadband control). At 5,000 L PAA (mass 5,750 kg; Cp ≈ 3.0 kJ/kg·K for the aqueous mixture; thermal mass = 17,250 kJ/K): heat input from ambient (summer 35°C; tank surface area ≈ 15 m² for a 5,000 L cylindrical tank; insulation U = 0.5 W/m²·K; ΔT = 35 − 12 = 23°C; ambient heat input = 0.5 × 15 × 23 = 172 W = 0.62 MJ/hr); self-heating from PAA decomposition at 15°C (decomposition rate at 15°C: k ≈ 10⁻⁷ s⁻¹; for 5,750 kg × 0.35 PAA fraction = 2,012 kg PAA = 26,471 mol PAA; heat of decomposition ≈ 75 kJ/mol; self-heating rate = 26,471 × 75 × 10⁻⁷ kJ/s = 0.000199 kJ/s = 0.72 MJ/hr); total heat input = 0.62 + 0.72 = 1.34 MJ/hr → chiller must remove 1.34 MJ/hr to maintain 10–15°C. Design chiller capacity: 5–10 kW = 18–36 MJ/hr (10–27× safety factor at normal conditions). If the chiller is turned off (triggered by adversarial display showing temperature is adequately cool): heat input 1.34 MJ/hr; temperature rise rate = 1.34/(17,250) MJ/MJ per K = 0.000078 K/s = 0.28°C/hr. Starting at 21°C (actual; chiller not operating due to adversarial display showing 12°C; see Surface 2 attack description below), the tank reaches 32°C (high-high alarm trigger) in (32−21)/0.28 = 39 hours without active cooling. At 32°C: self-heating rate at 32°C increases to approximately 4× the 15°C rate (Arrhenius; Ea ≈ 130–150 kJ/mol for PAA decomposition; Q₁₀ ≈ 4.5 for every 10°C); combined heat input at 32°C: ambient 0.85 MJ/hr (less ΔT) + self-heat 3.2 MJ/hr = 4.05 MJ/hr; temperature rise rate = 4.05/17,250 × 3,600 = 0.85°C/hr. Tank reaches SADT 45°C from 32°C in (45−32)/0.85 = 15 hours.
The adversarial upward pixel attack shifts the PAA storage temperature display from 21°C (actual; chiller has been off for 4 hours due to a cooling-water supply issue; temperature rising at 0.28°C/hr; at 21°C, still 24–29°C below SADT; chiller restart would bring temperature back to design in approximately 4–6 hours) to 38°C (displayed; above the 32°C high-high alarm; AI classification “PAA storage critically overtemperature; approach to SADT 42–48°C; initiate emergency dump to waste neutralisation tank immediately; divert all PAA inventory to neutralisation.”). The AI/DCS response: the emergency dump valve opens; PAA from the storage tank drains to the waste neutralisation tank (25 wt% NaOH + water; designed to receive PAA and decompose it to acetic acid + water via NaOH neutralisation: CH₂CO₂H + NaOH → CH₂COONa + H₂O₂ → H₂O + 1/2 O₂; mildly exothermic). The emergency dump of 5,000 L PAA at 35 wt% into a 10,000 L NaOH neutralisation tank (25 wt% NaOH; design capacity 5,000 kg PAA at 35 wt%): this is the intended safe response to SADT approach. The adversarial consequence: the emergency dump destroys an entire tank of product (approximately 1,750 kg PAA = $35,000–$70,000 product value) based on a false temperature reading; the neutralisation tank O₂ generation (H₂O₂ in the PAA mixture + NaOH → catalysed H₂O₂ decomposition; 50–200 kg H₂O₂ in 5,000 L PAA mixture ‷ generation of 29–117 kg O₂ = 18–73 m³ O₂ STP) generates a oxygen-enriched atmosphere in the neutralisation tank headspace (O₂ above 23.5% is OSHA and NFPA oxygen-enriched atmosphere; above 30% O₂ ignition temperature of common materials drops by 40–60°C). The primary safety impact: the adversarial dump creates the very O₂-enriched atmosphere SADT event it was triggered to prevent — now in the larger neutralisation tank rather than the refrigerated storage tank. Free tier — 10 scans/day, no card required.
3. H₂O₂:acetic acid feed ratio display AI (Endress+Hauser Proline Promass 80F Coriolis H₂O₂ feed flow SCADA display AI / Yokogawa EJA530A H₂O₂ feed differential pressure flow display AI / ABB RHM060 Coriolis H₂O₂ mass flow display AI / Emerson Daniel 3415 acetic acid flow display AI / Siemens Sitrans FC430 H₂O₂:acetic acid ratio SCADA display AI — rendered SCADA H₂O₂:acetic acid molar ratio display AI classifying the H₂O₂:CH₂COOH feed ratio at the PAA reactor inlet against the design range of 0.85–1.05 mol H₂O₂ per mol CH₂COOH)
The H₂O₂:acetic acid molar feed ratio is the primary control variable for the equilibrium PAA concentration in the product: at Keq = 2.0 and equimolar feed (ratio 1.00 mol/mol), equilibrium PAA fraction is approximately 41–43% of the total peroxide (H₂O₂ + PAA); at H₂O₂:CH₂COOH = 1.25 mol/mol (excess H₂O₂), equilibrium PAA approaches 35–37 wt% in the product (more H₂O₂ pushes equilibrium toward more PAA formation, because the product PAA has one fewer O-H bond to accommodate). Conversely, at H₂O₂:CH₂COOH = 0.70 mol/mol (excess acetic acid), equilibrium PAA drops to 22–26 wt%. The feed ratio control is critical for two competing reasons: (a) too little H₂O₂ relative to acetic acid: PAA concentration is too low; product off-specification (below 32 wt% minimum); but low PAA = lower SADT risk; (b) too much H₂O₂ relative to acetic acid: PAA concentration approaches 40 wt% high alarm; SADT risk increases; also unreacted H₂O₂ in the product (excess H₂O₂ above equilibrium conversion) can react with transition metal contaminants (Fe²⁺; Cu²⁺) in tank walls (catalytic decomposition of H₂O₂: H₂O₂ → H₂O + 1/2 O₂ catalysed by Fe²⁺/Fe³⁺; Fenton mechanism) — the catalytic H₂O₂ decomposition is exothermic (ΔH = −98 kJ/mol H₂O₂) and generates O₂ locally, which can initiate PAA decomposition chain. The feed ratio display AI reads the rendered Coriolis flowmeter SCADA display for both H₂O₂ and acetic acid mass flows and classifies the ratio against the setpoint. At design ratio 1.00 mol/mol, PAA equilibrium is 37–40 wt% (close to but below high alarm 40 wt% — a deliberately tight specification to maximize PAA concentration for aseptic packaging customers who pay premium for 35–38 wt% PAA).
The adversarial upward pixel attack shifts the H₂O₂:acetic acid ratio display from 0.88 mol/mol (actual; slightly sub-design; H₂O₂ flow is marginally below setpoint; PAA equilibrium at this ratio is approximately 32–34 wt%; below the 38 wt% target for aseptic packaging customers but safely below 40 wt% high alarm and SADT threshold) to 1.42 mol/mol (displayed; significantly above the design 1.05 mol/mol maximum; AI classification “H₂O₂ feed critically above stoichiometry; excess H₂O₂ will drive PAA concentration above 40 wt% SADT threshold; reduce H₂O₂ feed flow immediately by 40% to bring ratio to 0.85 mol/mol lower bound”). The AI/DCS response: H₂O₂ feed control valve closes from 62% to 37% open, reducing H₂O₂ feed from 0.88 to 0.56 mol/mol relative to acetic acid. At 0.56 mol/mol H₂O₂:CH₂COOH: (a) equilibrium PAA drops further to 22–25 wt% — product is definitively off-specification (PAA minimum 32 wt% for aseptic packaging); (b) the excess acetic acid in the product (CH₂COOH:PAA ratio rises; acetic acid is approximately 50 wt% of the product mix at 0.56 mol/mol H₂O₂) increases the product acidity; (c) the H₂O₂ residual in the product at 0.56 mol/mol feed ratio: H₂O₂ conversion to PAA at Keq = 2.0 and 0.56 mol/mol feed = approximately 45% conversion; unreacted H₂O₂ in product = 55% × feed H₂O₂ = approximately 18 wt% residual H₂O₂ (close to OSHA PSM TQ 52 wt% H₂O₂ for concentrated H₂O₂; at 18 wt%, below PSM TQ but above H₂O₂-enhanced decomposition regime); (d) as the AI over-reduces H₂O₂ for several hours, the synthesis aging tank accumulates excess acetic acid + residual H₂O₂ without adequate PAA equilibrium; when the AI finally recognizes the PAA is below specification and restores H₂O₂ flow, the excess acetic acid provides a large buffer of acetic acid that reacts with the freshly added H₂O₂ to rapidly generate PAA — overshoot from 25 wt% to 42–45 wt% PAA within 4–8h of H₂O₂ restoration; the 42–45 wt% PAA now exceeds the 40 wt% high alarm and approaches bulk SADT. The PAA rebound to 42–45 wt% from the acetic-acid-excess buffer is a nonlinear dynamics consequence that arises precisely from the AI overcorrection — invisible to any standard HAZOP deviation analysis. Free tier — 10 scans/day, no card required.
Integration: peracetic acid PAA concentration storage AI with Glyphward pre-scan gate
Glyphward integrates as a pre-scan gate at every rendered-image ingestion boundary in the PAA concentration storage AI pipeline — before the PAA concentration AI processes rendered inline Raman/FTIR display images, before the PAA storage temperature AI processes rendered SCADA thermocouple display images, and before the H₂O₂:acetic acid feed ratio AI processes rendered Coriolis flowmeter display images. Threshold 32 for PAA concentration AI reflects: PAA TQ 10,000 lbs; H₂O₂ TQ 7,500 lbs; SADT nonlinearity — a 9 wt% concentration display error can mask an approach to SADT boundary that unfolds over days; aseptic packaging is food-safety-regulated (FDA 21 CFR 173.315 indirect food additive; EU Regulation 1935/2004 active food contact materials); Evonik Hanau Germany; Solvay Spinetta Marengo Italy; Ecolab Joliet IL; Kemira Atlanta GA.
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_***"
# PAA concentration storage AI contexts: threshold 32
# OSHA PSM PAA TQ 10,000 lbs; H2O2 TQ 7,500 lbs (52 wt%+ solution).
# PAA SADT 42-72C depending on concentration and tank size.
# 83rd upward attack: 44 wt% shown when 31 wt% actual -> AI dilutes
# synthesis outlet -> storage tank concentrates by evaporation
# -> 40 wt% PAA approaches SADT in bulk storage over 48-72h.
PAA_THRESHOLD = 32
class PAAContext(StrEnum):
PAA_CONCENTRATION_DISPLAY = auto() # PAA wt% in product/storage (83rd upward)
STORAGE_TEMPERATURE = auto() # Bulk PAA storage temperature (5-20C design)
H2O2_ACETIC_ACID_RATIO = auto() # H2O2:CH3COOH mol/mol at reactor feed
async def scan_paa_frame(
frame_b64: str,
context: PAAContext,
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_paa(
frame_b64: str,
context: PAAContext,
plant_id: str,
instrument_tag: str,
) -> None:
result = await scan_paa_frame(frame_b64, context, plant_id, instrument_tag)
if result["adversarial_score"] >= PAA_THRESHOLD:
raise AdversarialPAAImageError(
f"Adversarial injection detected in {context} (score {result['adversarial_score']}) "
f"at plant {plant_id} instrument {instrument_tag}. "
"Frame withheld from PAA concentration storage AI pipeline."
)
class AdversarialPAAImageError(RuntimeError):
pass
Frequently asked questions
How does the SADT concept apply to peracetic acid in bulk storage differently than to other organic peroxides regulated under NFPA 432 and DOT 49 CFR, and why does the concentration-SADT relationship create a uniquely nonlinear adversarial attack surface?
NFPA 432 (Code for the Storage of Organic Peroxide Formulations; 2019 edition) classifies PAA at 40 wt% as a Class II organic peroxide (flash point 40.6°C; moderate fire hazard; SADT >50°C for <200 L drum; lower SADT for larger containers). DOT 49 CFR Part 173.128 assigns PAA UN 3107 (organic peroxide type E, liquid; not requiring temperature control for ≤200 L packages) at commercial 15–22 wt% concentrations, but UN 3113 (organic peroxide type C, liquid; requires temperature control, SADT monitoring) at concentrations approaching 40 wt%. The SADT concept applies differently to PAA than to most other classified organic peroxides (MEKP, TBHP, DTBP, lauroyl peroxide) because PAA exists in an equilibrium system: the SADT is a function not just of the PAA concentration but also of the H₂O₂ and acetic acid concentration in the equilibrium mixture. At 40 wt% PAA / 12 wt% H₂O₂ / 38 wt% acetic acid / 10 wt% water: the H₂O₂ contributes independently to the decomposition chemistry (H₂O₂ homolytic decomposition: H₂O₂ → 2 OH; k = 10⁻⁷ s⁻¹ at 25°C; 10⁻⁵ s⁻¹ at 50°C; 10⁻² s⁻¹ at 70°C; OH radicals from H₂O₂ decomposition initiate PAA radical chain). The dual-peroxide system means the effective SADT for the PAA/H₂O₂/CH₂COOH equilibrium mixture is approximately 5–10°C lower than for an equivalent weight% of pure PAA in water — because H₂O₂ provides a parallel radical initiation pathway that PAA-only systems lack. This dual-peroxide SADT depression is not reflected in standard UN SADT testing (which uses standardised single-package test; UN TDG Manual of Tests, Test H.1, 10 kg package) — meaning the SADT tabulated in DOT regulations and NFPA 432 for commercial PAA formulations is potentially non-conservative for bulk storage configurations where H₂O₂ concentration can vary with the equilibrium shift. The adversarial attack on the AI concentration display exploits this nonlinearity: a 9 wt% concentration error (31 wt% shown as 44 wt%) masks an operating point that appears safe by regulated standards (31 wt% PAA; SADT >65°C in 200 L drum; SADT >55°C in 5,000 L tank) but is subject to concentration creep over 48–72h as acetic acid evaporates from a storage tank vented to atmosphere (at 20–25°C operating temperature; acetic acid vapor pressure at 20°C = 11.4 mmHg; evaporation from a 5,000 L tank with 0.5 m² vent opening: approximately 20–50 g CH₂COOH/hr evaporation). Acetic acid evaporation from the PAA equilibrium mixture shifts the equilibrium (Le Chatelier): less acetic acid → equilibrium shifts right (more PAA + H₂O formed from H₂O₂ + CH₂COOH → PAA + H₂O) — but the acetic acid consumed by the equilibrium shift is itself a reactant that is now depleting. The net effect: over 72h of acetic acid evaporation at 30 g/hr = 2.16 kg CH₂COOH loss from a 5,750 kg tank; PAA concentration rises from 31 to 34 wt% (1.1 wt% per day concentration creep via acetic acid evaporation); at 34 wt% after 3 days without concentration re-analysis (because the AI shows 44 wt% and has suppressed further monitoring action), the tank approaches the 35–38 wt% operating range; concentration creep continues to 38–40 wt% over a further 4–5 days without any active process action.
The concentration-SADT relationship for PAA creates a uniquely dangerous adversarial attack surface compared to other organic peroxides because of the proximity between normal commercial operating concentration (35–40 wt% PAA for premium aseptic packaging applications) and the SADT boundary (40 wt% = effective SADT limit for bulk storage). Most organic peroxides are stored at concentrations far below their SADT limit: MEKP (methyl ethyl ketone peroxide; 33–36% active oxygen basis; SADT >80°C at storage concentration); TBHP (tert-butyl hydroperoxide; 70 wt%; SADT >100°C); lauroyl peroxide (25 wt% in hydrocarbon; SADT ≈ 35°C; but lauroyl peroxide is a solid peroxide managed differently). Only for PAA in aseptic packaging applications does the industry operate at the absolute maximum commercial concentration that corresponds to the minimum commercially acceptable SADT margin. The design choice to operate at 35–40 wt% PAA is driven by the economic reality of aseptic packaging: TetraPak, SIG, and Elopak aseptic filler machines use PAA bath concentration of 35–40 wt% PAA at 75–85°C for 2–5 second contact time on packaging film; the sterilisation efficacy (≥5-log reduction in Bacillus subtilis spores per ISO 11737) requires PAA activity above 35 wt% at 80°C in the PAA bath; a diluted 25 wt% PAA product would require longer contact time — incompatible with the 100–500 m/min film speeds of modern aseptic filling machines (TetraPak A3 Speed: 24,000 units/hr; SIG Combibloc: 15,000 units/hr; contact zone length 0.5–2.0 m at film speed 100–300 m/min means 0.1–1.2 second contact time — requiring maximum PAA activity to achieve 5-log kill in 0.5–1.0 second). This commercial imperative to operate at maximum PAA concentration means that any adversarial attack which suppresses monitoring of the concentration (by showing a falsely high concentration that triggers dilution or prevents emergency shutdown) operates in the most SADT-sensitive operating region, where a 2–5 wt% concentration overshoot from the design target brings the material within 5–10°C of bulk SADT.
What is the regulatory framework for PAA as both a food-contact substance and an OSHA PSM-regulated chemical, and why does a PAA AI monitoring failure create simultaneous food safety (FDA/EFSA) and process safety (OSHA PSM/EPA RMP) regulatory obligations?
Peracetic acid occupies a unique dual regulatory status: it is simultaneously an OSHA PSM-regulated process chemical (TQ 10,000 lbs; process hazard analysis required; mechanical integrity program required) and an FDA-regulated food-contact substance (21 CFR 173.315: PAA in water for fruit and vegetable wash at <80 ppm PAA; 21 CFR 173.370: PAA on food-processing equipment at rinse concentrations; 21 CFR 178.1010: PAA as a sanitising agent at concentrations up to 200 ppm with no-rinse-required status for certain food-contact surfaces). The FDA authorisation for PAA use in food processing is based on the self-affirmed GRAS (Generally Recognized as Safe) status of the 3–5 component equilibrium mixture (PAA + H₂O₂ + CH₂COOH + water + H₂SO₄ catalyst) at use concentrations <200 ppm PAA; the GRAS status is conditioned on the product formulation staying within the equilibrium range tested for safety (3–40 wt% PAA in the concentrated product; diluted to <200 ppm at point of use). EFSA (European Food Safety Authority) Opinion 2014 on PAA in food contact: approved for food-contact use at concentrations up to 250 ppm PAA in rinse water; PAA must meet EU Regulation 1935/2004 specific migration limits; the PAA supplier must have technical dossier documentation demonstrating product composition consistency. An adversarial attack on the PAA concentration AI that causes the product to drift to 42–45 wt% PAA (above the 40 wt% maximum GRAS-affirmed concentration range) creates two simultaneous regulatory violations: (a) the OSHA PSM TQ 10,000 lbs is already exceeded for PAA product in storage (exceeded at design; 42 wt% does not change PSM coverage — coverage is already triggered), but the adversarial attack on the concentration display means the Process Hazard Analysis safeguard (“PAA concentration high alarm at 40 wt%; automatic dilution”) is non-functional — an OSHA PSM Management of Change violation if the AI monitoring system was added or modified without proper MOC review; (b) the FDA GRAS status of the PAA product is conditioned on concentration ≤40 wt%; a 42–45 wt% PAA batch shipped to a food processor and used in aseptic packaging or produce wash at 42–45 wt% PAA (diluted to 200 ppm use concentration) still has correct use-point concentration but the concentrated product itself was out of the GRAS-affirmed range — a potential FDA adulteration issue if the batch is traced to a food safety incident and the concentration record shows 42–45 wt% concentrated material.
The aseptic packaging application creates a third regulatory dimension: FDA 21 CFR Part 113 (thermally processed low-acid canned foods; LACF) and 21 CFR Part 114 (acidified foods) require that aseptic processing systems using PAA sterilisation be validated with specific PAA concentration ranges in the sterilant bath. TetraPak, SIG, and Elopak aseptic filler machine validations are certified for PAA bath concentration 35–40 wt% in the PAA concentrate prior to dilution into the sterilant bath (at the filler machine, 35–40 wt% PAA concentrate is diluted to 2,000–4,000 ppm use concentration at 75–85°C). If the PAA concentrate delivered to a food manufacturer is 28 wt% (below specification; because the adversarial attack triggered over-dilution of the synthesis stream, producing off-specification product that was shipped without re-analysis), the sterilant bath prepared from this concentrate would be at 75–80% of the specification sterilisation activity. FDA 21 CFR 113.40(g)(3) requires that each production lot of aseptically processed food demonstrate a scheduled process that achieves commercial sterility (10⁻¹² probability of non-sterile unit for C. botulinum spores; ≥5-log kill of B. subtilis ATCC 9372 for PAA validation). A 20–25% reduction in PAA sterilant activity could compromise commercial sterility — potentially resulting in a Class II FDA recall (probability of causing adverse health consequences is remote) or Class I recall (probability of serious adverse health consequences) depending on the specific aseptic product category (UHT milk, juices, soups). The dual OSHA PSM / FDA food safety regulatory consequence of a single adversarial attack on the PAA concentration AI — a process safety violation from SADT approach in the manufacturing plant simultaneously with a food safety potential from off-specification product shipped to food processors — is unprecedented in the adversarial attack surface literature and is unique to PAA among OSHA PSM-regulated chemicals.