The state's highest court said police went too far when they looked under the hood of a vehicle — and under the air filter — during a voluntary search after a traffic stop.

In the 4-3 ruling, Supreme Judicial Court Chief Justice Ralph Gants wrote "a typical reasonable person would understand the scope of such consent to be limited to a search of the interior of the vehicle, including the trunk" — not the engine compartment.

The case at hand involved a stop in Holyoke in 2015. Police officers asked the driver if there was anything "in the vehicle" police should know about, including drugs or guns.

"No, you can check," the driver replied.

A search of the interior of the car didn't turn any contraband up. But after popping the hood and removing the air filter, police found a black bag with two guns inside. They say the driver didn't object to the search.

The SJC says the driver consented to a search, but not necessarily to a search under the air filter. As Gants wrote:

The most generous understanding of the defendant's consent in this case is that it was ambiguous whether it included the engine area under the hood and whether it authorized the police to remove the air filter. But the police are not allowed to take advantage of such ambiguity when they have the ability to resolve it with clarifying questions.

In a dissent, Justice Ellie Cypher disagreed that the driver only agreed to a search of the car's interior and trunk:

"In my view, the defendant's unqualified and unambiguous general consent to search for 'any narcotics or firearms in the vehicle,' coupled with the defendant's failure to object as the search moved from the interior of the vehicle to beneath its hood, would indicate to 'the typical reasonable person' that the defendant had authorized the entire search at issue, including the officers' limited search beneath the hood and under the air filter of the engine."

Cypher added that she didn't see a difference between a vehicle's trunk and engine compartment, as "both are beyond the passenger compartment and must be opened separately."