Riley, a 12-week-old Weimaraner, is hardly the first pup to have job responsibilities far beyond “fetch” and “sit” and “get off the couch.”

But he appears to be the first to be trained specifically to detect moths and other pests that could damage high-value artwork in a museum.

“It’s really a trial, pilot project. We don’t know if he’s going to be good at it,” said Katie Getchell, the deputy director of the Museum of Fine Arts in Boston. “But it seems like a great idea to try.”

No technology is as powerful at detecting scents as the nostrils of dogs, which have long been trained to use their superior schnozzes to sniff out explosives, cadavers, bed bugs, ants and cancer, among other things.

An employee at the museum, Nicki Luongo, has trained police dogs on her own time, and got Riley as a family pet, Ms. Getchell said.

They wondered: Could Ms. Luongo train Riley to detect insects that tend to eat through textiles and wood when given the chance?

If so, it would be another layer of defense against critters that can pose a long-term threat to the artwork. As is, the museum has a variety of pest-control tactics, including quarantining new artwork before it’s placed in galleries.

But no amount of prevention tactics can change the fact that the museum has more than 1 million people passing through each year. Moths and other bugs might occasionally hitch a ride on a visitor’s coat, or be attracted to the food-preparation areas.

According to Pepe Peruyero, who runs a dog-training company called Pepedogs, the museum’s plan is entirely plausible.

“Every insect we’ve been able to work with, we’ve been able to train dogs to accurately and consistently detect them,” he said.

Generally, dogs are trained to recognize scents much the same way you might train your dog to sit: By offering a reward. When dogs associate a scent with getting a reward, they become adept at seeking the scent out.

The challenge then becomes getting the dogs to alert humans once they’ve discovered the scent. In the museum’s case, Riley will be trained to learn specific bugs’ scents, then sit in front of artwork when he catches a whiff. Humans could then follow up and check on pieces where bugs might be hiding.

While Mr. Peruyero wasn’t aware of any museums that have used dogs for pest control, he said there was a wide variety of ways humans had harnessed canine honkers. His company has trained dogs to discover sea turtle eggs buried under three feet of sand and identify scat from bears. They’ve used dogs to find larvae on golf courses more than six months before they’d hatch and destroy the turf. And utility companies have trained dogs to detect the signature odors of natural gas to detect pipeline leaks.

If Riley is successful, museum officials would attempt to share what they learn with other museums and organizations that need to protect textiles, Ms. Getchell said.

But visitors shouldn’t expect to see Riley wandering the exhibits. Ms. Getchell said he’ll do his work behind the scenes, exploring public areas only during off-hours.

That said, museum employees have been overwhelmed by the positive response after Riley was introduced to localmedia. They don’t want to distract from the museum experience and create a carnival atmosphere, but they’re already wondering if they can find ways to please Riley’s fans. Meet-and-greets? An Instagram account?

“The staff are overwhelmed by the excitement to see and meet him,” Ms. Getchell said. “We don’t want to deprive the public of that.”