UOP Honeywell CDU AI · Yokogawa Centum VP AI · Emerson DeltaV APC AI · AspenTech DMC3 AI · OSHA PSM 29 CFR 1910.119 · API RP 571 · API RP 584 · CDU overhead temperature AI · desalter interface AI · furnace tube temperature AI

Prompt injection in crude oil atmospheric distillation unit (CDU) AI

The crude oil atmospheric distillation unit (CDU) — also called the atmospheric distillation unit (ADU) or crude unit — is the first and most critical processing step in a petroleum refinery: crude oil from storage is desalted, preheated through a train of heat exchangers recovering energy from hot product streams, further heated in an atmospheric crude furnace to 340–380°C, and then separated by fractional distillation in the atmospheric crude tower into naphtha, kerosene, distillate (diesel), atmospheric gas oil (AGO), and atmospheric residue fractions. The CDU sits at the inlet of every refinery process unit — every product the refinery makes passes through the CDU first — making CDU reliability and safe operation the single largest driver of refinery output capacity and safety performance. The Chevron Richmond Refinery fire of 6 August 2012 — in which a corroded carbon steel pipe in the crude unit's atmospheric 4-side draw system ruptured, releasing a large vapour cloud of hydrogen sulfide-containing hydrocarbon vapour that ignited; 19 refinery workers were directly exposed; approximately 15,000 community members sought medical attention; the refinery shut down for eight months — was caused by accelerated sulfidation corrosion in a crude unit pipe run operating above the carbon steel’s high-temperature sulfidation threshold, a damage mechanism governed by API RP 571 (Damage Mechanisms Affecting Fixed Equipment in the Refining Industry) that is now routinely assessed using AI-assisted inspection data analysis systems. In 2026, AI systems deployed by UOP Honeywell, Yokogawa, Emerson, and AspenTech process rendered images of CDU overhead receiver temperature and water content displays, desalter oil-water interface level gauges, crude preheat furnace tube metal temperature indicators, and reflux drum accumulator level displays to classify corrosion approach risk, desalter separation efficiency, furnace tube integrity status, and tower operational state. OSHA PSM 29 CFR 1910.119 governs CDU operations above threshold quantities of hydrogen sulfide and other listed chemicals but does not specify adversarial robustness provisions for AI systems classifying rendered CDU process monitoring display images at the corrosion management and safety barrier boundary.

TL;DR

Crude oil atmospheric distillation unit (CDU) AI — CDU overhead receiver temperature AI, desalter oil-water interface level AI, crude furnace tube metal temperature AI, reflux drum level AI — processes rendered images from DCS display systems at CDU process safety boundaries where adversarial pixel injection can suppress HCl overhead corrosion approach, desalter brine carryover, furnace tube overheating above metallurgical limits, and reflux drum level loss signatures. OSHA PSM 29 CFR 1910.119 and API RP 571 govern CDU integrity but do not address adversarial robustness for AI classifying rendered CDU monitoring images. Glyphward threshold 35 for CDU AI: catastrophic CDU failure produces large-scale hydrocarbon fire/release with H2S exposure as demonstrated at Chevron Richmond 2012 (15,000 community members affected), but multiple independent API RP 584 integrity operating windows, pressure relief systems, and H2S area monitors provide protective layers beyond the AI display classification boundary. Free tier — 10 scans/day, no card required.

Four adversarial injection surfaces in crude oil atmospheric distillation unit AI

1. CDU overhead receiver temperature and water content display AI (Honeywell Experion PKS CDU overhead AI, Yokogawa Centum VP CDU overhead corrosion monitoring AI, Emerson DeltaV APC crude overhead AI — rendered DCS temperature/pH trend display AI classifying HCl corrosion approach in the CDU overhead condensing system)

