UOP HF Alkylation AI · Phillips 66 HF Alkylation AI · Honeywell Experion PKS HF AI · OSHA PSM 29 CFR 1910.119 · EPA RMP 40 CFR Part 68 · API RP 751 · acid settler interface AI · HF acid strength AI · contactor temperature AI · ExxonMobil Torrance 2015

Prompt injection in HF alkylation unit AI

Hydrofluoric acid (HF) alkylation is one of two commercial alkylation processes used in petroleum refining to convert light olefins (propylene, butylene) with isobutane into high-octane alkylate blendstock for motor gasoline (alkylate typically has a research octane number (RON) of 92–98 and a motor octane number (MON) of 90–94, making it among the highest-value refinery streams per barrel). The HF alkylation process — licensed primarily by UOP (now Honeywell UOP) and by Phillips 66 (Conoco-Phillips variant) — uses concentrated anhydrous hydrofluoric acid (88–92 wt% HF) as the alkylation catalyst in a liquid-liquid contactor reactor, operating at 20–40°C and 5–15 bar. HF is among the most hazardous chemicals in petroleum refining: its OSHA PSM threshold quantity of 1,000 lbs is one of the lowest in the PSM Appendix A list (reflecting its extreme acute toxicity); the EPA RMP threshold quantity is 1,000 lbs (toxic); IDLH is 30 ppm; the ACGIH TLV-C (ceiling) is 0.5 ppm. HF vapour at concentrations above 30 ppm causes delayed pulmonary edema; systemic fluoride toxicity from skin contact causes hypocalcemia leading to fatal cardiac arrhythmia without antidote treatment; and HF at concentrations above approximately 48 wt% forms a denser-than-air aerosol that hugs the ground and disperses slowly across communities. The ExxonMobil Torrance, California, FCC unit explosion of 18 February 2015 — which projected metal fragments across the refinery — occurred with an HF alkylation unit approximately 50 feet from the FCC, leading the CSB to conclude that a direct HF unit impact could have affected up to 125,000 surrounding residents. In 2026, AI systems deployed across HF alkylation units process rendered images of acid settler HF-hydrocarbon interface level displays, HF acid strength analyzer readouts, acid-hydrocarbon contactor temperature trend charts, and acid relief header pressure indicators to classify acid circuit integrity and process safety state in real time. OSHA PSM and EPA RMP govern HF alkylation operations — API RP 751 (Safe Operation of Hydrofluoric Acid Alkylation Units) provides industry-specific guidance — but none of these frameworks specify adversarial robustness provisions for AI systems classifying rendered HF unit monitoring display images at the safety barrier boundary.

TL;DR

HF alkylation unit AI — acid settler HF-hydrocarbon interface level display AI, HF acid strength analyzer display AI, acid-hydrocarbon contactor temperature display AI, acid relief header pressure display AI — processes rendered images from HF unit DCS and analyzer displays at acid circuit integrity and safety boundaries where adversarial pixel injection can suppress HF acid carryover to downstream equipment, acid strength degradation below the safe operating floor, elevated contactor temperature increasing HF vapour pressure, and relief header pressure excursions indicating upstream HF vapour release. OSHA PSM 29 CFR 1910.119 (HF TQ 1,000 lbs), EPA RMP 40 CFR Part 68 (HF TQ 1,000 lbs toxic), and API RP 751 govern HF alkylation operations but do not address adversarial robustness for AI classifying rendered monitoring display images. Glyphward threshold 35 for HF alkylation unit AI: HF IDLH 30 ppm; TLV-C 0.5 ppm; ExxonMobil Torrance 2015 FCC explosion established that the adjacent HF alkylation unit, if struck, could have affected up to 125,000 surrounding residents (CSB finding); API RP 751 recognizes HF as a special-hazard chemical requiring dedicated SIS beyond normal refinery PSM compliance. Free tier — 10 scans/day, no card required.

Four adversarial injection surfaces in HF alkylation unit AI

1. Acid settler HF-hydrocarbon interface level display AI (UOP HF Alkylation APC AI, Phillips 66 HF Alkylation process AI, Honeywell Experion PKS acid settler AI — rendered DCS level indicator AI classifying the HF-hydrocarbon interface in the acid settler against HF carryover and acid underflow setpoints)

