NEW YORK -- The beast Norman Mailer is in the belly of, this time, is the Central Intelligence Agency. Nest of spies, fount of lies, gray instrument of grim purpose. "A huge mysterious social organism ... an evil force in American life," it seemed to Mailer, once upon a time.

"Up to I'd say about 12 years ago I was pretty paranoid about it," the novelist says. But since then he's taken a decided fancy to it. With his new monsterpiece, "Harlot's Ghost," Mailer has become the CIA's avid student and rapt chronicler, perchance its Shakespeare. And even at 1,300 pages, the story is unfinished; Mailer is bold to conclude with the words "To Be Continued."

"Harlot's Ghost," which Random House will publish in a few days, traverses the 1950s and early 1960s in the company of the Company, in Berlin and Washington and Uruguay and Miami and Cuba: the CIA's "salad days," as Mailer puts it. The facts of Mailer's considerable reading and research serve as "navigation marks" through which he steers his fiction. His characters trade secrets with history's.

In these animated pages, Mailer is seldom less than forbearing toward spies and spydom. More often he is openly charmed by the subculture. He likes the aging boys who had such fun inventing espionage in the technocratic age. The emotion discernible in these portraits of skulduggery and patriotic arrogance is, of all things, envy. Mailer's old aversions apparently have been disarmed by familiarity, and no doubt by the passage of time upon this old gray head.

"Spending seven years on the CIA gives you an odd tolerance and wisdom: 'Well, they really are pretty awful,' " Mailer says. "But on the other hand, who isn't?"

With this statement, his face begs reassurance. As though he too can scarcely believe what he hears himself saying, as though his younger self might be listening from the next room.

Mailer's fourth-story balcony above the Promenade in Brooklyn Heights gives him a reliable breeze, and a fine perch upon Lower Manhattan. Boats toot on the East River, the near skyline shimmers in haze. Provincetown, Mass., is where he and his sixth wife, Norris Church Mailer, live in summer; here, across the borough from the Crown Heights section of his boyhood, is their winter address.

Mailer, 68, bends forward in greeting, shuffles a few straight-backed chairs onto the balcony, frowns in concentration at proffered questions. He seems entirely kind, the bark of his reputation worse than the bite of his presence. He is on the short side, blue-eyed, dressed in shorts and checked shirt and thin-soled white shoes. He has small, modest hands, and they work the skin around his bare knees as he talks.

More than most writers, Mailer has always been compelled to act out, to heed "the rebellious imperatives of the self." He stabbed his second wife at a party. He ran for mayor of New York City. He turned into a journalistic guerrilla to fight the Vietnam War and its architects. He's directed movies, run the PEN writers organization, defended a murderer. He's known for letting the good times roll -- a Hebrew Harvard Hemingway.

But four years ago Mailer called his "reputation as a wild man, a crazy man," hopelessly outdated, and enjoyed repeating a friend's reply to someone who asked if Mailer were dangerous. "Dangerous? My dear, he's gotten so civilized he's boring."

Here on the balcony, he's sounding like someone responsible enough to appear on "MacNeil/Lehrer" -- alone: "The next question is, can we do without intelligence agencies, and anyone who has a sense of the complexity of modern social structure tends to say, I don't know how we can do without intelligence agencies, they're going to be with us."

Mailer is not only sensible, he's detached; perhaps the two go hand in hand. He makes a point of observing, as if impromptu, that "Harlot's Ghost" is a "comedy of manners" -- not a genre you associate with the author of "The Naked and the Dead," "Advertisements for Myself," "The Armies of the Night," and "The Executioner's Song." Mailer says, "When you have people who are well brought up, well schooled in moral subjects, engaging in immoral activities -- that's always terribly funny. I don't mean that it's a book that one's going to laugh one's way through at all" -- true -- "but I do think it holds up a mirror to all of us: None of us are quite as good as we think we are."

This humble reckoning may be implicit in "Harlot's Ghost," but it would make for a dreary theme at such length. Mailer has much more in mind, something true to that famous aggressive spirit. He is known for his intellectual appetite, his lust to experiment -- to know. The man is not governed by timidity or politesse. "Harry," his closest friend tells the narrator of "Ghost," "I'm beginning to think that the world is filled with geniuses, but only a few survive. The rest perish in the desperation of having to repeat themselves."

Just as Mailer ardently re-created 13th-century Egypt B.C. in "Ancient Evenings" (1983), his last serious novel, he has now contrived a world nearly as distant and inscrutable, the Cold War CIA. He's telling the story of his times, and meditating on his abiding obsession ("Are we a good country or a bad one?") by putting himself in the enemy's gumshoes. And he doesn't even agree they're the enemy -- they're us. "Even though I've never been in the CIA," he remarks, "I keep reminding myself that I was never in it."

