SEATTLE — In the near future, your phone might be smart enough to know whether you are driving a car, or going along for the ride.

Anti-distraction software by a tech startup called Cellepathy would automatically go into a restrictive “driver mode” when a phone is within a moving vehicle. Online features such as texts, video, games and social media would be blocked, as well as some or all nonemergency telephone calls.

Your cellphone is like an airplane’s black box. It contains a compass, a gyroscope, an accelerometer and GPS tracking.

Using those features and the software, vehicle passengers could perform a verification task, lasting seven seconds or less, to unlock all the apps in “passenger mode.” For instance, they would hold a phone level and type in a series of numbers.

Cellepathy co-founder Dan Abramson recently moved from Tel Aviv to the Seattle area, where he says the company will recruit engineers. The pharmaceutical company AstraZeneca in Israel and some European firms are requiring employees to use Cellepathy, which he said has begun to market to customers in North America.

“Our contribution to the world is our ability to differentiate between drivers and passengers,” he says, a useful goal until self-driving cars someday rule the road.

“We can prevent a lot of deaths, injuries and tragedies over the next 40 years, and if we can make an honest wage for our efforts, that’s great.”

The quest for technical solutions comes while states gradually pass laws to reduce distracted driving, including Washington state’s Driving Under the Influence of Electronics act, which takes effect July 23. It bans watching video or using a handheld phone or other device while driving.

Apple announced earlier this month its “Do Not Disturb While Driving” mode, to be installed in iOS 11 software this fall. Once a phone owner has chosen this mode, the iPhone would know when it’s in a moving car and automatically reply to an incoming call or message: “I’ll see your message when I get where I’m going.”

Cellepathy-equipped phones would automatically go into driver mode when a car moves, unlike Apple’s feature, which is voluntary. No law now requires a driver’s phone to be disabled. Device makers oppose any government guidelines or mandates that call for software that automatically locks phones in moving cars.

“Ultimately, this is a behavioral problem,” said Jamie Boone, government affairs director for the Consumer Technology Association. “There are tons of different distraction problems. Daydreaming, eating, putting on your makeup.”

Cellepathy is marketing to companies that seek to improve safety and avoid liability for employees who drive on the job. That applies not only to fleets, but traveling salespeople, or anyone using private cars to deliver food or packages.

Employers can order settings to allow calls, such as those to and from the boss. Calls to 911 would not be restricted. Employers typically allow finger or voice-activated maps, and music apps. Employers could configure Cellepathy software to either allow or block hands-free calls via Bluetooth, Abramson said.

“I also have the curiosity and compulsion to see who has texted me, and to check emails all the time,” confessed Hilla Nissani, general manager of AstraZeneca Israel, on a newscast there. “The software really lets me drive in peace without knowing that mails are coming in, without the ability to read the texts.”

Cellepathy is developed for Android phones and being beta-tested on Apple products, according to Abramson.

Staffers from the Washington Traffic Safety Commission, or WTSC, are informally trying three Cellepathy-equipped phones on drives around the state capital.

Of course, turning off your phone is a voluntary form of driver mode. You may toss your phone in the trunk, or study a map before turning on the ignition. Few people do so.

“Ideally we would say put it away,” said Shelly Baldwin, legislative liaison for the WTSC. “That’s a little like promoting abstinence. That’s 100 percent effective — if you follow the code.”

The goal is harm reduction, she says, as a public-health strategy.

On a brief drive with commission staff leaving downtown Olympia, one Cellepathy-equipped phone announced “driver mode” after traveling one block and another after three blocks, locking out many uses, including Google search. Erika Mascorro, anti-distraction program manager, set her thumb on her phone, held it level, and typed numbers to allow passenger mode. She could easily make the verification test fail by tilting the phone 10 degrees. “I’ve had it about a week, and I’m already accustomed to it,” she said.

They were surprised driver mode let people type an address within a navigation map. (The new state law limits drivers to “minimal use of a finger.”) In real life, Cellepathy buyers would decide which mapping apps they would deem safe for employees, Abramson said.

One question is passenger collusion.

What’s to stop a friend or spouse from attaining passenger mode, then handing the driver a phoneload of temptations?

That situation is rare, Cellepathy Vice President Sean Irtold a national conference, because 60 percent of vehicles contain one person, and federal surveys show three-fourths of riders feel unsafe enough to tell a texting driver to stop.

At least in theory, passenger-verification software could become ubiquitous on cellphones — which is why Baldwin said she was eager to give Cellepathy a test drive.

Think about that.

Your phone would be disabled once a car moves, until a passenger takes action. Some motorists would consider that an imposition on their freedom.

The National Highway Traffic Safety Administration issued draft guidelines in November about phones, tablets and other mobile devices inside a car. The agency hopes for a “passive mode,” in which phones automatically know who drives and who rides. Drivers might be identified by bodily electric current, or camera images of where people sit in a car.

If that’s unworkable, the guidelines would recommend a passenger verification task.

Abramson said the country could wait 10 years for such passive-driver detection, compared with a couple of years to reach millions of people through software updates or new phones. The NHTSA is willing to tolerate 1.5 seconds per glance at a screen, totaling 12 seconds for multiple glances — compared with choosing a satellite radio station. Texting consumes an average 36 seconds.

The Consumer Technology Association endorses state enforcement against distracted driving. But it argues NHTSA lacks authority to issue guidelines for nonautomotive products. That would limit innovation, industry groups say.

“Who decides which apps get blocked? Who decides which maps are usable and which aren’t? It’s a big ecosystem and a whole lot more complicated than it looks,” Boone said.

Carmakers have advocated features that connect phones to built-in dashboard infotainment systems. The National Safety Council objects that pairing enables the myth that hands-free calling is safe.

Council President Deborah Hersman wrote that widespread adoption of automatic driver mode for smartphones is maybe the “best hope” to overcome a dangerous compulsion.

“NSC believes we must go beyond education and laws if we want to successfully solve the problem. Technology created this problem, but it can also provide the solution.”