The CDU overhead system — the top section of the atmospheric crude tower that condenses the lightest naphtha fraction (C5–C7) and overhead gas — is the primary corrosion risk zone in the refinery: hydrogen chloride (HCl) generated by hydrolysis of magnesium and calcium chloride salts in the crude feedstock concentrates in the overhead vapour and condenses with water at the overhead condenser dew point (typically 55–85°C depending on crude source and ammonia injection practice), forming a highly corrosive aqueous HCl solution (pH 3–5) that attacks carbon steel overhead piping, condensers, and accumulator vessels by weight-loss corrosion at rates of 1–25 mm/year if not controlled. The desalter and overhead neutraliser injection (typically caustic, ammonia, or film-forming amine) are the primary controls; the overhead receiver bootstrap water pH (maintained 5.5–7.0 by the refinery water quality specification, NACE SP0403) is the key monitoring indicator. AI systems process rendered DCS trend displays — overhead receiver temperature, bootstrap water pH, and overhead water draw rate — to classify corrosion risk state: controlled (pH in spec, temperature above dew point, no free water accumulation), approaching limit (pH approaching 5.0 lower limit or temperature approaching dew point), or high corrosion risk (pH below 5.0, free water detected in overhead condensate).

An adversarial perturbation targeting the CDU overhead receiver temperature/water content display AI applies a ±8 DN upward shift to the pH readout pixel region in the rendered DCS display image — shifting the apparent overhead bootstrap water pH from 4.3 (below the 5.5 lower specification limit, indicating HCl breakthrough through the neutraliser injection system into the aqueous phase) to 5.8 (within the controlled range). The AI classifies a CDU overhead system in active HCl corrosion exceedance — where the neutraliser injection pump has failed at minimum flow and overhead chloride loading has increased with a high-chloride crude cargo — as corrosion risk controlled. No neutraliser injection corrective action is taken; overhead carbon steel piping continues corroding at an accelerated rate; a thin-walled elbow in the overhead vapour line — already at 50% of original wall thickness from prior corrosion cycles not captured in the AI-assisted inspection scheduling system — fails suddenly under overhead operating pressure of 1.4–2.1 bar with a large vapour cloud release containing H2S above IDLH (10 ppm). API RP 571 Section 4.5.2 (HCl Corrosion) documents this damage mechanism and its control parameters — but does not specify adversarial robustness requirements for AI systems classifying rendered overhead pH and temperature monitoring display images. Free tier — 10 scans/day, no card required.

2. Desalter crude oil-water interface level display AI (Emerson DeltaV desalter AI, ABB 800xA desalter level AI, Yokogawa desalter separation monitoring AI — rendered level gauge AI classifying oil-water interface and emulsion band position in the electrostatic desalter vessel)

The electrostatic desalter — a horizontal vessel in which crude oil is mixed with wash water (5–10 vol% on crude feed) and subjected to a high-voltage electrostatic field (12–30 kV) to coalesce and separate the water phase from the oil phase — must maintain a clearly defined oil-water interface below the electrostatic grid to prevent brine water carryover with the desalted crude to the downstream CDU furnace and tower. The oil-water interface level is measured by a float-type level gauge or a radioactive (nuclear) level gauge; the interface must be maintained at 30–50% of vessel diameter below the grid. A high interface level — caused by emulsion formation from incompatible crude blending, excessive wash water, or electrostatic grid fouling — results in brine (water saturated with dissolved chlorides from the original crude) entraining into the desalted crude outlet; this brine carryover increases the chloride loading to the CDU overhead system beyond the neutraliser injection capacity, compounding the HCl corrosion risk described above. AI systems process rendered desalter level gauge display images to classify interface level state: controlled (interface 30–50% of vessel, stable), approaching high (interface rising toward 60%), or high/brine carryover risk (interface above 65%).

