“The supply of working dogs in Europe is strained from all the demand,” said Erik Wilsson, an animal behaviorist who retired in June from his job managing dog breeding for the Swedish Armed Forces. “The U.S. is buying a lot of dogs and, for sure, you’re not getting the best ones. It’s not about finding the dogs you need — it’s finding the good dogs,” which countries like Germany, he said, are keeping for themselves and breeders in less prosperous countries sell to the highest bidder.

It’s why, Dr. Wilsson said, Sweden in 2005 reinstated its military dog-breeding program, which had been disbanded in the ’90s. “The program was brought down because decision makers thought private breeders could do it, but after a couple of years the military and police had huge problems finding high-quality dogs,” he said.

Indeed, T.S.A. agents and United States Army officers who go on overseas buying trips say they are lucky if they look at 110 dogs and have 50 pass their preliminary behavioral and medical screenings. Of those dogs, another 15 to 20 percent don’t make it through training in the United States to be put into service. The ones that wash out are shopped to other agencies or put up for adoption.

“We are looking for the SEAL team of dogs,” Mr. Thomas said, referring to the Navy’s elite special forces unit.

Contributing to the high failure rate is the fact that the dogs aren’t purchased until they are around 1 or 2 years old, when they are mature enough for the rigorous training. While they may come from fine stock, there’s no telling how they were raised or what neuroses they may have developed. According to Karen Overall, a veterinarian and senior research scientist at the University of Pennsylvania who has studied canine behavior for the Department of Defense, early life experience can make or break a dog, “just as it can for a human being.”

“We are supporting a giant puppy mill industry in Europe, which is producing less than optimal dogs,” Dr. Overall said. “What you’re getting is a dog that has probably been fairly roughly handled, certainly is scared and, our data shows, can be fairly hyper-reactive, and those aren’t going to be the best dogs.”