Observers are correct to condemn both Russian efforts to influence our presidential elections and President Trump’s failure to reject those efforts. But it is wrong to suggest that all efforts by foreign governments to influence our elections are improper. The question is not whether other countries are trying to exert influence, but whether they are doing so by legitimate means.

According to Federal Election Commission Chair Ellen Weintraub, it is always unacceptable for foreign governments to influence our elections. Intuitively this makes sense, but there are two important reasons why foreign influence can be appropriate, even desirable.

First, the perspectives of other governments can provide valuable information for voters. Suppose presidential candidates offer different proposals on achieving peace between Israel and the Palestinians. It would be useful to know what Israel and the Palestinian Authority think about the candidates’ positions.

Second, foreign countries have legitimate interests in U.S. policies. As the dominant world power, our country adopts policies that have profound effects on other nations. It matters considerably whether we join climate accords, trade agreements, or nuclear nonproliferation pacts. Because our positions affect other countries, those countries should be able to present their views when presidential candidates are debating about foreign policy.

Rather than rejecting any efforts by other countries to influence presidential elections, we need to distinguish between acceptable and unacceptable tactics. Russia acted wrongly when it hacked the computer network of the Democratic National Committee, spread misinformation, and deployed agents who pretended to be Americans. On the other hand, it would be fine if foreign governments issued official responses to a presidential candidate’s proposal on the regulation of greenhouse gas emissions.

As we act to protect the integrity of our electoral process, we need to avoid an overreaction that would throw out the good with the bad.