In the program, the workers are trained in practices that enhance food safety — from not wearing jewelry that might fall into boxes of berries to spotting signs of contaminants and insects or other pests that might spoil crops. These practices can reduce the use of pesticides, something that the environmental groups participating in the project are pushing for.

Like many growers, Andrew & Williamson says it gets just 9 cents of each dollar that its strawberries sell for at retail. With most of the revenue going to retailers, the farm workers and the company were eager to increase their meager share. So when Erik Nicholson, vice president of the United Farm Workers, met with Mr. Lyons at Costco, he learned that food safety was a top issue for consumers, and the two embarked on a plan to improve conditions. They brainstormed and came up with a proposal that would increase workers’ pay and growers’ profits as well as improve safety.

“We thought, What if we started educating workers to make them a little more aware of things like listeria and salmonella, potential pest issues like birds and wild pigs, the danger to their own health and the environment of overusing pesticides?” Mr. Lyons said. “Such training would make an impact that’s positive for the consumer and increase productivity for growers.”

Mr. Lyons floated the plan with some of Costco’s biggest produce suppliers at a conference, explaining that because the workers would be responsible for delivering better, safer fruits and vegetables, they deserved better pay. “Jeff introduced the project and started listing all these wacko socialists who were involved,” Mr. Farley of Andrew & Williamson said, teasingly pointing an elbow at Mr. Nicholson. “Hearing those names was scary to most of the people in that room, but Jeff made it clear Costco believed this was the right thing to do — and Costco is a big customer.”

In the past, workers had little incentive to report safety problems. They were paid at a piece rate, seeking to fill their boxes as fast as they could, and taking even 10 minutes to report a safety problem would in effect reduce their pay. One manager said that if workers spotted animal feces in an area where ripe strawberries were ready to be plucked, they might have still simply picked those berries.

Pedro Sanchez, a farmworker, said he liked that the program encouraged pickers to tell supervisors about any safety issues in the fields. And now they know their above-average pay is also tied to the success of this food safety initiative.