Police officers across the country say they are taking new precautions in response to a spike in what they call “ambush-style” attacks against them. Cops are teaming up to respond to emergency calls, suiting up more often in ballistic vests and helmets, even taking greater care to monitor their surroundings while dining out, police officials from half a dozen cities who spoke with The Trace said.

So far this year, 20 law enforcement officers have died in planned assaults carried out by gunmen, according to two groups that track officer deaths. That’s the highest number in at least a decade. It includes the dramatic slayings of officers in Dallas and Baton Rouge, ten days apart this July.

“We’ve always known the job was dangerous, but this is different,” said Paul Kelly, who heads the police union in San Jose, California. Kelly said the city’s officers now have the option of patrolling with a partner, and may soon be required to also put on helmets any time a situation escalates to the point where they need to carry rifles.

Kelly made local news last month when his union released a television ad suggesting that the public’s concern for the lives of police officers is not as strong as its concern for the lives of suspects.

Law enforcement experts say they don’t blame police for being on high alert. But they caution that heightened vigilance — specifically, tactics that distance officers from everyday citizens — risks damaging relationships with the communities they serve.

“If cops are being threatened, they’re not going to do their jobs as effectively,” said John DeCarlo, a former Connecticut police chief who now teaches police procedure at the University of New Haven. “There is a trauma that takes place that makes them less responsive to the community.”

The targeted killing of police has come amid a string of high-profile cases in which officers were blamed for using excessive force on suspects — including Freddie Gray, who died in the back of a police van in Baltimore, and Laquan McDonald, shot and killed by police in Chicago. The incidents sparked a national protest movement aimed at preventing such deaths and holding police accountable.

Many rank-and-file officers say the protests and public outcry over police shootings have given rise to a national climate where some people feel justified in attacking officers.

In New York, police say the mood on the streets has grown more hostile since the 2014 death of Eric Garner, a Staten Island man who died after police placed him in a chokehold while arresting him. About five months later, two New York police officers were shot and killed in Brooklyn while sitting in their patrol car.

“Today just about every interaction you have with a member of the public starts with a verbal dispute and can escalate into physical altercation,” said Al O’Leary, a spokesman for the New York Patrolmen’s Benevolent Association. “People today seem to think they have the right to resist arrest.”

Concern about attacks on police reached a new peak last month, when officers in three different states were ambushed in a single day. In San Antonio, Detective Benjamin Marconi was shot and killed as he sat in his patrol car writing a ticket. “The uniform was the target,” San Antonio Police Chief William McManus said at the time.

Just hours later, police officers in St. Louis and Sanibel, Florida, were also shot in ambush-style attacks. They both survived.

“We have seen a more emboldened criminal element escalating throughout the year,” said Anthony Guglielmi, a Chicago police spokesman. He said over just one recent weekend, “there were four officer-involved shootings, and two murders committed in front of marked squad cars. It’s unprecedented.”

A bulletin last week by the Bureau of Justice Assistance, a federal agency that supports local police departments, counted the number of officers killed by ambush as 20 so far this year, up from six in 2015. Organizations that record police officer deaths, such as the FBI and the National Law Enforcement Officers Memorial Fund, vary in their exact numbers, but all agree that fatal ambush attacks have reached the highest level in more than ten years.

Killings of police officers overall have remained relatively steady over the last decade. There have been 48 so far in 2016, compared to 41 in 2015, according to FBI statistics. With about 700,000 officers on the job nationwide, the chances of being killed in an ambush attack for any given officer are vanishingly small.

Some of the moves being taken by police departments to confront the perceived threat amount to reminding officers of their training. Police say they need to think about where they park their cars and where they sit in a coffee shop so they’re not leaving themselves open to attack. They even need to think about whether routine traffic stops and house calls could be traps set to ambush them.

In Baltimore and Denver, police departments have instructed officers to team up when responding to calls.

Such approaches, though often part of standard policy, can serve to distance police from people who they are supposed to watch over, experts said. Officers who are positioned strategically in a crowd so they can see a threat from any direction are, by definition, less likely to be chatting and building relationships with residents, for example. And officers patrolling in pairs often means fewer cars on the streets, and longer response times to 9-11 calls.

Other actions continue what experts say has been a long trend of police militarization.

New York and Dallas bought ballistic vests and helmets for officers, and armor for patrol cars in the wake of high profile ambush attacks in both those cities.

“Militaristic gear alienates the community from the police,” said Brigitte Keller, executive director of the National Police Accountability Project. “It sends a message that, while we are supposed to protect you, we are also expecting the worst from you.”