US secretary of war, Henry L. Stimson (1940-45) stated that "having this weapon rather ostentatiously on our hip, their suspicions and their (Soviets) distrust of our purposes and motives will increase." (from the book "Atomic" by Jim Baggott) This quote is spoken in a way that the US thought they were at the forefront of military technology (A-bomb wise) but was spoken at a time were nuclear intelligence was sent to the USSR practically daily. Did the US know that there were spies on US territory, or at least, that the Soviets were making serious progressions in project "Enormoz" (Soviet a-bomb development)?
The FBI knew there was at least one major spy at Los Alamos in late 1949, but kept that fact exceptionally close, to the point that knowledge of who the spy was and their significance was not know to other agencies or the President until February 1950, when Klaus Fuchs was arrested in the UK and confessed.
Prior to that, the only other major "atomic spy scandal" was the Gouzenko affair, which involved a cipher clerk in Canada, which was leaked to the public in February 1946. The Gouzenko affair was a much more minor thing than someone like Fuchs; it was on the periphery of the project.
During the war, the Manhattan Project had detected attempts by the Soviets to penetrate the project in Berkeley, and had foiled them. So they were aware that the Soviets were interested in the project (though there was no indication that the Soviets really knew what it was, just that there was something going on they'd like to know more about), but the Manhattan Project security people incorrectly believed that they had caused the espionage effort to be unsuccessful. This was reported to Roosevelt and Stimson (and Truman, later, but it isn't clear how closely Truman paid attention to it).
So yeah, that Stimson quote from December 1945, where he was arguing that the Soviets would be able to eventually get their own weapons if left to their own devices (and thus urging Truman to support some kind of treaty that would verifiably ban nuclear weapon production), was based on the idea that the Soviets did not yet know much more about how to make atomic bombs than had already been released publicly at that point (which was still not inconsiderable — the Smyth Report, released a few days after the bombings, gives a pretty good overall blueprint to how it is done, and was looked at very carefully by the Soviets), but that they were totally capable of figuring it out on their own if they decided to do so. Had Stimson considered the possibility of deep espionage, I am sure it would have only added urgency to his argument, because it would possibly reduce the amount of time that such a treaty might have an effect.
I don't love to self-cite, but for more about US knowledge of Soviet espionage, international control ideas, the effects of Soviet espionage, etc., you might find my own book, Restricted Data: The History of Nuclear Secrecy in the United States (University of Chicago Press, 2021), of interest, as this is covered in close detail in the first few chapters. It is, I think, a pretty fascinating set of ideas and circumstances...!