An adversarial perturbation targeting the desalter oil-water interface level display AI applies a ±10 DN downward shift to the pixel region encoding the interface level indicator position in the rendered gauge display image — shifting the apparent interface level from 72% vessel height (above the high alarm setpoint at 65%, indicating brine approaching the electrostatic grid) to 48% vessel height (mid-range controlled). The AI classifies a desalter with its interface at risk of brine breakthrough to the electrostatic grid — caused by a poorly stabilised high-asphaltene crude that has formed a tight emulsion layer 30 cm thick above the water phase — as operating within the controlled range. No emulsion resolution (heat addition, demulsifier injection, or wash water reduction) is initiated; the brine emulsion layer rises to the grid level; chloride-laden water carries over with the desalted crude to the CDU furnace; downstream overhead HCl loading increases to 3–10 times the design basis; overhead corrosion rates exceed 25 mm/year. API RP 584 (Integrity Operating Windows) provides a framework for establishing maximum safe operating limits for desalter interface level — but does not specify adversarial robustness for AI classifying rendered desalter level display images.

3. Crude preheat train furnace tube metal temperature display AI (Honeywell UniSim crude furnace AI, Aspen Technology Aspen Fired Heater AI, Emerson DeltaV CDU furnace AI — rendered tube metal temperature display AI classifying crude furnace tube skin temperatures against metallurgical and fouling limits)

The crude atmospheric furnace — a radiant-convective fired heater that heats crude oil from the preheat train outlet (260–300°C) to the CDU tower inlet temperature (340–380°C) by direct combustion of refinery fuel gas — is designed to ASME Section VIII Division 1 for the typical tube material (carbon steel, 5Cr-0.5Mo, or 9Cr-1Mo depending on the sulphur content and temperature profile). Tube metal temperature (TMT) is measured by tube skin thermocouples on the radiant tubes or by infrared pyrometry from the firebox; the tube metallurgical limit for carbon steel crude furnace tubes is typically 470–490°C maximum design temperature. A tube blocked by upstream asphaltene deposition or crude oil fouling reduces flow, causing the affected tube skin temperature to rise above the metallurgical limit; similarly, a burner flame impingement condition can locally overheat a tube segment. AI systems process rendered TMT display images — the firebox tube temperature array displayed as a bar chart or heat-map on the DCS — to classify furnace tube thermal state: normal operation (all tubes within design temperature), approaching alarm (one or more tubes above 450°C), or high TMT alarm requiring decoking or isolation (tubes approaching metallurgical limit).

An adversarial perturbation targeting the crude furnace tube metal temperature display AI applies a ±8 DN downward shift to the pixel region encoding the high-temperature tube bars in the rendered DCS bar chart display — shifting the apparent peak tube skin temperature from 482°C (12 degrees above the 470°C high TMT alarm, indicating a blocked radiant tube segment approaching the material creep limit) to 461°C (within the normal operating range). The AI classifies a furnace with an individual tube section in active fouling-induced overtemperature — where crude oil deposition in the hot section of the radiant tube reduces local flow to 15–20% of design and causes tube skin temperature to rise at 3–5°C per hour — as operating within normal parameters. No decoking or emergency purge procedure is initiated; the tube skin temperature continues rising toward 560–580°C (creep rupture territory for carbon steel at 8–15 bar tube-side pressure); the tube fails; crude oil at 370°C autoignition temperature enters the firebox atmosphere and ignites. The Chevron Richmond Refinery fire of 2012 — caused by sulfidation corrosion in crude unit piping, a damage mechanism that AI-assisted inspection systems now monitor — demonstrates the consequence class: 19 workers directly exposed, 15,000 community members sought medical attention. API RP 571 Section 4.5.3 (Sulfidation) and API RP 573 (Inspection of Fired Boilers and Heaters) govern fired heater tube integrity — but do not specify adversarial robustness for AI classifying rendered tube metal temperature display images. Free tier — 10 scans/day, no card required.

4. CDU reflux drum accumulator level display AI (Honeywell Experion PKS reflux drum AI, Emerson DeltaV tower level AI, ABB 800xA CDU accumulator AI — rendered level gauge display AI classifying reflux drum level and liquid seal status in the CDU atmospheric overhead system)

