The trial judge called a brief recess one day last week, and Richard William Miller, the only FBI agent to be charged with espionage, heaved his bulky frame out of the witness box and stood mopping his sweating palms with a white handkerchief folded into a perfect square.

At the rear of the courtroom, Assistant U.S. Attorney Bruce G. Merritt huddled with co-prosecutor Richard B. Kendall and their boss, U.S. Attorney Robert C. Bonner.

"To tell you the truth, I don't think that he'll ever break," said Kendall, his look of frustration turning to a glare when he realized that a reporter had overheard.

Miller has spent five days testifying in the trial of two Soviet emigres, Svetlana and Nikolai Ogorodnikov, with whom he is alleged to have conspired to pass secret FBI documents to the Soviet Union in exchange for $65,000 in gold and cash. An immunity grant bars the government from using Miller's testimony against him in his own trial, scheduled for Aug. 6.

Miller, 48, a former counterintelligence agent, acknowledges that he and Svetlana Ogorodnikova, 35, had a sexual relationship that began on their second meeting, at a Little League baseball field. But he denied being part of a conspiracy, insisting that he was trying to redeem "my less-than-desirable reputation at the FBI" by infiltrating a Soviet spy ring.

Ogorodnikova, Miller said, "could introduce me to people with connections with the Soviet consulate, KGB [security police], GRU [military intelligence], whatever, and . . . I'd come out a hero."

Miller said the sexual relationship began because "I had a James Bond kind of fantasy." He added, "That's a bad analogy. I'm no James Bond. I'm not that good a spy."

The exchange that left Miller perspiring and prosecutors frustrated came when Merritt tried to get the witness to repeat a story he told FBI investigators before his arrest.

On the stand, Miller admitted taking a weekend trip with Ogorodnikova to San Francisco and knowing that she was headed for the Soviet consulate. But, in nearly an hour of verbal sparring with Merritt, Miller refused to repeat his previous statement that he had given Ogorodnikova his FBI credentials to present to her case officer as proof that she had recruited an FBI agent. That is not to say, however, that he denied it.

Miller's answers included: "I don't have a specific recollection . . . . The words themselves don't portray the real truth of the matter . . . . I only know that what you said he said, I don't think I said." Some jurors shook their heads. Others snickered.

Miller testified that Ogorodnikova was intoxicated in a Malibu restaurant last August when she told him that she was a Soviet agent and that her government would pay "a lot of money" for his cooperation.

On another occasion, Miller testified, she was so drunk that she got lost in a restaurant: "She had gone to the restroom and then couldn't find the table." Later that night, he said, they went to a motel. Then Ogorodnikova took him to an apartment where she introduced him to a man in a bathrobe she described as "a very important person who handles a lot of money." The man, he said, was Nikolai Ogorodnikov.

If Miller has painted a less-than-pretty picture of Ogorodnikova, Merritt has wrung from his reluctant witness a decidedly unattractive self-portrait.

Miller testifed that problems with weight and job performance led to denied promotions, suspensions without pay and threats of dismissal; checks he wrote to the FBI to repay cash advances bounced; he skimmed money off a payment to an FBI informant; he sold Amway products from his bureau car and sold records of criminal histories to a private investigator.

"That isn't the only time you made a little money on the side?" Merritt asked.

He repeated the question several times, as Miller asked him to be "more specific" and "clarify that as to time and place." When Miller said he "had no recollection," Merritt jogged his memory with the mention of an "asset" -- an FBI informant -- in Los Angeles from whose payment he had skimmed $500.

"Oh, I understand what you're saying," Miller said. He described how he had typed a smaller payment on a piece of adhesive tape, stuck it on the receipt signed by the informant, then peeled off the tape and turned in the voucher for the original amount. Merritt asked how this escaped the informant's notice.

"Being an elderly lady, she wasn't able to see that well, and so she didn't detect the amount," Miller said.