High-ranking CIA officials have encountered stiff resistance from the National 'security Council staff about the shape of a proposed new executive order to govern the intelligence community.

The order is in its third draft and, according to informed sources, would restore somme protections for civil liberties that were dropped in an initial version leaked in March.

The backstage debate apparently pits CIA Director William J. Casey and his top deputy, Adm. Bobby Ray Inman, against national security affairs adviser Richard V. Allen and his NSC staff.

The dimensions of the debsate are not entirely clear, but sources said it involves both the content and the form of the new rules to be submitted to President Reagan for approval.

The NSC staff reportedly wants to abandon more of the restrictions on domestic spying imposed by the Carter administration than Inman and Casey have proposed on behalf of the intelligence community. The current draft is known as "the Casey-Inman version," but as one source put it, "it is probably more Inman than Casey."

In addition, Allent and his aides reportedly feel that it would be better to write an entirely new order rather than rewrite and edit the Carter decree.

"Remember the history," one source said. "The first executive order [for the intelligence community] came out under President Ford. The next on [in 1978] was Carter's but it was really a cut-and-paste job from the Ford order."

As a result, another source said, the NSC staff is already "working on a totally different approach" while the intelligence community staff directed by Inman and Casey is considering still more revisions in its current draft.

"If you're thinking of buying stock in either side, don't do it yet," one source said. Asked when an executive order wouuld likely be ready for submission to Reagan, he added:

"Either it's going to come very soon or very late. Either some people are going to be told what to do, or they're going to enter a very long process or negotiations."

Allen could not be reached for comment, but many of his views on the structure of the intelligence community are already on record by virtue of his chairmanship in 1979 of the Republican National Committee's Advisory Council on National Security.

The council urged, among other things, upgrading the Defense Intelligence Agency as a "new source of alternative analysis" and assigning to the president "his own chief adviser for intelligence matters" who would communicate the president's priorities to the intelligence community. The CIA director does that now in his dual role as director of central intelligence (DCI).

Inman made plain in March that he intended to do all he could to temper the initial proposal and limit the scope of changes it suggested. It would, for example, have given the CIA the power to conduct covert operations in the United States and allow it to use intrusive techniques now barred to it in this country.

Seeking to counter the furor accompanying the leak of the first proposal, Inman assured the Senate Intelligence Committee that "the job of the CIA is abroad" and stated publicly that he was doing his best to head off "a series of repugnant changes" that had neither his nor Casey's approval.