The Carter administration has agreed to let United Nation officials pursue a "package deal" that would give custody of the American hostages in Tehran to an international agency like the Red Cross while a U.N. commission investigates Iran's complaints against deposed Shah Mohammed Reza Phalavi.

Diplomatic sources said yesterday the plan is intended to allow Iranian President-elect Abol Hassan Bani-Sadr, a moderate on the hostage issue, a possible way of ending the hostage crisis while satisfying Iranian demands that his country's grievance against the shah be aired publicly.

However, the sources said, the full extend of Bani-Sadr's strength and authority within the divided Iranian power structure is not clear, and some time is expected to pass before he gives any signals about pursuit of the plan.

According to the sources, the plan was worked out by U.N. Secretary General Kurt Waldheim and members of the Security Council with the approval of the U.S. government.

As described by the sources, it is a reworking of an earlier U.N. proposal to negotiate release of the hostages in exchange for the naming of a commission under U.N. auspices to look into Iranian complaints against Pahlavi and the United States.

Previously, the Carter administration, while saying it had no objection to such a deal, had insisted that the hostages had to be released before a commission could be named.

But the sources said the United State tentatively is willing to allow the hostages to be kept in Tehran under the care and protection of the International Red Cross or a similar agency while a U.N. commission conducts an investigation there.

However, the sources said, the hostages would be taken out of the country before the commission publicly reports its findings. The commission would be restricted from condemning Iran for taking the hostages and from calling for extradition of the shah back to Iran.