JUST WHEN YOU thought it was safe to wander inside the Beltway, along comes Peter Benchley with a comic novel of Washington intrigue. This is a new realm for Benchley, best known, of course, for his handling of a rogue Carcharodon. The sharks populating political waters are a different breed altogether. Forsaking a diet of discarded beer cans and unwary bathers, they prowl instead for power in the form of perks, positioning and especially access. But the most endearing characters in Q Clearance aren't Great Whites by any stretch of the imagination. They are, rather, pilot fish, subsisting warily on the big boy's leavings, angling for the shelter of comfortable anonymity.

Timothy Burnham is one such fish. As a presidential speechwriter, he's gone just about as far as he cares to go. His job pays well enough and is not without a certain prestige. Then too, ensconced in his suite at the Executive Office Building, he's at a safe remove from the White House power vortex and faces no greater challenge than drafting the occasional proclamation or benefaction. Just as well, since poor Tim suffers from food allergies that leave him susceptible to stress-induced anxiety tremens. Even public transportation is more than he can handle: "It was not only that buses were hot and crowded and dirty, but being on a bus constituted a kind of invasion of his privacy. When he boarded the metal container, he was thrusting himself into contact, and sometimes confrontation with people he was not equipped to deal with, who did not play by his rules."

Tim's problems are mainly personal. His pubescent daughter has become a Maoist. His wife, in the thrall of a pop-psych feminist named Sonja, has evicted him from their Georgetown home. As he forlornly checks into the local YMCA, Tim has little inkling that things are about to change . . . for better and worse.

Tim's boss -- everybody's boss -- President Benjamin T. Winslow, has had difficulty with welcoming remarks for a Nepalese potentate. The name of the country wasn't phoneticized and, to his subsequent embarrassment, Winslow repeatedly referred to it as "nipple". Someone must pay, and that someone is Tim.

In a bizarre quirk of fate, however, Tim finds himself a presidential confidante instead of scapegoat. Not only is he moved into the White House, he's given space adjoining the Oval Office. He's invited to attend cabinet meetings, enter the president's inner sanctum without knocking, even avail himself of the First Bathroom. He gets a beeper, a hot line, "Q" clearance (the highest kind), and, naturally, a lot of new enemies. To Tim's surprise, he actually begins to enjoy his newfound, and unexpected, clout. No more nervous jitters. Maybe it's all that good food forced on him by his new, nutritionist girlfriend, Eva.

Here, the plot thickens.

Eva, you see, is the daughter of one Foster Pym (ne' Pinsky), caterer to the Washington elite and Soviet deep-cover agent. The ideological fires have long since been banked in Pym, leaving him with little more than a visceral distaste for America (abstract) and an appreciation for her material wealth (compellingly real). As long as he feeds his superiors enough spicy tidbits, he's free to remain in the states. Tim is his ticket to a pleasant retirement.

BENCHLEY IS no Woody Allen nor, for that matter, Christopher Buckley. But he obviously has a good time with his comedy and that enthusiasm proves infectious. The pace rarely slackens and many characters, though sketchily drawn, are genuinely amusing. Mario Epstein, "Deputy President of the United States for the Economy, for Keeping Malcontents From Burning Down the Cities, for Convincing All Minorities That the Administration Cherished Them, for Mollifying Women, for Convincing Old Folks that Social Security Checks Could Be Stretched Beyond Cat Food, for Delivering the Jewish and Italian Votes, and for Counseling the President as to Which of His Foreign Policy Advisors Were Trying to Blow Smoke Up His Ass," stares down a subordinate "as if the man had a booger on his lip." Benjamin Winslow is an early example of what may become the Post-Reagan Fictional President. Seemingly unqualified for the job, he gradually reveals sound instincts and proves to be a good guy after all.

Q Clearance is too broad to cut very deep, but, on the positive side, you can take it along to the shore and remain unafraid to go in the water. You may, however, want to cancel that trip to Washington.