ImportanceBehavioral flags in the electronic health record (EHR) are designed to alert clinicians of potentially unsafe or aggressive patients. These flags may introduce bias, and understanding how they are used is important to ensure equitable care.ObjectiveTo investigate the incidence of behavioral flags and assess whether there were differences between Black and White patients and whether the flags were associated with differences in emergency department (ED) clinical care.Design, Setting, and ParticipantsThis was a retrospective cohort study of EHR data of adult patients (aged ≥18 years) from 3 Philadelphia, Pennsylvania, EDs within a single health system between January 1, 2017, and December 31, 2019. Secondary analyses excluded patients with sickle cell disease and high ED care utilization. Data were analyzed from February 1 to April 4, 2022.Main Outcomes and MeasuresThe primary outcome of interest was the presence of an EHR behavioral flag. Secondary measures included variation of flags across sex, race, age, insurance status, triage status, ED clinical care metrics (eg, laboratory, medication, and radiology orders), ED disposition (discharge, admission, or observation), and length of key intervals during ED care.ResultsParticipating EDs had 195 601 eligible patients (110 890 [56.7%] female patients; 113 638 Black patients [58.1%]; 81 963 White patients [41.9%]; median [IQR] age, 42 [28-60] years), with 426 858 ED visits. Among these, 683 patients (0.3%) had a behavioral flag notification in the EHR (3.5 flags per 1000 patients), and it was present for 6851 ED visits (16 flagged visits per 1000 visits). Patient differences between those with a flag and those without included male sex (56.1% vs 43.3%), Black race (71.2% vs 56.7%), and insurance status, particularly Medicaid insurance (74.5% vs 36.3%). Flag use varied across sites. Black patients received flags at a rate of 4.0 per 1000 patients, and White patients received flags at a rate of 2.4 per 1000 patients (P < .001). Among patients with a flag, Black patients, compared with White patients, had longer waiting times to be placed in a room (median [IQR] time, 28.0 [10.5-89.4] minutes vs 18.2 [7.2-75.1] minutes; P < .001), longer waiting times to see a clinician (median [IQR] time, 42.1 [18.8-105.5] minutes vs 33.3 [15.3-84.5] minutes; P < .001), and shorter lengths of stay (median [IQR] time, 274 [135-471] minutes vs 305 [154-491] minutes; P = .01). Black patients with a flag underwent fewer laboratory (eg, 2449 Black patients with 0 orders [43.4%] vs 441 White patients with 0 orders [36.7%]; P < .001) and imaging (eg, 3541 Black patients with no imaging [62.7%] vs 675 White patients with no imaging [56.2%]; P < .001) tests compared with White patients with a flag.Conclusions and RelevanceThis cohort study found significant differences in ED clinical care metrics, including that flagged patients had longer wait times and were less likely to undergo laboratory testing and imaging, which was amplified in Black patients.