IN THE WAKE of controversy over the involvement of tax-exempt social welfare organizations in campaign politics, the Obama administration has taken a welcome first step to repair ambiguity in the tax code. The Treasury Department and the Internal Revenue Service last week issued initial guidelines that would keep these groups from engaging in campaigns for individual candidates. Much remains to be settled, but this measure could avoid the mismanagement the IRS displayed in its scrutiny of tea party groups and help staunch the tide of “dark money,” or contributions from secret donors, into campaigns.

At issue are tax-exempt groups that claim a “social welfare” purpose and are governed under section 501(c)4 of the tax code. By IRS definition, such groups must “operate primarily to further the common good and general welfare of the people.” The IRS has said such groups can participate in some political activity, as long as it is not their “primary” activity. But until now, that definition was left vague.

Because the IRS does not require them to publicly identify their donors, these organizations have become a favorite vessel for channeling hidden campaign contributions. About $322 million was poured into campaigns by these social welfare groups in the 2012 cycle. One of the major players was Karl Rove’s Crossroads GPS, but there were liberal groups as well — all attempting to hide from voters who was donating.

The guidelines outlined Tuesday will create a new definition, “candidate-related political activity,” from which social welfare groups must refrain. Prohibited politicking would include communications for a clearly identified candidate or those of a political party. It would cover any spending that must be reported to the Federal Election Commission (FEC) and “any contribution that is recognized under campaign finance law as a reportable contribution.” The new guidelines would also prohibit social welfare groups from holding voter registration drives, get-out-the-vote efforts or events within 60 days of an election at which a candidate appears as part of the program.

The new rules will, we hope, force much of the dark money into open channels that are regulated by the FEC. The bungling of the tea party applications for 501(c)4 status was mismanagement by the IRS, but a root cause was vagueness in the rules. Clearer guidelines should avoid a repeat of the lengthy investigations that caused tea party groups to cry foul.

What’s not yet decided is the proportion of a social welfare group’s activity that can be devoted to politics. This is a delicate area. The IRS wants more comment. We urge caution in setting such boundaries. Legitimate social welfare groups ought to be allowed some voice in political affairs. Defining precisely where the line is won’t be easy. Yet the rules should be framed to ensure that these groups remain devoted to what they were intended to be, social welfare organizations, and not just surrogates for contributors who don’t want to be named. The gladiators in campaign politics must be barred from this arena.