In an expanding effort by the meat industry to make its hamburger safe, officials at the retail giant Costco said Wednesday that they had struck a new accord on testing for the pathogen E. coli.

Costco’s food safety director, Craig Wilson, said the company would begin buying beef trimmings for making hamburger from Tyson, one of the largest beef producers, after an agreement reached with Tyson this week that allows Costco to test the trimmings before they are mixed with those from other suppliers.

The United States Department of Agriculture has encouraged such testing as a way to make hamburger safer, but some of the largest slaughterhouses have resisted the added scrutiny for fear that one grinder’s discovery of E. coli will lead to expanded recalls of beef sent to other grinders, The New York Times reported Sunday.

Costco is one of the few large grinders to test ingredients for the pathogen as they arrive at its plant, and Mr. Wilson said Tyson had declined to sell trimmings to the company, citing its testing.