Mailer is emboldened by the certainty that real spooks, given the compartmentalized nature of the place, don't and can't know much more than does he. "You always have a piece of the elephant, you never have the whole beast," he says.

Likewise the substance of intelligence gathering: "Leon Trotsky once had a fine remark. He said, 'You can tell the truth by a comparison of the lies.' That's exactly what you do in intelligence analysis."

And likewise fiction: "Most nonfiction is surrealistic -- that is, those events did occur; there are ciphers who walk around in those events with names on them. But it's almost impossible to figure out why they were doing what they did. It's the work of the novelist to come up with a scenario that will make these events believable."

Fair enough. But one wonders what the Company men themselves will make of the agency according to Mailer. In an excerpt from the novel now running in the New York Review of Books, old CIA sages (director Allen Dulles among them) deliver lectures on intelligence philosophy to the fresh young beavers. Langleyesque sniggers have been heard already at these improbable pontifications.

Perhaps Mailer's real point of view can be glimpsed in this innocent remark made to the narrator's best friend: "People like you and me go into intelligence work in the first place because to a much greater degree than we realized, we've been intellectually seduced. And often by nothing more impressive than good spy novels and movies. We want, secretly, to act as protagonists in such ventures."

Accordingly, Mailer takes a childlike pleasure in the tricks of the trade. Cryptonyms abound, littering every page with strings of capital letters. He's learned trade-craft, which he brandishes liberally. Transcripts of recorded conversations, or exchanged encoded telegrams, tell parts of the story, too many parts. But perish any thought that Tom Clancy has snatched Mailer's brain. "It takes great skill to come up with a wonderful plot, but once you do that your characters are stillborn. The moment they're alive they disturb the clockwork. ... I like novels to be organic, to grow out of themselves."

And grow, and grow. "Harlot's Ghost," Mailer tells us, is a Bildungsroman, the German term for a novel about a moral education. It records the life and early career of one Herrick "Harry" Hubbard, a fellow of Mailer's generation and as WASP as they come.

As an adolescent prepster, Harry is anointed as a future spook like a knight of yore. It's all arranged by his father, Boardman Kimball "Cal" Hubbard, and his godfather, Hugh Tremont Montague -- Harlot -- both senior men in the CIA. They steer Harry from Yale, whence American spies once were whelped, into the rigors of training as a spy, then dispatch him -- we're 250 pages into the book already -- to Berlin to serve (the historically real, fictionally reconstructed) William King Harvey, who ran the CIA operation there with a revolver and a martini glass.

For his next test of manhood, young Hubbard is dispatched to Montevideo, Uruguay, where the station chief is -- and, in fact, was -- E. Howard Hunt, then an ambitious CIA officer and sometime novelist, later notorious as a Watergate miscreant. Several hundred pages later, Harry follows Hunt to Miami, where foul deeds are plotted, and even to the waters of the Bay of Pigs. Simultaneously he carries on an affair (business and pleasure sweatily entwined) with the pseudonymous mistress of President Kennedy, Sam Giancana and Frank Sinatra.

Harvey and Hunt, bearing their own names, are fully realized characters here, even if they're Mailer's own speculative versions. Many other real personages -- Kennedy, Giancana, Dulles -- play substantial minor roles. Still other figures can be recognized behind aliases.

One of the frustrations that agency mavens will experience as they devour this historically juicy narrative is the peripheral role of James Jesus Angleton, a figure all too real in CIA history. The main character in Aaron Latham's 1977 novel "Orchids for Mother," Angleton was the orchid-growing -- and, it goes without saying for most of these guys, heavy-drinking -- counterintelligence chief who poisoned the CIA with his paranoiac lifelong hunt for hidden Soviet "moles" in its ranks.

"When I started the book I was going to write about Angleton," Mailer says. He'd talked to his CIA-obsessed buddies about him and read about him in David Martin's "Wilderness of Mirrors" (1980), one of 80-some books listed in the bibliography of "Harlot's Ghost." He'd been intrigued by this case of implacable dementia, as who would not be. Mailer had planned for his novel to include a "huge feud" between Harlot and Angleton.

But what was known about Angleton's obsessions and maneuvers when Mailer began writing -- before this year's authoritative "Cold Warrior," by Tom Mangold, for instance -- was not enough to be useful to Mailer. "The only way you can use a real man is when you figure out you know him so well that you won't misrepresent him. Or if you do misrepresent him ..." Mailer seems momentarily unsure how to finish the sentence. "... it will be worth it."

It wasn't worth it, at least then. So from time to time he lets Harlot echo, if only faintly, Angleton's pungent views -- even the old ghoul's mind-boggling suspicion that the big Sino-Soviet split of the late 1950s was in fact an elaborate ruse by the two Communist powers to lull the United States. Angleton, Mailer concedes, may take fuller shape in "Harlot's Ghost II," which will steer middle-aged Hubbard to Vietnam and to the White House (with Hunt) in the Nixon administration: a life in our un-pretty times. How can Mailer forgo Iran-contra?

