A federal judge in Texas this month unmasked one of the defining features of the Obama administration’s abuse of executive power: the use of so-called agency “guidance documents” to usurp Congress’ lawmaking function.

The Trump administration, to its credit, has returned to the rule of law by unwinding that practice.

In 2012, the Equal Employment Opportunity Commission published enforcement guidance purporting to limit employers’ use of criminal history in employment decisions. On Feb. 1, however, Senior U.S. District Court Judge Sam Cummings of the Northern District of Texas ruled that guidance to be unenforceable.

Agencies often publish guidance on how they will interpret and enforce whatever legal authority Congress entrusted them with.

Used properly, guidance documents help the public understand their legal obligations. Used improperly, agencies can cram them with new legal obligations.

The latter was one forbidden fruit that the Obama administration could not resist.

Case in point: the 2012 Equal Employment Opportunity Commission enforcement guidance.

The commission asserted that an employer’s reference to the criminal history of job applicants amounts to unlawful racial discrimination under Title VII of the 1964 Civil Rights Act if it disproportionately impacts African-American or Hispanic males.

Employers had to prove that their decision not to hire or promote an applicant owing to their criminal history complied with the detailed regulatory process that the commission laid out in its guidance.

Meanwhile, the commission argued that proof of “a racially balanced workforce” would not help an employer “to disprove disparate impact.”

That put employers, and especially state governments concerned that the guidance pre-empted their own laws, in an untenable position.

In 2013, the state of Texas sued the attorney general and the Equal Employment Opportunity Commission in federal court, arguing that what the agency called a “guidance document” was really a federal regulation because it imposed obligations on employers and threatened punishment for noncompliance.

Texas also argued that the Equal Employment Opportunity Commission did not have the authority to issue the rule, but that even if it did, the rule was issued unlawfully.

The Administrative Procedure Act, which defines the process for agency rulemaking, requires an agency to publish notice of forthcoming rules in the Federal Register and to give the public an opportunity to comment before a rule is issued.

The commission skirted these requirements by disguising its new rule as guidance, “simply reciting and applying the text of Title VII.” There’s “nothing to see here,” the agency argued, even while it was enforcing the guidance in lawsuits against private employers.

Cummings originally dismissed Texas’ lawsuit because the commission had not enforced its guidance against the state, but on appeal, the 5th U.S. Circuit Court of Appeals reversed, recognizing the “enforcement guidance” for what it really is: “a policy statement couched in mandatory language that is intended to apply to all employers.”

The court proceeded to scold the agency for “exploit[ing] the limitations of its enforcement authority, while denying that state agencies will face legal consequences should they fail to follow the Enforcement Guidance’s directives.”

The court later withdrew its opinion, however, when the Supreme Court decided a related case, U.S. Army Corps of Engineers v. Hawkes Co., holding that federal courts could review agency guidance documents called “jurisdictional determinations,” and ordered the district court to consider Texas’ claims anew.

When Cummings had a second at-bat, he ruled Feb. 1 that the guidance is a “substantive rule issued without notice and the opportunity for comment.”

The courts deserve credit for not unquestioningly adopting the commission’s claim that the substantive rule it enforced was really just an inconsequential bit of guidance.

Unmasking the commission’s rule has opened it to further lawsuits from other states seeking to prevent enforcement of the guidance document.

Here, however, the Justice Department also deserves credit.

In January, then-Associate Attorney General Rachel Brand issued a memorandum saying that “the department may not use its enforcement authority to effectively convert agency guidance documents into binding rules.”

At least through the end of the Trump administration, therefore, the Justice Department’s civil enforcement actions against private parties must be based on the laws that Congress passes, not whatever guidance comes out of the federal bureaucracy.

There is still more work to do to limit the abuse of guidance documents. But perhaps “the Brand memo” will help to end the flood of “guidance” that poured out of the Obama administration.

According to Clyde Crews Jr., vice president for policy and senior fellow at the Competitive Enterprise Institute, currently not even Congress knows the full “amount and cost of the thousands of executive branch and federal agency proclamations and issuances, including guidance documents, memoranda, bulletins, circulars, and letters that carry practical (if not always technically legally) binding regulatory effect.”

As the Trump administration works to reverse this unfortunate trend, Congress should do what it can to make those efforts permanent.