In late August 1945, with the work of the Office of Strategic Services, the United States’ wartime intelligence agency, winding down, Col. John Coughlin, commander of the O.S.S. detachment in Ceylon, called a field agent named Jane Foster to his bungalow. Foster assumed she was in trouble, since she usually was. (She liked to say she was the organization’s “most-threatened-with-court-­martial person.”) Instead Coughlin poured her a drink and asked if she would volunteer to report on the postwar transition in Java. Wouldn’t she! Foster, who spoke Malay and had lived in Batavia, had already told a friend about her “confidential plan” to infiltrate a small Indonesian island and emerge as “the Great White Queen of Bali.” The friend half-believed her. With Foster, she recalled, “you could never tell.”

Foster’s good looks, lively personality and independent wealth made her the ideal O.S.S. recruit. So did her sense of invulnerability and self-importance. She was famous for her escapades. Thus in Jennet Conant’s new book, “A Covert Affair: Julia Child and Paul Child in the OSS,” most of the adventures are Foster’s. Paul Child and Julia McWilliams, both wartime members of the O.S.S. based in Ceylon and then Kunming, were among the amused audience watching Foster’s dramas — until they were briefly baffled participants.

When Foster returned to the United States, she briefed Dean Acheson, but she also gave her report to a man named Jack Soble, who turned out to be part of a Communist espionage ring. Foster happened to have joined the party herself before the war, although in the O.S.S., Conant writes, that hardly mattered. The organization “had the lenient, idiosyncratic atmosphere of a small college, with the same tolerance for campus radicals, zealots and oddballs.”

But after the war, everything changed. Federal agents followed Foster, and her friends became suspects. In 1955, a telegram summoned Paul Child back to Washington from his government job in Germany. It turned out he was under investigation, and the F.B.I. wanted to know about his connections to Foster. Child was quickly cleared, but the experience left him and Julia, now married, outraged and incredulous, finding it difficult to believe that their friend could have been a traitor. Conant, who has studied the fragmentary declassified files, suggests the verdict is, at best, ambiguous.