Jon. F. Oster has always lived in a lawyer's world, a neatly structured arena with a strict code of behavior and time-honored set of rules. He played the game well and was appointed deputy attorney general of Maryland.

Today, Oster is running for the elective post of attorney general and finds himself in the very different world of politics, a chaotic, rough-and-tumble community built on imagery, accommodation and wheeling and dealing.

"Sometimes I pause and step outside myself," said Oster, a genteel man who has never so much as belonged to a political club. "You're working with an entirely different set of standards in politics. It's uncomfortable at times."

Most of the time, Oster assumes his new political role with ease. He is a personable campaigner who wins over voters with his boyish smile. He is an articulate spokesman for his conservative view of the attorney general's office and speaks well before groups.

But the strains of inexperience often show up on the campaign trail where Oster, a man of aristocratic bearing, seems to have trouble shedding the demeanor of a "downtown lawyer" and adjusting to the glib style of seasoned politicians.

At a recent pool party for East Baltimore precinct officials at Marco L. (Buddy) Palughi's Sons of Italy Lodge, he left two steelworkers with their mouths open when he tried to describe his affection for their community.

"You know I'm an Anglophile," Oster said. "I just love those little Victorian taverns in East Baltimore. There's a real, genuine charm in East Baltimore. Georgetown is very interesting, but there's something artificial about it."

A 74-year-old retired mechanic joined the group and introduced himself to the candidate. "I'm Stone," the elderly man said, extending his hand to Oster, who looked stunned and asked the man to repeat himself.

The bespectacled man repeated his name, and Oster let out a sigh of relief. "Oh, I thought you said you were stoned," he said.

No one laughed except for Oster.

"Jon's playing a game now that he's not really equipped to play," said Norman Polovoy, one of Oster's campaign advisers. "He's a lawyer's lawyer, not a politician. Politics for him is like trying to adjust to living under water.

But Polovoy says that Oster's political noivete may end up doing more good than harm. "People have been so hardened by politicians. There's a certain amount of empathy for a guy who doesn't slap backs so well."

Moving from the courthouse to the political clubhouse is troublesome enough for a political novice. But Oster made the transition all the more difficult by waiting until the last day of filing for candidacy - July 3 - to enter the race.

To make matters worse, he faces a steep uphill fight against Stephen H. Sachs, a former U.S. attorney for Maryland who has built an impressive war chest and solid volunteer organization in nearly two years of campaigning.

Two other candidates for attorney general are running in the Democratic primary Sept. 12. They are Richard D. Byrd, a Baltimore trial lawyer, and Walter G. Finch, a Baltimore patent lawyer and frequent candidate for statewide office.

Oster, 45, is far from demoralized by his role as underdog candidate. He has plunged into his new political life with relish, replacing the routine pace of an office lawyer with grueling. 15-hour campaign days.

Instead of the squash games and administrative chores that used to fill up his work days, he solicits campaign contributions and meets with Democratic clubs to discuss "walk around money" to pay election day workers.

Instead of tinkering with his 1959 Bentley and relaxing in his affluent Baltimore community, he campaigns at government offices in Upper Marlboro, crab feasts on the Eastern Shore and Polish festivals in Baltimore.

Oster is pinning his political hopes on more than his campaign touch. He believes his 14 years experience in the attorney general's office, including the last three as deputy, will give him an edge over Sachs on election day.

He also believes Maryland voters will reject Sachs' plans to turn the office into a strong prosecuting force to root out the type of political corruption that has been investigated in past years by the U.S. attorney.

"The attorney general is not a super cop," said Oster, who holds that corruption cases should be haldned by the state prosecutor and local state's attorneys who have the constitutional authority to conduct such investigations."

Among Oster's natural allies are members of Maryland's old-line Democratic political establishment, notably suspended Gov. Marvin Mandel, who openly hate Sachs for his aggressive political corruption prosecution in the 1960s.

One of the first volunteers to enlist in the Oster campaign was Frank Harris, Mandel's close friend and former aide, who does advance work for the candidate.Oster acknowledges calling Mandel associates for campaign contributions.

Sachs has repeatedly charged that Mandel's friends, led by power broker Irvin Kovens, would "go broke" trying to derail his candidacy. Lately, Sachs has tried to link Oster directly to the Mandel crowd, suggesting he is the stand-in for it.

Oster admits speaking with Kovens before he entered the race, but insists Kovens has not helped him raise campaign contributions or obtain endorsements. Oster said he has no choice but to rely on old-line Democratic clubs because of his late entry in the race.

It is Oster's strategy to line up support from the entrenched Democratic organizations still loyal to Mandel and rely on them to deliver enough votes on election day to offset Sachs' grassroots support around the state.

Dominic Mimi DiPietro, a Baltimore political boss who normally controls several thousand votes, illustrated the potential of Oster's plan: "When my peoples met Jon, they like him," he said. "When I tell 'em to take Jon, they like him better."

Oster plans to augment whatever organizational help he can obtain with mass media advertisement to increase his low voted ecognition. Last Monday, he raised $50,000 at a dinner to use for television and radio spots.

Sachs, 44, a hard-hitting campaigner who has strongly criticized outgoing Attorney General Francis (Bill) Burch for ignoring political corruption cases, considers Oster "the natural opposition to me. It's almost classic."

Burch and his deputy Oster relinquished the power of their office to federal prosecutors, according to Sachs, by failing to seek authority from the governor to investigate the long line of corrupt Maryland officials.

"They didn't ask because they were part of the club," Sachs asserted. "Oster was the deputy in that club. He is a product of that way of thinking, that narrow, self-protective view of what should be a strong office."