He says in an author's note that follows the 1,307 pages of narrative that he has mixed real and fictional characters "not from the desire to sink into docudrama but to attempt to rise above it." To do otherwise, he says, leads to "such barbarisms as James Fitzpatrick Fennerly, youngest man ever to be elected President of the United States."

He succumbed to a version of barbarism, evidently, in creating Modene Murphy, who he freely confesses in the afterword is based on Judith Campbell Exner, consort to JFK and Giancana and Sinatra. (There's also, more marginally, one Polly Galen Smith, who is unmistakably based on Mary Pinchot Meyer, one of JFK's extracurricular activities.)

Exner's ghosted autobiography, which Mailer also read as homework, "was a decent book and gave off an agreeable air -- one tended to believe its facts," but he decided he could not write about her "with more insight than she had exhibited. I felt bound by the precise edges of her account, yet, novelistically, I needed to go further." Thus Modene Murphy.

Novelists shouldn't try too hard to rationalize their whimsies. When it came to Howard Hunt, whose autobiographical works are even more informative, Mailer stuck with the real name.

"I wrestled for quite a while whether to call him Howard Hunt or give him some other name" -- it was Charley "Stunt" Stevens -- "and I thought finally it was probably more fair to Hunt to name him, because then people who know him can say, 'This is all nonsense, he's not like that.' Whereas if you give him a pseudonym everybody says, 'That's Howard Hunt,' and that's the end of the case."

Mailer talked to a few old agency hands, he says. He won't name them. Howard Hunt was not one of them.

"Obviously politically we were miles apart. And since I had all the advantages ... I had to be as fair as I could possibly be by my lights. So I did not try to ridicule him... . By his own measure he was a serious man, and he was an ambitious man, and he wanted to do a very good job, and he was a team player and all of that."

Not every CIA man who worked with Hunt would go as far as Mailer does. But then, "I got to half like him as I wrote the book."

Even more does Mailer seem to like his Harry Hubbard, and Harlot, and especially Hadley Kittredge Gardiner Montague, a blue-blooded goddess of swimming intellect who is Harlot's much younger wife and Hubbard's tireless correspondent -- and, we learn at the outset, his future wife. Their long letters to one another, in which the most sensitive of intelligence matters are freely discussed along with their chaste affection for each other, are a handy narrative device ("Harlot's Ghost" is about one-third epistolary novel). But they are also unlikely behavior for professional spies, who would never reveal more than pleasantries in such insecure channels. Verisimilitude can be dreadfully inconvenient.

But never mind. Mailer, like the besotted Hubbard, is infatuated with Kittredge, despite -- because of? -- her vast pretension and Angloid palaver. (Kittredge's postscript to one letter, even though meant in exuberant good fun, reads: "The roses were aces, bearcat, corkeroo! Mille baisers. You are the dearest gnat's whistle.")

Says Mailer, "I wanted to create a woman who was really kind of remarkable. That was my aim." It's a curious assertion; why would he want to create any important character who was unremarkable? Possible explanation: Women have not always been happy with the way Mailer deals with them, in his fiction and otherwise. Kittredge, who Mailer says is drawn from four or five women he has known but will not identify, is, he offers, "a wholly developed woman, an interesting woman with a fine intelligence who -- she might not even like me!" He seems to feel this truly.

Kittredge is an artful writer -- the gnat's whistle indeed -- with a taste for the supernatural and a theory about the psyche that Mailer offers as "a major theme" of the book. It has to do with Alpha and Omega, twin selves within every self. "Alpha picks up what might be positive in a specific situation; Omega anticipates what could be lost," says Kittredge. Among psychically healthy people, Alpha and Omega operate in symbiosis. "It's a bit like Congress, the Republicans and the Democrats -- do they cooperate or don't they?" says Mailer, trying to be helpful. Psychopaths and schizophrenics have warring Alphas and Omegas.

There's a lot to get your mind around here, and your eyeballs too. Thomas Mann said, "Only the exhaustive is truly interesting," and Mailer sets out to prove the maxim.

"I thought it would be maybe half the present size, but it just kept going," he explains. If he hadn't stopped short, as it were, "I would have had a 4,500-page manuscript, I would have had a 2,500-page book -- who's going to hold that on their lap?"

But Mailer sounds brave. "I like the length of it. I think a long book has a quality that short books do not have." Uh, length? "It's the difference between having an affair that goes on for a night or a week as opposed to having an affair that goes on for three months."

People will make a "large investment" in this book, he says -- $30, a new benchmark for hardcover fiction. But Mailer is referring to an investment of time. "It's going to be around for a while as they read it. And when they get to the end, {they'll say to themselves,} 'Well, not all my questions were answered,' " Mailer says, "but on the other hand they're not going to be screaming for another 1,300 pages. They'll be willing to wait a few years."