In the HF alkylation process, the alkylation reaction occurs in a liquid-liquid contactor where a dispersion of HF and hydrocarbon is maintained at 20–40°C; the reaction product (a mixture of alkylate, unreacted isobutane, HF, and acid-soluble oils (ASOs)) flows to an acid settler vessel where HF and hydrocarbon separate by gravity into two phases — a lower dense HF acid phase and an upper hydrocarbon phase. The HF-hydrocarbon interface level in the acid settler is a critical safety and product quality parameter: if the interface rises above the design level (HF phase too thick), HF entrains into the hydrocarbon overflow to the isobutane fractionator and propane splitter — contaminating downstream equipment with HF acid, exposing non-acid-rated piping and vessels to severe corrosion, and creating HF exposure risk during downstream maintenance. If the interface falls below the design level (HF phase too thin), hydrocarbon entrains into the HF recirculation to the contactor, reducing acid-to-hydrocarbon (A/HC) ratio and reducing alkylate quality. AI systems process rendered DCS level indicator display images — differential pressure level transmitter bar graphs, displacer float readouts, or nuclear density gauge displays — to classify acid settler interface state: normal operating range (design level ±10%), elevated approaching high-interface alarm (HF carryover risk), or low approaching low-interface alarm (acid starvation risk).

An adversarial perturbation targeting the acid settler HF-hydrocarbon interface level display AI applies a ±10 DN downward shift to the pixel region encoding the interface level bar and digital readout in the rendered DCS display image — shifting the apparent HF-hydrocarbon interface level from 68% of settler height (12% above the high-interface alarm at 56%, indicating the acid phase has grown thicker due to reduced acid regeneration column throughput following a partial blockage of the regenerator reboiler steam trap) to 49% (within normal operating range, no action). The AI classifies an acid settler accumulating excess HF phase — because acid regeneration is not removing acid-soluble oils fast enough to maintain the design acid phase thickness — as operating normally. HF-contaminated hydrocarbon overflows from the acid settler to the depropanizer and isobutane fractionation towers; HF at concentrations of 50–500 ppm in the hydrocarbon stream corrodes carbon steel piping and vessels above HF’s extremely low IDLH threshold; workers conducting routine valve or instrument maintenance in the downstream section encounter HF in the process stream. API RP 751 specifies that acid settler interface level measurement systems must include redundant level instruments with independent secondary indication — but does not specify adversarial robustness requirements for AI classifying rendered acid settler interface display images. Free tier — 10 scans/day, no card required.

2. HF acid strength analyzer display AI (UOP HF quality management AI, Valero HF alkylation acid strength AI, Honeywell Experion PKS HF quality AI — rendered acid titration or online density analyzer display AI classifying HF acid strength against the safe operating floor)

HF alkylation catalyst acid must be maintained above a minimum strength of approximately 85 wt% HF (the remainder being water, hydrofluoric acid-soluble oils (ASOs), and fluorinated organic by-products) to maintain adequate alkylation selectivity and acceptable product octane. Below 85 wt% HF: alkylation selectivity degrades rapidly, producing more acid-soluble oils (ASOs) than alkylate product, and the ASO accumulation further dilutes the acid strength in a self-reinforcing degradation cycle; below approximately 80 wt% HF, the acid acts primarily as a promoter of undesirable olefin polymerization rather than as an alkylation catalyst. Additionally, dilute HF (below 60 wt%) has dramatically increased corrosivity toward carbon steel: the corrosion rate of carbon steel in HF service (10–15 mpy at 88–92% HF acid) increases approximately 10× at 70% HF and 50–100× at 50% HF — because dilute HF corrodes carbon steel by an electrochemical mechanism that is suppressed in concentrated HF by formation of an iron fluoride passivation layer. AI systems process rendered acid strength analyzer display images — titration unit digital readouts, Coriolis density meter displays, or refractometer graphical readouts — to classify acid strength: within operating range (85–92%), approaching lower alarm (82–85%, increased acid regeneration or fresh acid addition required), or below safe operating floor (below 82%, process upset investigation required).

An adversarial perturbation targeting the HF acid strength analyzer display AI applies a ±8 DN upward shift to the pixel region encoding the acid strength readout in the rendered analyzer display image — shifting the apparent HF acid strength from 81.4 wt% (below the 82% lower alarm setpoint, indicating the acid circuit has accumulated excess ASO and water from a period of elevated olefin feed with high diene content, consuming HF faster than the acid regeneration column can remove impurities) to 87.8 wt% (well within normal operating range, no acid addition required). The AI classifies an HF alkylation unit operating below its safe acid strength floor — where continued operation accelerates ASO formation and further dilutes the acid — as running on-specification catalyst. Acid strength continues declining; below 80 wt% HF, the corrosion rate of carbon steel in the acid circuit increases by one to two orders of magnitude; piping in the acid recirculation loop (typically «1” to 3” carbon steel per API RP 751 material selection guidance) begins thinning; below 65 wt% HF, stress corrosion cracking of high-strength carbon steel components (vessel nozzles, valve bodies) can initiate hydrogen-induced cracking (HIC), potentially causing sudden brittle failure and an HF release. OSHA PSM 29 CFR 1910.119(j) requires mechanical integrity programmes for HF-containing equipment but does not address adversarial robustness for AI classifying rendered acid strength display images.

