WHEN CIA CHIEF William Casey and President Reagan complain about the damage done to national security by leaks to the press, they come to court with unclean hands, tainted by years of manipulation of the press through calculated leaks by their administration.

To a journalist, the most troubling thing about this is that reporters have been eager accomplices, becoming an extension of the executive branch and glorifying the president by letting themselves be used. Casey's threat of prosecution of the recipients of some leaks comes closer to an angry quarrel in a partnership than a question of enforcing the law.

Although the practice of orchestrated government leaks goes back to Franklin D. Roosevelt, this administration has turned the leak into an art. It takes the form of casual tips, institutionalized backgrounders and insider dope sessions, much of it directed at enhancing the image of Reagan as a genial, principled mastermind who not only knows when every sparrow falls but sometimes revives deserving little birdies that catch his benevolent eye.

The pattern became clear at Reagan's first economic summit in 1981 in Ottawa. Secretary of State Alexander Haig would give on-the-record briefings to the press corps, but apparently he was insufficiently passionate on the subject of Reagan's mastery of global economics and strategy.

So Mark Weinberg of the White House press office would circulate mysteriously through the American press room, telling certain favored reporters of certain favored organizations to go to a room on the 11th floor of the hotel at a precisely appointed time.

My time was 3:30 p.m. I arrived and opened the designated door. The shadowy figure of a man was sitting alone at a linen-covered room-service table in the middle of the half-darkened room, eating a bacon-lettuce-and-tomato sandwich. It was then-presidential counselor Ed Meese, who was prepared to tell me, on the basis of no further attribution, how well Reagan had done in the closed sessions of his first international summit. If I asked Meese about Lebanon, or F-16 deliveries to Israel, or about the times Meese and I have spent together in Sacramento, he would answer with a variation on the theme of how Reagan had wowed his allies at the conference sessions.

After 30 minutes of this, another mysteriously summoned journalist appeared at the door and I was ushered out so someone else could sit in front of "the senior official," now finishing up his iced tea, to hear how Reagan stunned the Western leaders and convinced them totally that there is no relationship between a high federal deficit and high interest rates.

Four years later, at another summit in Bonn, I sat in another hotel room listening to Treasury Secretary James Baker -- identifiable only as a "senior administration official" -- describe how Reagan has always understood perfectly how a large federal deficit tends to drive up interest rates.

As for William Casey, it is particularly disingenuous -- a word that editorial writers use to mean hypocritical -- for him to complain about leaks. The intelligence community has provided inside information to reporters when it happened to demonstrate that Nicaragua is a clear and present danger to Harlingen, Tex., or anything else that the president or his public relations people wanted demonstrated.

I presume Casey does not plan to prosecute the intelligence officials who somehow let out the word in November 1984 to CBS that a Soviet freighter was bound for Nicaragua with crates of MiGs on its decks -- justifying the worst of Reagan's warnings. The nightly TV graphics showing the progress of the freighter across the Atlantic demonstrated we had close satellite photography of the ship, and almost certainly the ability to read its incoming and outgoing radio transmissions. It probably gave the Soviets a broad hint that we had somebody on the ground in the Soviet Union who was willing to risk his life to report on the specific loading of a specific ship in a certain port.

The impression was given that the president was alert to a danger and he was prepared to do something about it -- never mind that the crates turned out to contain something else when they arrived.

The standard leak technique in this administration is the institutionalized group-leak known as the backgrounder. It sets the stage and provides a mind-set where anonymous "senior officials" are regarded as the most credible informants. It is part of a kind of press-government conspiracy: We, the press, know that they, the government, are handing out this information, but we can't tell the poor saps who are the readers, because that would detract from the omniscient image the government is trying to create for the president, not to mention the omniscient image the press likes to create for itself.

If reporters do identify the "official," they won't be invited to the next insider session and they will lose their reputations for dependably transmitting endless fountains of U.S. government-certified leakery.

We not only accept this stuff, we fight to get it. Currently, there is kind of a nightly competition to see whether John McWethy of ABC or David Martin of CBS is going to come up with the best "source" story. The fact that some of these scoops turn out to be flat wrong or so incomplete as to be misleading does not detract from the excitement of it all.

If truth is to be told, there is a kind of titillation, a frisson of mystery felt by the editors and the reporters when they impart information from "a senior official" rather than some bureaucrat whose mortality is revealed along with his (or her) name. In fact, it's generally felt among reporters, readers and television viewers that the really good stuff comes from "officials" and "sources" and not from real people with names.

Every time a foreign leader comes to the White House, an assistant secretary of state is trotted out to describe the Oval Office discussions. When it's a European leader, for instance, the briefer is usually Rozanne Ridgway, the assistant secretary of state for Europe. The White House ground-rules prohibit the feminine pronoun in the second reference lest there be some hint who the "official" is. The scores of reporters in the White House press room, including those from Tass and New China News Agency, solemnly nod and go along with this concealment.

Leaks, as Alexander Haig says in his book "Caveat," have become "a way of governing . . . the authentic voice of government." Haig, who was tormented until his untimely end by White House leakers whom he called "guerrillas," himself used backgrounders -- no identification at all of the well-informed person you had breakfast with at the State Department -- but he was routinely outgunned by the methodical leakists in the White House.

This administration didn't invent the technique but it has perfected it. We seem to be caught in an inexorable descent in which everybody -- reporters, editors, readers and viewers -- is part of the conspiracy. Once, after attending a backgrounder by Secretary of State Cyrus Vance, and concealing his identity in the text, I gave the story the slug, or one-word working title, of "Vance." One of my editors chided me for my breach of security.

Casey and Reagan have legitimate worries about leaks that undermine U.S. national security and are justifiably critical of reporters who have a single-minded obsession with the day's scoop, even at the risk of endangering U.S. intelligence methods and agents. But administration officials should remember their part in making the institution of the leak as important as it is.