General Motors Corp. and American Telepone and Telegraph Co. have informed the Carter administration in writing that they will comply with the president's voluntary program to hold down prices.

Both promises came in apparent response to a letter from Carter several weeks ago asking the nation's biggest companies for "explicit" assurances that they would comply with his price guidelines.

Administration officials said yesterday they were pleased by the responses from GM, the nation's largest industrial firm, and AT&T, the nation's largest utility. They said they had received other commitments from smaller firms, but said they were not keeping a scorecard.

The pledge from AT&T spelled out in detail how it would comply with the president's program, while the GM letter was only a general commitment.

The AT&T pledge was seen as particularly significant because some gas and electric utilities, including Pepco and Washington Gas Light, have said they are not subject to the voluntary program because their rates are set by local regulatory bodies.

Meanwhile, administration officials said John N. Gentry, a Washington lawyer and arbitrator who is highly regarded in union circles, has tentatively agreed to serve as labor-man-agement and collective bargaining specialist for the anti-inflation program.

Alfred Kahn, the president's chief inflation counselor, has been searching for a top aide to deal with labor issues AFL-CIO president George Meany and most other leaders of organized labor have opposed the Carter program, which, among other things, calls for a 7 percent ceiling on wage and fringe benefit increases.

While unions applauded the choice of Gentry, whom one unionist characterized as an "honest broker," the AFL-CIO yesterday unleashed its latest attack on the anti-inflation program, calling the price guidelines a "sham" and the wage restraints "arbitrary, inflexible and inequitable."

In a 14-page commentary on proposed regulations to carry out the policy, AFL-CIO research director Rudy Oswald said the price standards are so vague they would "accommodate practically any price increase a company might wish to put into effect."

Carter wants companies to hold price increases during the next 12 months a half percentage point below their average increase during 1976 and 1977.

Oswald said the 7 percent wage standard is so rigid that the program will invite "blacklisting" and other forms of retaliation if the guideline is breached.

Meanwhile, a spokesman for the Council on Wage and Price Stability, which administers the anti-inflation program, confirmed that the agency is investigating hefty pay increases that Illinois legislators, Cook County commissioners and Chicago aldermen voted themselves this week.

The Illinois legislature voted a 40 percent rise for its members and a 16 percent increase for Republican Gov. James R. Thompson Wednesday -- over Thompson's veto.

Commissioners from Cook County, which includes Chicago, overrode 14 to 1 board President George Dunne's veto of a 28 percent raise for themselves.

Dunne said he would refuse his raise. Thompson will not.

In his letter of commitment, dated Thursday, to President Carter, AT&T chairman John D. deButts said the company will seek no general long-distance rate increases in 1979 and that its equipment manufacturing subsidiary Western Electric will keep its price increases at least a half percentage point below the 1976-77 average.

He said that local Bell telephone companies will file for rate increases with local regulatory bodies "only when it is clear that meeting their financial needs through other means will fall short." Any rate increases these local companies seek will meet the administration's standards, he said.

General Motors Corp. chairman Thomas A. Murphy, in a letter sent yesterday, said the auto giant "will comply fully with the price guidelines which your administration has developed."

But GM did not say whether it thought it would be able to hold its price increases below the 1976-77 level or whether it might have to use an exception to the standards that permits companies with large, uncontrollable cost increases to raise prices by more than the "deceleration" standard and hold their profits as a percentage of sales constant.

The selection of Gentry for the sensitive labor liaison post followed a lengthy search. Federal Mediation and Conciliation Service Director Wayne L. Horvitz, who turned down the job, recommended Gentry, among others.

Gentry, 48, served as chairman of a presidential fact-finding board during the recent coal strike and was a longtime Labor Department official, serving as a deputy assistant secretary before leaving to join former labor secretary W. Willard Wirtz in private business here. Sources said the complexity of severing relations with the firm was one hitch holding up his acceptance of the anti-inflation job.

The choice for the post was viewed as crucial because of union hostility to the program and the inexperience of the inflation-fighting team, including its chief, Kahn, in the field of collective bargaining.

In its latest broadside against the anti-inflation program, the AFL-CIO took aim primarily at the price guidelines, saying they establish no fixed limit comparable to the 7 percent wage and benefit ceiling and include no comprehensive, self-enforcing mechanism for compliance.

"By failing to control all forms of income other than wages and by failing to control prices on the four basic necessities of family life -- food, energy, housing and medical costs -- the administration has concocted an anti-inflation program that is inherently inequitable," the federation said.