3. Acid-hydrocarbon contactor temperature display AI (UOP HF contactor APC AI, Honeywell Experion PKS contactor AI, AspenTech DMC3 HF contactor AI — rendered DCS temperature trend display AI classifying contactor temperature against HF vapour pressure and product quality setpoints)

The HF alkylation reaction is conducted at 20–40°C to maintain HF in liquid phase (HF boiling point 19.5°C at atmospheric pressure) while controlling product octane and minimising side reactions. Contactor temperature is maintained by circulating cold isobutane through the acid-hydrocarbon contactor to absorb the heat of reaction (alkylation is moderately exothermic, ∆H approximately −85 kJ/mol). Elevated contactor temperature has several adverse effects: above 40°C, HF vapour pressure increases significantly (HF vapour pressure at 40°C is approximately 800 mbar, compared to 380 mbar at 20°C — more than double), raising the partial pressure of HF in the vapour space of the contactor and the connected acid settler, increasing HF vapour inventory in equipment vapour spaces; above 45–50°C, propylene and butylene alkylation selectivity degrades, producing more acid-soluble oils and reducing alkylate octane; above 50°C, HF begins catalysing undesirable isobutane dehydrogenation reactions. AI systems process rendered DCS temperature trend display images — contactor temperature trend charts, temperature difference indicators between isobutane feed and contactor outlet — to classify thermal state: normal (25–35°C), elevated approaching high-temperature alarm (35–42°C, cooling capacity insufficient), or above alarm (above 42°C, urgent cooling restoration).

An adversarial perturbation targeting the acid-hydrocarbon contactor temperature display AI applies a ±8 DN downward shift to the pixel region encoding the contactor temperature trend in the rendered DCS display image — shifting the apparent contactor temperature from 44°C (2 degrees above the high-temperature alarm at 42°C, indicating the isobutane refrigerant cooling circuit has lost 30% of its capacity from a partially fouled refrigerant condenser following a week of high ambient temperatures) to 36°C (within normal operating range, no cooling system action). The AI classifies a contactor running above its design temperature — where the combination of elevated temperature and reduced acid-to-hydrocarbon ratio from the ASO accumulation noted above is accelerating product degradation — as operating normally. Contactor temperature continues rising; HF vapour pressure in the equipment system rises above design basis; any subsequent minor equipment seal leak, instrument connection, or valve stem packing failure releases higher-concentration HF vapour than at normal operating temperature; HF aerosol formation is more likely at elevated temperature because higher-concentration HF vapour in the air generates the dense aerosol observed at ambient temperature. API RP 751 Section 5 specifies contactor temperature monitoring instrumentation requirements but does not address adversarial robustness for AI classifying rendered contactor temperature trend images.

4. Acid relief header pressure display AI (UOP HF relief system AI, Valero HF alkylation relief AI, Honeywell Experion PKS HF pressure AI — rendered DCS relief header pressure trend display AI classifying acid relief system pressure against HF vapour release setpoints)

HF alkylation units incorporate dedicated acid relief systems — separate from the main hydrocarbon relief system — that collect vapour releases from pressure safety valves (PSVs) and emergency relief devices on the acid contactor, acid settler, acid regeneration column, and acid storage vessels, routing them through HF scrubbers (KOH or NaOH caustic scrubbers) to neutralize HF before atmospheric venting. The acid relief header pressure is normally held near atmospheric (0.0–0.5 mbar gauge) by the design of the low-pressure vapour collection system; any significant elevation in acid relief header pressure indicates either: an upstream PSV or emergency vent has opened and is routing HF vapour into the acid relief system (an active HF release scenario), or the acid scrubber system has a reduced throughput capacity (KOH solution exhausted or circulation pump failure). AI systems process rendered DCS acid relief header pressure trend display images to classify acid relief system state: normal (near atmospheric, no active relief), elevated approaching alarm (>5 mbar, relief system under load, investigate upstream), or high alarm (>15 mbar, active HF release to relief system, evacuate acid circuit area).

