At Office Depot, employees have been told that they cannot wear masks in the store. Some Walgreens workers say they were also discouraged from wearing them. Many other large retailers, including Target, have started to allow masks, but are leaving it up to employees to procure their own supplies.

Federal health officials appear ready to recommend that Americans of all ages start wearing masks for protection against the coronavirus, but millions of retail workers have been interacting with the public for weeks without them. Sometimes, they have been told that wearing masks could scare shoppers. Now many are scrambling to find available gear.

The retailers’ different positions on masks, which follow those of the government, are indicative of how the industry has been fumbling through the fast-moving pandemic, potentially endangering workers. The restrictions could also increase the risk that their stores, which are virtually the only places where the public can still congregate, could be contributing to the spread of the virus.

Protective gear has become a point of contention in the increasingly tense environment at grocery and big-box stores. This week, workers at Amazon and Instacart staged protests over working conditions during the pandemic, and walkouts are planned at other major retailers in the coming days. Many retailers are being pressured to take even more precautions than regulators have advised.