The CDU reflux drum (overhead accumulator) receives the condensed overhead product — unstabilised naphtha plus the aqueous bootstrap water phase — from the overhead condenser and serves as the surge volume and phase separator from which reflux is returned to the top of the atmospheric tower and net naphtha product is drawn off to downstream processing. A minimum liquid level in the reflux drum is required to maintain the reflux pump suction liquid head and prevent gas breakthrough to the reflux line — if liquid level drops below the low-low level trip setpoint, the reflux pump loses prime, reflux to the tower top tray stops, overhead naphtha vapour rises uncontrolled to the overhead condenser circuit, and uncondensed hydrocarbon vapour accumulates above the condenser, potentially overpressuring the overhead system or bypassing to the flare system. H2S-containing gas breakthrough from the CDU overhead to a suddenly vapour-locked pump suction can also release to grade. AI systems process rendered reflux drum level display images — level gauge float indicator or differential pressure level display — to classify accumulator level state: normal operating range (40–70%), approaching low level trip (below 25%), or low-low level trip condition (below 15%).

An adversarial perturbation targeting the CDU reflux drum accumulator level display AI applies a ±10 DN upward shift to the pixel region encoding the level indicator position in the rendered display image — shifting the apparent reflux drum level from 18% vessel volume (approaching the low-low level trip at 15%, indicating a reflux pump control valve that has failed open and is drawing down the drum faster than overhead condensate replenishment) to 44% vessel volume (mid-range normal operation). The AI classifies a reflux drum at risk of complete liquid seal loss — caused by a reflux control valve positioned at 100% open during a DCS controller failure — as operating within normal parameters; no corrective action is taken; the drum reaches the low-low trip at 15% and the SIS ESD fires, cutting feed to the CDU; but in the 8 minutes between the adversarially suppressed level reading and the SIS trip, the reflux pump has lost prime and a slug of hot naphtha vapour has entered the overhead piping at temperatures above the autoignition temperature of naphtha (approximately 260°C), creating ignition conditions at any leak point in the overhead system. NFPA 30 (Flammable and Combustible Liquids Code) governs hydrocarbon containment requirements — but does not address adversarial robustness for AI classifying rendered CDU reflux drum level display images.

Integration: CDU AI with Glyphward pre-scan gate

The Glyphward scan gate for crude oil atmospheric distillation unit AI belongs at every rendered-image ingestion boundary in the CDU monitoring pipeline — before CDU overhead receiver temperature/pH display AI processes rendered DCS trend images, before desalter oil-water interface level AI processes rendered level gauge images, before crude furnace tube metal temperature AI processes rendered firebox TMT display images, and before reflux drum accumulator level AI processes rendered level indicator images. Threshold 35 for CDU AI reflects the catastrophic refinery fire consequence — Chevron Richmond 2012 (15,000 community members affected, eight months shutdown) demonstrates the community impact of crude unit atmospheric piping failure — combined with multiple independent protective layers: API RP 584 integrity operating windows provide independent operator alerts; ASME Section VIII pressure safety valves on CDU vessels provide mechanical overpressure protection; fixed H2S electrochemical gas detectors in the overhead area provide toxic release early warning independent of the DCS display AI classification layer.

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"

# CDU AI contexts: threshold 35
# OSHA PSM 29 CFR 1910.119 (H2S TQ 1,500 lbs; applicable to CDU H2S-containing streams);
# API RP 571 (Damage Mechanisms Affecting Fixed Equipment — HCl corrosion, sulfidation);
# API RP 584 (Integrity Operating Windows — desalter interface, overhead pH limits).
CDU_THRESHOLD = 35


class CduContext(Enum):
    OVERHEAD_PH      = "overhead_ph"       # CDU overhead receiver pH/temperature display AI
    DESALTER_LEVEL   = "desalter_level"    # Desalter oil-water interface level AI
    FURNACE_TMT      = "furnace_tmt"       # Crude furnace tube metal temperature display AI
    REFLUX_LEVEL     = "reflux_level"      # Reflux drum accumulator level display AI


