President Carter's political aides have been fighting behind the scenes for a month to prevent early Democratic desertions to Sen. Edward M. Kennedy, and in such "Kennedy states" as Maine they are claiming success.

But discerning members of the Carter strategy board concede that their effort to fence off Kennedy from the party regulars could fail unless Carter's basic political standing improves.

Events in Maine over the last weekend are an example of the Carter's "containment strategy" at work.

When Vice President Mondale reached the state capital, Augusta, Saturday for a Democratic fund-raising dinner, the air was full of rumors of an impending break to Kennedy by several of the state's best-known Democrats, probably as early as this week.

By the time he left, after a number of private discussions, many of those same Democrats were saying, as one put it, "we can salvage the state very nicely for the Carter-Mondale ticket, if they'll just start to listen to us."

The details of the discussions are recounted in different ways by the participants. But it is clear that, among other matters, the future of Loring Air Force Base, the handling of a party rules dispute about the dates of the Maine caucuses and some patronage problems were discussed.

The fires of rebellion in Maine were doused -- at least for the moment -- and the skeleton of a Carter campaign organization was formed around such figures as Secretary of State Rodney Quinn.

An influential Democratic official who had been reported on the verge of a Kennedy endorsement said after the Mondale visit that he was "reconsidering my decision. We were upset because we'd received virtually no attention or understanding from the Carter people, but if they are prepared to be nice to us for a change, that's a different proposition. Before, we had no option but to go for Kennedy, but if the Carter people are interested in our support, I think we can isolate Kennedy with the fringe liberals he has today."

Mondale, who is only one of several people who have been involved in the "containment strategy," said the other day that "we have withstood the first shock of Kennedy's moves in pretty good shape."

He noted the reaffirmations of support of Carter, since Kennedy's series of pre-announcement statements, that have come from leaders of trade unions and teachers' organizations, prominent blacks and elected and party officials.

The eagerly solicited endorsements, ranging from the executive board of the National Education Association to Rep. Frank Annunzio (D-Ill.) to Los Angeles Mayor Tom Bradley, were designed to show that Carter had strength among elements of the liberal coalition that might be thought sympathetic to Kennedy.

At the same time, there has been a shoring up of support in the South and among conservative Democrats who view the Kennedy candidacy with concern.

Two major media events this month are being designed by the Carter forces to dramatize what they see as the success of the containment strategy.

The first is in Florida on Oct. 13, when county caucuses will be held to choose half the delegates to a mid-November state convention, where a presidential preference poll will be conducted.

A draft-Kennedy group in Florida, backed by similar organizations around the country, chose to make the caucuses a test of strength. And now the Carter forces have mobilized to punish them for their effrontery.

With heavy reinforcements from Washington, the Carter forces are aiming, not just to win the overall fight on the 13th but to capture enough of the urban counties -- including Dade County (Miami) -- to be able to boast that Kennedy has been beaten in his own area of supposed strength.

The second splash is planned for Oct. 24 in Washington, when some 200 prominent Carter backers from around the country will gather for a dinner here, designed to show off Carter's muscle.

For now, the Kennedy backers can respond to the containment strategy only by pointing out the irony that Jimmy Carter, who ran as the "outsider" in 1976, is now turning to endorsements from prominent figures to prop up his staggering political posture.

With Kennedy still weeks away from an active candidacy, the Kennedy forces have few big guns to employ in such mock-battles as the Florida caucuses. "If we could have one day of Ted Kennedy in Dade County," said Mike Abrams, his backer there, "we could lock this thing up against Carter. But it's hard to run without a candidate."

But there is skepticism among many Democratic officials, not all of them Kennedy backers, about how real and durable the gains of the containment strategy will prove to be.

There is a widespread suspicion that some of the big-name officials now flirting with Carter are doing so only because this seems to be the time to extract the maximum benefits from the administration.

In Chicago, for example, most Democrats assume that Mayor Jane Byrne will eventually find her way to Kennedy, because of her long-held loyalty to his family. But she is remaining neutral for now and may even run her delegate-slates as unpledged, because the city is receiving what one of her aides calls "unbelievable cooperation" from the administration on grant requests for housing, transportation and community development.

Even where the loyalty of the Democratic officials to Carter has a more durable basis than the latest Washington "wish list," the containment strategy can be finessed.

In cities, states or interest-groups where the top leaders endorse Carter, there are always second-echelon officials who are eager to seize the Kennedy franchise.

One senior administration official, acknowledging that fact, said, "unless we can begin to even up the polls between Carter and Kennedy, our endorsements just won't hold up."

As it is, many important targets of the containment strategy are eluding the Carter dragnet. The United Auto Workers executive board in effect sanctioned pro-Kennedy activity by UAW officials by declaring itself neutral. Four years ago, the UAW gave vital early backing to Carter. The painters union national convention endorsed Kennedy, brushing aside an effort by its leaders to keep it uncommitted.

Angelo Geocaris, an important Illinois Democratic fund-raiser and strategist, turned down repeated pleas to run a Carter fund-raiser in Chicago, and is now viewed by Carterites as a probable Kennedy ally.

Former representative Teno Roncalio of Wyoming, who was helping on Carter fund-raising earlier this year, is now moving into the same role for Kennedy.

"They can build all the fences they want," one Kennedy supporter said, "but they can't stop people from burrowing under them."