President Jaafar Nimeri of Sudan said tonight that he has a commitment from Secretary of State Alexander M. Haig Jr. that the United States will defend his government against attack by Libya and that, as part of the commitment, Sudan will participate next month in joint military exercises with U.S. and Egyptian forces.

"I have been assured by Secretary of State Haig that the United States is not going to leave such an attack as Libya's intervention in Chad to be done again, and so they are going to stand very fast with the Sudan and Egypt," Nimeri said in an interview here with a group of American correspondents.

Nimeri also said Sudan was training agents to infiltrate into Libya in an effort to subvert the regime of Col. Muammar Qaddafi.

Nimeri's comments, in which he specifically talked of a U.S. "commitment" to defend Sudan, appeared to add a new dimension to Haig's repeated assertions during his three-day visit here that Washington will not tolerate "mischief-making" or "manipulation" by Qaddafi.

Although Sudan increasingly in recent years has turned to the United States for support, Nimeri's remarks were the first public word of any U.S. commitment to protect the beleaguered government in Khartoum. They suggested Haig has chosen Sudan as the point at which to draw a line against Qaddafi's interference and subversion in neighboring countries, which Nimeri insisted is Soviet-inspired.

Nimeri's declaration also seemed especially significant in light of his claim that Libyan planes have been bombing Sudanese border villages three times a day for two months and that he expects a Libyan air attack on strategic Sudanese targets "any day." He said he also fears that Libyan-trained agents are carrying out sedition in Sudan.

The Reagan administration has asked Congress for $100 million in arms for Sudan for fiscal 1982, a request awaiting approval. Haig announced as he left Cairo yesterday that he will seek to accelerate delivery of these arms in response to Nimeri's appeals and a desire to increase U.S. presence in the region following the assassination last week of president Anwar Sadat.

Nimeri said he is asking mainly for antiaircraft equipment such as early warning radar and missiles to protect the capital city, Khartoum, and other strategic targets such as dams. In addition, he said, he is seeking F5 interceptors.

In light of these needs, Nimeri said, the $100 million "is not enough. It's very, very little."

A U.S. delegation is in Khartoum conferring with Sudanese officials to establish a priority list of Nimeri's military needs. After it reports, Haig is expected to ask Congress for speedy approval of the military aid package for Sudan, perhaps with additions of what Haig yesterday called "emergency action" for "that threatened country."

Nimeri said Sudan would be part of the standard and extended joint military exercises next month, including practice for airlift of Egyptian troops to Sudan in U.S. transport planes. Although the troops will be Egyptian, he said, the maneuvers will involve U.S. military personnel in the Sudan.

Haig, in announcing expansion of the exercises, said yesterday that Egypt, the United States and Oman would partcipate, but he did not mention Sudan. Although he repeated his warnings against Libyan "mischief," he said nothing of a commitment to defend Sudan against Libya.

Nimeri, responding to questions, said his understanding of the latest U.S. commitment included protection against attacks from outside and not subversion from within by Libyan agents or sympathizers.

"Up to now the commitment from the United States is for this traditional kind of war," he said. But Libyan agents, he said, are buying up Sudanese supplies "and dumping them into the Nile" to cause shortages and unrest among the population. It was in response to these tactics, he said, that Sudanese authorities rounded up more than 10,000 people in Khartoum last month to check their identities. About 3,000 remain jailed pending further investigation, he said.

In response to a question, Nimeri said he is training agents of his own and plans to send them into Libya to subvert the Qaddafi government. He said he also is counting on the 10,000 Sudanese working in Libya.

"I have every right to send them," he said. "It is a kind of active defense, as you call it in the army. They think they are the only ones who can do hell-raising. But we can do it also."

Asked whether he discussed these plans with Haig when the two met here Saturday after Sadat's funeral, Nimeri said, "I don't remember."

Nimeri, 51, said he and his Army gained expertise in irregular warfare during a long civil conflict in southern Sudan, which Nimeri settled three years after seizing power in 1969. But, he added, "this economic war is a new thing for us."

He called it "new style war" waged by the Libyans at the behest of the Soviet Union, adding, in what seemed a clear play for the Reagan administration's ear:

"The danger is coming to us from the Soviet Union. They would like us to be Marxist governments in the area. They're aiming at Sudan, Egypt and Saudi Arabia. They're using the Libyans as their agents to do this job."

The fighting in Chad has driven thousands of refugees into Sudan, particularly families of a Chadian faction fighting President Oueddei Goukouni and his Libyan-backed government. It is mostly in the border area where the refugees are staying that Libya has been bombing.

Nimeri acknowledged he has been aiding the opposition against Libyan intervention troops in Chad and said his forces have shot down three Libyan planes during attacks on the border villages. In part because of these clashes, Nimeri said, he fears a wider Libyan attack.