Rep. Edward I. Koch (D-N.Y.) has sent President Carter a letter charging that "certain segments of the State Department" are trying to "undercut" the President's human rights policy.

Specifically, Koch charged that the State Department has aligned itself "with a lobby organized by a repressive foreign government." He was referring to the State Department's role in the debate over appropriation of $3.1 million in military loans and training for the Nicaraguan government of President Anastasio Somoza.

The House Appropriations Committee had voted against the military aid after hearing detailed testimony charging the Nicaraguan National Guard, headed by Gen. Somoza, with torturing political dissidents and killing peasants in isolated parts of the country.

The State Department agreed that there have been serious rights violations in Nicaragua, but asked that the money be appropriated if the situation improved. It promised the committee that no military aid agreement would be signed unless there is an improvement, and said this would give it leverage to persuade Somoza to moderate his policies.

Koch charged in his letter to Carter that people in the department's congressional relations office had told his staff "that the State Department would not actively lobby on this issue."

However, on June 22, the day the House began to debate the appropriations bill, Terence Todman, assistant secretary of state for inter-American affairs, sent a letter backing the restoration of the military aid funds to four congressmen whom Koch called "ardent defenders of the Somoza regime."

Koch said these congressmen, including Rep. John Murphy (D-N.Y.), a "close personal friend of President Somoza," used the letter and a "talking points" paper prepared by the State Department, to get the military aid funds restored by a vote of 225 to 180.