The AFL-CIO announced today it will ask federal courts to prevent the Carter administration from enforcing its "voluntary" anti-inflation program by denying government contracts to companies that violate wage guidelines.

Accusing President Carter of exceeding his powers, AFL-CIO President George Meany said the labor federation's suit will charge that withholding federal contracts amounts to a form of mandatory wage-price controls that Congress has refused to authorize.

While the suit would not prevent the government from seeking voluntary compliance with its wage and price guidelines, it would knock the teeth out of the program by eliminating the only official sanction against violators.

The suit, expected to be filed next month, amounts to the strongest legal challenge thus far to the 4-month-old anti-inflation program. It is also the most forceful action that has been taken against it by the 13.5 millionmember AFL-CIO, which complains that the president's program punishes workers by holding down wages while doing little to keep prices from rising.

A spokesman for the government's Council on Wage and Price Stability disputed Meany's claim that the contracts sanction is illegal. "The Justice Department has assured us that the program is legal," said the spokesman. "I don't know what more we can say."

The legality of the sanction has come under question from other sources, however, including two adjuncts of Congress, the General Accounting Office and the Congressional Research Service of the Library of Congress.

Meany said the suit, which is expected to be joined by the United Rubberworkers, International Union of Electrical Workers and other unions that will be bargaining for new contracts this year, will seek a declaratory judgment that the government lacks the power to enforce its guidelines by threatening to withhold contracts.

Under regulations issued earlier this year the government is requiring firms seeking federal contracts of $5 million or more to certify standards, including its 7 percent guideline for annual increases in wages and benefits.

Many companies with federal contracts claim they cannot offer more than 7 percent in wage and fringe benefit increases without risk of losing federal contracts, and unions are complaining this thwarts their right to free, unfettered collective bargaining.

"We think that's illegal... We say that's wrong. It's an attack on the whole process of collective bargaining, and we're going to bring the matter up in court and see if we can't have it decided," Meany told a press conference shortly after the legal challenge was approved by the AFL-CIO's 35-member executive council at its annual mid-winter meeting here.

An earlier suit challenging the government's procurement sanctions was never decided on its legal merits.

The suit, filed by the Association of Western Pulp and Paper Workers, an independent West Coast union, was shelved in December after the government found that none of the paper companies involved in negotiations with the union had contracts of $5 million or more and thus were not vulnerable to government sanctions.

Laurence Gold, special counsel to the AFL-CIO, told reporters the federation's suit will be filed in a couple of weeks, probably in U.S. District Court in Washington.

Gold said it has not been decided whether to seek a temporary restraining order to stop the government immediately from imposing any sanctions. But he said he believed the case would make its way through the federal courts by the end of the year.

No sanctions have been imposed by the government, but many companies that are bargaining this year, including the big auto, rubber and electrical manufacturing firms, have millions of dollars worth of federal contracts. Fear of losing federal contracts was cited as a factor, although reportedly a minor one, in oil companies' refusal earlier this year to budge beyond the administration's wage guideline in negotiating a new contract with the Oil, Chemical and Atomic Workers.

The AFL-CIO, which won at least one legal case against wage restraints during the Nixon administration, is basing its attack on the Carter guidelines on a provision of 1974 legislation creating the Council on Wage and Price Stability. This provision says, "Nothing in this act authorizes the continuation, imposition or reimposition of any mandatory economic controls with respect to prices, rents, wages, salaries, corporate dividends or similar transfers."

The program "has to be voluntary because the law says it cannot be mandatory," said Meany. Said Gold: "The president cannot by executive order do what Congress prohibits."

Gold acknowledged the government will probably challenge the AFL-CIO's standing to bring the suit but contended that the federation's unions are "directly" affected by the sanctions because they interfere with the union's legal rights to bargain freely with employers. He said he believes the AFL-CIO has a "realistic chance" of surviving any such challenges and getting a decision on merits of its case.