The former director of the Office of Government Ethics said Wednesday that White House counselor Kellyanne Conway likely violated the Hatch Act when she attacked Alabama Democratic Senate candidate Doug Jones during a recent interview on Fox News.

Walter Shaub, who now leads the ethics practice at the nonprofit Campaign Legal Center, later wrote the he had filed a formal complaint with the U.S. Office of Special Counsel. OSC is the Justice Department agency responsible for conducting Hatch Act investigations.

"She's standing In front of the White House. It seems pretty clear she was appearing in her official capacity when she advocated against a candidate. This is at least as clear a violation of 5 U.S.C. § 7323(a)(1) as OSC identified with regard to Castro," wrote Shaub on Twitter, referring to an official finding in 2016 that then-Secretary of Housing and Urban Development Julian Castro had violated the law.

She's standing In front of the White House. It seems pretty clear she was appearing in her official capacity when she advocated against a candidate. This is at least as clear a violation of 5 U.S.C. § 7323(a)(1) as OSC identified with regard to Castro

The Hatch Act prohibits most executive branch federal employees from taking "any active part" in political campaigns while they're acting in an official capacity. The president and vice president are exempt from Hatch Act restrictions, but White House staff like Conway are subject to them.

During a Monday appearance on Fox and Friends, Conway answered a question about Alabama Republican Senate nominee Roy Moore, who has been accused of sexual assault of a minor, by pivoting to attack Moore's opponent in next month's special election.

"Doug Jones in Alabama, folks, don't be fooled. He will be a vote against tax cuts. He is weak on crime. Weak on borders. He's strong on raising your taxes. He is terrible for property owners," Conway said. "I just want everybody to know Doug Jones, nobody ever says his name and pretends he is some kind of conservative Democrat in Alabama. And he's not."

Shortly after Shaub tweeted about the complaint, another former White House ethics czar agreed that Conway appears to have crossed the line. Richard Painter served as director of the Office of Government Ethics under former President George W. Bush, and is a frequent critic of the Trump administration's ethics practices.

This is an official interview. She has violated the Hatch Act by using her position to take sides in a partisan election. That is a firing offense. And for her this is strike two.

Reached for comment, White House deputy press secretary Raj Shah said Conway had been speaking about issues, not about whether or not people should vote for Jones.

"Ms. Conway did not advocate for or against the election of a candidate, and specifically declined to encourage Alabamans to vote a certain way. She was speaking about issues and her support for the President's agenda. This election is for the people of Alabama to decide," Shah told CNBC.

This is not the first time that Conway has been the subject of an ethics complaint. Earlier this year, she was officially "counseled" on federal ethics rules after she used her official platform to promote Ivanka Trump's clothing line. Government employees are largely prohibited from promoting private businesses during performance of their official duties.

"Go buy Ivanka's stuff, is what I would say. I hate shopping – I'm going to buy stuff today," Conway said on Fox and Friends in February. "It's a wonderful line. I own some of it. I'm going to give a free commercial here. Go buy it today, everybody. You can find it online."