. —Peter and Maria Hoey for The Boston Globe

When realtor Lenny Harris takes buyers to look at likely properties, he warns them to be careful what they say. Even if the sellers aren’t around, there’s a good chance they are watching and listening, thanks to the proliferation of smart home security devices. While intended to protect homeowners from burglary, these gadgets have also become a secret weapon for home sellers and a potential nuisance for buyers and their agents.

“We have changed that whole part of our business because of all the home monitoring and all the cameras,’’ said Harris, an agent with Keller Williams Realty in Canton. These days, when Harris shows a home to possible buyers, he tells them to avoid any reactions that suggest they’re eager to buy. “You say something like that and the seller is listening, now all of a sudden he has an upper hand.’’

Harris has good reason to be wary of sellers who spy. A survey by the personal finance site NerdWallet found that 15 percent of Americans who’ve sold a home said they’ve used their security systems to monitor potential buyers, and 67 percent say that if they were selling a home and had such devices, they’d switch them on when buyers come calling.

Harris has firsthand experience with this kind of snooping.

“I had a seller client who had a dog,’’ Harris recalled. The animal went by the name Rudy, and during one of Harris’s showings of the property, “I walked into the house, and I said, ‘Rudy, it’s Uncle Lenny.’ ’’ Indeed, Harris continued to talk to the animal throughout his visit.

The same evening, the owner of the home phoned Harris’s wife, who is also a realtor. She told the seller that the visit had gone well and that they would be showing the home to another potential buyer the next day.

The seller asked, “Will you be doing it, or will Uncle Lenny be doing it?’’

Why had the seller called him “Uncle Lenny?’’ Because he’d been using his home’s security system to listen in. He’d heard Harris’s banter with the dog, and with the possible buyer.

In the aftermath, Harris has become a lot more careful when working with would-be home buyers. “Nowadays you have to assume someone is looking over your shoulder,’’ he said.

Amy Mizner, principal at Benoit Mizner Simon & Co. of Weston, doesn’t object in principle when sellers keep an eye on potential buyers. “I think it’s a really positive thing in open houses to be able to monitor who’s walking through your house,’’ said Mizner, whose company sells high-end homes in the Metro West region, with an average selling price of $1 million.

But it can be unnerving for buyers, as Mizner discovered during one transaction. “While we were doing the brokers’ open house, an agent took out her cellphone and took a picture of the master bedroom. As I was watching, a text came in that read, ‘Please, no pictures in the master bedroom.’’’ It was only then that Mizner realized the seller had been tracking their every move.

But while the temptation to snoop might be irresistible, is it legal? That depends. “Video is fine so long as it doesn’t record sound, so you can’t overhear the conversations a buyer is having,’’ said Boston realtor Douglas Bray of Century 21 Cityside. There’s one key exception: Never shoot video in parts of your house where people have a reasonable expectation of privacy. That means no cameras in the bathrooms.

But many of the latest security cameras capture sound as well as video, and that complicates matters. In much of the United States, it’s legal to record a conversation with the consent of just one of the parties involved. So if a seller accompanies a buyer, he or she can record anything they say to each other. But if the seller isn’t present, he has no right to record exchanges between the buyer and his agent without consent.

The law in Massachusetts is even tougher. This is one of 12 states that require the consent of all parties to a conversation before it can be captured electronically. This means that a homeowner should notify visitors that everything they say or do may be recorded, or he or she should shut down the system when guests are present.

“We communicate with our sellers,’’ said Bray. “If they do have cameras inside their home, we advise them that they can’t record the buyers walking through their home.’’

And since it’s always possible that an unscrupulous seller has planted listening devices without giving notice, Bray gives all potential buyers a heads-up. “We do counsel our represented buyers not to be too communicative during the showings. If they like a property, keep the cards close to the vest.’’

While real estate agents fret about possible seller surveillance, there’s a chance that many prospective buyers don’t much care. The NerdWallet survey found that 75 percent of American home buyers wouldn’t mind if the seller recorded their visits. Maybe they figure they’re not entitled to privacy under someone else’s roof.

Or they just know when to keep their mouths shut.

Hiawatha Bray can be reached at hiawatha.bray@globe.com. Follow him on Twitter @GlobeTechLab. Send comments and questions to Address@globe.com. Subscribe to our free real estate newsletter at pages.email.bostonglobe.com/AddressSignUp.