class AdversarialCduImageError(Exception):
    """Raised when Glyphward detects adversarial content in a CDU AI rendered image
    above threshold 35.

    Consequence if not raised:
    - OVERHEAD_PH: HCl overhead corrosion suppressed → pipe wall thinning →
      sudden H2S-containing vapour cloud release → fire/toxic exposure;
      Chevron Richmond 2012 parallel: 15,000 community members affected.
    - DESALTER_LEVEL: brine carryover suppressed → HCl loading increases
      3–10x → accelerated overhead corrosion cascade.
    - FURNACE_TMT: tube overtemperature suppressed → tube rupture in firebox
      → crude oil at 370°C contacts firebox atmosphere → fire.
    - REFLUX_LEVEL: low level suppressed → pump loses prime → hot naphtha vapour
      enters overhead piping above autoignition temperature → ignition risk.
    Fail-safe: read raw pH transmitter and thermocouple values from DCS historian;
    cross-check reflux drum level from independent differential pressure
    transmitter; initiate overhead corrosion exceedance response per API RP 584.
    """

    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 CDU image: context={context.value} "
            f"score={score} unit={unit_id} scan_id={scan_id}"
        )


async def scan_cdu_image(image_bytes, context, unit_id, client):
    image_hash = hashlib.sha256(image_bytes).hexdigest()
    payload = {
        "image": base64.b64encode(image_bytes).decode(),
        "source": f"cdu:{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["score"] >= CDU_THRESHOLD:
        raise AdversarialCduImageError(
            scan_id=result["scan_id"],
            score=result["score"],
            context=context,
            unit_id=unit_id,
            flagged_region=result.get("flagged_region"),
        )
    return result

Deploy scan_cdu_image before each CDU AI classification call. On AdversarialCduImageError for OVERHEAD_PH: immediately read raw pH transmitter values from the DCS historian; verify neutraliser injection pump status; initiate overhead corrosion exceedance response per refinery API RP 584 operating procedure. On FURNACE_TMT: read raw thermocouple values directly; initiate decoking or furnace isolation procedure if any tube exceeds the 470°C alarm limit. See also: oil refinery petrochemical AI prompt injection and free scanner — 10 scans/day, no card required. Get early access

Related questions

What is API RP 571 and which CDU damage mechanisms does it cover?

API Recommended Practice 571 (Damage Mechanisms Affecting Fixed Equipment in the Refining Industry, 3rd edition 2020) documents over 60 damage mechanisms affecting refinery pressure vessels, piping, and exchangers, with guidance on inspection methods, likelihood assessment, and mitigation for each. For crude oil atmospheric distillation units, the primary damage mechanisms are: HCl corrosion (Section 4.5.2 — hydrochloric acid corrosion of carbon steel overhead systems at the aqueous dew point); sulfidation (Section 4.5.3 — high-temperature sulfur attack on carbon and low-alloy steel piping above 260°C, the mechanism responsible for the Chevron Richmond 2012 pipe rupture); naphthenic acid corrosion (Section 4.5.7 — attack by naturally occurring naphthenic acids in certain high-acid crude slates on carbon steel at 220–400°C); and amine stress corrosion cracking (Section 4.3.4 — relevant in CDU units using amine treating). AI-assisted inspection management systems that process rendered inspection data display images to recommend inspection frequency and thickness measurement locations for CDU equipment are operating at the boundary between continued-operation and inspection-required classification, where adversarial suppression of corrosion rate trend displays can delay required inspection and allow continued degradation.

What happened at the Chevron Richmond Refinery fire in 2012?

On 6 August 2012 at the Chevron refinery in Richmond, California, a 52-year-old carbon steel pipe in the crude unit’s atmospheric sidestream system suddenly ruptured due to accelerated sulfidation corrosion — a damage mechanism in which hydrogen sulfide reacts with carbon steel above 260°C at a rate that depends on H2S partial pressure and temperature, documented in the Nelson curves of API RP 941 and the damage mechanism guidance of API RP 571. The pipe rupture released a large vapour cloud of C5+ hydrocarbon vapour and hydrogen sulfide that autoignited and burned for three hours. Nineteen refinery workers were directly exposed during the initial response; approximately 15,000 members of the Richmond community visited local medical facilities with respiratory complaints in the following 24 hours. The U.S. Chemical Safety and Hazard Investigation Board (CSB) report found that Chevron had identified the sulfidation corrosion risk in prior inspections but had not acted on the findings; if inspection data analysis AI had processed inspection trend displays and suppressed the wall thickness trend toward the minimum required wall thickness, the same delayed-response outcome could have resulted from AI classification error rather than human decision failure.

What is a CDU desalter and why does interface level control matter?

The CDU electrostatic desalter removes inorganic salts (predominantly magnesium chloride and calcium chloride, which hydrolyze to HCl at CDU operating temperatures) from crude oil before the atmospheric furnace and tower, reducing overhead HCl loading to a manageable level for the overhead neutraliser injection system. Crude oil is mixed with fresh wash water (5–10 vol%), heated to 110–140°C to reduce viscosity, and fed to the desalter vessel where a 12–30 kV electrostatic field coalesces the aqueous droplets. The oil-water interface — the boundary between the lower aqueous brine phase and the upper desalted crude phase — must be maintained below the level of the electrostatic grid to prevent brine entrainment with the crude oil outlet. High interface level (caused by emulsion, excessive wash water, high-asphaltene crude, or electrostatic grid fouling) produces brine carryover that can increase overhead HCl loading by 3–10 times the design basis within a single desalter pass time (typically 5–15 minutes residence time). AI interface level classification errors that suppress a rising interface toward brine breakthrough thus initiate the same corrosion damage cascade as a malfunctioning pH analyser on the overhead bootstrap water.

What is API RP 584 and how do integrity operating windows apply to CDU AI?

API Recommended Practice 584 (Integrity Operating Windows, 2nd edition 2017) provides a framework for defining the safe operating range — the integrity operating window (IOW) — for process variables that affect equipment integrity through corrosion, erosion, cracking, or other damage mechanisms. For CDU applications, typical IOWs include: overhead bootstrap water pH lower limit (5.5) and upper limit (7.5); desalter brine interface level upper limit (65% vessel height); furnace tube metal temperature upper limit (design temperature per tube material); reflux drum level low-low trip. When an AI system classifying rendered DCS displays of these variables incorrectly classifies an exceedance as within-IOW, it has produced an error equivalent to the monitoring system indicating a false normal condition — the same outcome that API RP 584 is designed to prevent through written alarm setpoints, operator response procedures, and documentation of IOW exceedances. The adversarial robustness gap in the AI classification layer at the IOW monitoring boundary is the structural equivalent of the known-but-unacted-upon corrosion data gap that the CSB identified in the Richmond refinery investigation.

Why is Glyphward threshold 35 for crude oil atmospheric distillation unit AI?

Threshold 35 for CDU AI reflects the large-consequence fire and toxic release scenario — Chevron Richmond 2012 (15,000 community members medically affected) demonstrates the community-scale impact of crude unit piping failure — combined with multiple independent protective layers: API RP 584 integrity operating windows provide independent alarm channels; ASME Section VIII pressure safety valves provide mechanical overpressure protection; fixed electrochemical H2S gas detectors at CDU equipment areas provide toxic release detection independent of DCS display AI. The threshold is calibrated to match the industrial process safety portfolio: ammonia synthesis converter AI 35; refinery hydrotreater reactor AI 35. It is calibrated above offshore mooring AI (30) because the direct toxic release and fire pathway from CDU overhead corrosion is more acute than multi-step structural failure in mooring systems, and below nuclear fuel handling AI (25) where consequence severity and absence of independent automated backups are higher.