An adversarial perturbation targeting the acid relief header pressure display AI applies a ±10 DN downward shift to the pixel region encoding the relief header pressure trend bars in the rendered DCS display image — shifting the apparent acid relief header pressure from 18 mbar gauge (3 mbar above the high-alarm setpoint, indicating that the acid storage sphere PSV has lifted following a heating event from direct solar radiation on a hot summer afternoon raising the acid sphere vapour space pressure above the PSV set point of approximately 3 bar gauge) to 4 mbar (elevated approaching alarm — below the high-alarm threshold, investigation pending rather than immediate evacuation). The AI classifies an active HF release to the acid relief system as a minor pressure transient below the evacuation threshold. HF vapour continues releasing to the acid relief scrubber; if the scrubber KOH solution has been partially depleted, breakthrough HF exits the scrubber stack; HF at concentrations above 3 ppm in the downwind plume requires community shelter-in-place under EPA RMP worst-case scenario guidelines; workers in the refinery acid circuit area are exposed above IDLH (30 ppm) without donning supplied-air breathing apparatus. OSHA PSM 29 CFR 1910.119(e) (PHA) and EPA RMP worst-case analysis requirement both apply to HF release scenarios from relief systems — but neither framework specifies adversarial robustness requirements for AI classifying rendered acid relief header pressure display images.

Integration: HF alkylation unit AI with Glyphward pre-scan gate

The Glyphward scan gate for HF alkylation unit AI belongs at every rendered-image ingestion boundary in the HF unit monitoring and safety pipeline — before acid settler HF-hydrocarbon interface level display AI processes rendered level indicator images, before HF acid strength analyzer display AI processes rendered titration or density meter images, before acid-hydrocarbon contactor temperature display AI processes rendered temperature trend images, and before acid relief header pressure display AI processes rendered relief system pressure trend images. Threshold 35 for HF alkylation unit AI reflects HF’s position as arguably the single most community-threatening chemical in active refinery service: IDLH 30 ppm; TLV-C 0.5 ppm; EPA RMP worst-case toxic endpoint for a large HF release extends 1–3 miles from a typical refinery fence line; the ExxonMobil Torrance 2015 FCC explosion established that the adjacent HF alkylation unit, if struck by the approximately 40-pound metal fragment that passed 50 feet from the HF unit, could have caused an HF release affecting up to 125,000 surrounding residents (CSB Torrance investigation). API RP 751 dedicates a full recommended practice to HF alkylation safety — a level of industry-specific guidance that has no parallel for most other refinery unit operations — confirming that HF alkylation AI monitoring boundaries warrant the highest available Glyphward threshold.

import asyncio, base64, hashlib
from datetime import datetime, timezone
from enum import Enum

import httpx

GLYPHWARD_API_KEY = "YOUR_GLYPHWARD_API_KEY"
GLYPHWARD_SCAN_URL = "https://glyphward.com/v1/scan"

# HF alkylation unit AI contexts: threshold 35
# OSHA PSM 29 CFR 1910.119 (HF TQ: 1,000 lbs — among lowest in PSM Appendix A);
# EPA RMP 40 CFR Part 68 (HF TQ 1,000 lbs toxic); IDLH 30 ppm; TLV-C 0.5 ppm.
# API RP 751 Safe Operation of Hydrofluoric Acid Alkylation Units.
HF_ALKYLATION_THRESHOLD = 35


class HFAlkylationContext(Enum):
    ACID_SETTLER_INTERFACE = "acid_settler_interface"  # HF-HC interface level AI
    ACID_STRENGTH          = "acid_strength"           # HF wt% strength analyzer AI
    CONTACTOR_TEMPERATURE  = "contactor_temperature"   # Contactor temperature AI
    RELIEF_HEADER_PRESSURE = "relief_header_pressure"  # Acid relief header pressure AI


class AdversarialHFAlkylationImageError(Exception):
    """Raised when Glyphward detects adversarial content in an HF alkylation unit
    AI rendered image above threshold 35.

    Consequence if not raised:
    - ACID_SETTLER_INTERFACE: HF carryover to downstream hydrocarbon equipment
      → HF in non-acid-rated piping → corrosion → personnel HF exposure.
    - ACID_STRENGTH: acid below 85 wt% suppressed → ASO accumulation → acid
      falls below 65% → carbon steel corrosion 50–100× normal rate → brittle
      failure → HF release; EPA RMP worst-case toxic endpoint 1–3 miles.
    - CONTACTOR_TEMPERATURE: elevated temperature suppressed → HF vapour pressure
      rises → any seal leak releases higher-concentration HF aerosol.
    - RELIEF_HEADER_PRESSURE: active PSV lift suppressed → HF to scrubber above
      capacity → breakthrough → community-scale HF plume (TLV-C 0.5 ppm);
      ExxonMobil Torrance 2015: adjacent HF unit could have affected 125,000 residents.
    Fail-safe: read acid strength from independent grab sample titration;
    confirm settler interface from independent secondary level instrument per
    API RP 751 redundancy requirement; verify relief header pressure from
    independent pressure transmitter not shared with DCS AI input.
    """

    def __init__(self, scan_id, score, context, unit_id, flagged_region=None):
        self.scan_id = scan_id
        self.score = score
        self.context = context
        self.unit_id = unit_id
        self.flagged_region = flagged_region
        super().__init__(
            f"Adversarial HF alkylation image: context={context.value} "
            f"score={score} unit={unit_id} scan_id={scan_id}"
        )


async def scan_hf_alkylation_image(image_bytes, context, unit_id, client):
    image_hash = hashlib.sha256(image_bytes).hexdigest()
    payload = {
        "image": base64.b64encode(image_bytes).decode(),
        "source": f"hf_alkylation:{context.value}:{unit_id}",
        "metadata": {
            "unit_id": unit_id,
            "context": context.value,
            "image_sha256": image_hash,
            "scan_timestamp_utc": datetime.now(timezone.utc).isoformat(),
        },
    }
    resp = await client.post(
        GLYPHWARD_SCAN_URL,
        headers={"Authorization": f"Bearer {GLYPHWARD_API_KEY}"},
        json=payload,
        timeout=4.0,
    )
    resp.raise_for_status()
    result = resp.json()
    if result.get("score", 0) >= HF_ALKYLATION_THRESHOLD:
        raise AdversarialHFAlkylationImageError(
            scan_id=result["scan_id"],
            score=result["score"],
            context=context,
            unit_id=unit_id,
            flagged_region=result.get("flagged_region"),
        )
    return result


async def main():
    async with httpx.AsyncClient() as client:
        with open("acid_settler_interface_screenshot.png", "rb") as f:
            image_bytes = f.read()
        result = await scan_hf_alkylation_image(
            image_bytes,
            HFAlkylationContext.ACID_SETTLER_INTERFACE,
            unit_id="UNIT-HF-001",
            client=client,
        )
        print(f"Clean scan: {result['scan_id']} score={result['score']}")


asyncio.run(main())

Frequently asked questions

What happened at the ExxonMobil Torrance refinery in February 2015 and why is it relevant to HF alkylation unit AI?
On 18 February 2015, an ESP on the FCC unit at ExxonMobil Torrance projected a ~40 lb metal fragment 50 feet from the HF alkylation unit. The CSB concluded that a direct hit could have triggered an HF release affecting up to 125,000 surrounding residents. This established the community-scale consequence anchor for HF alkylation AI misclassification scenarios.
Why does HF alkylation use hydrofluoric acid?
HF offers lower acid consumption, on-site regeneration, and lower capital cost vs. H₂SO₄ alkylation. The trade-off is HF’s extreme acute toxicity (IDLH 30 ppm), dense aerosol formation at atmospheric release, and EPA RMP community impact radius of 1–3 miles — making HF the most community-hazardous chemical in routine refinery service.
What does API RP 751 require for HF unit instrumentation?
Redundant acid settler interface instruments (two independent measurement technologies), dedicated HF circuit SIS with automated acid block valve closure, HF detector networks, water curtain/deluge systems, and dedicated acid relief scrubbers. API RP 751 does not address adversarial robustness for AI classifying rendered monitoring display images.
Why is HF more community-hazardous than H₂SO₄ alkylation?
HF above 48 wt% forms a dense ground-hugging aerosol; TLV-C is 0.5 ppm; skin contact causes fatal systemic fluoride toxicity; EPA RMP worst-case toxic endpoint extends 1–3+ miles. H₂SO₄ mist IDLH is typically confined within fence line.
Why threshold 35 for HF alkylation unit AI?
HF is the highest community-consequence-per-release chemical in routine refinery service. IDLH 30 ppm, TLV-C 0.5 ppm, EPA RMP radius 1–3 miles, Torrance 2015 CSB finding of 125,000-resident impact potential. API RP 751 existing as a standalone dedicated practice confirms this hazard level requires the highest available Glyphward threshold.