This article does not give the full picture:
Hemingway was in periodic contact with the Soviet foreign intelligence servicethe NKVD (the Peoples Commissariat for Internal Affairs)while at the same time in contact with and informally assisting both the US Navy Office of Naval Intelligence (ONI) and, following the invasion of France in June 1944, the Office of Strategic Services (OSS). The question that Reynolds poses throughout the book is, Who was in charge of this relationship? By the time the reader finishes the book, the only reasonable answer is, Ernest Hemingway was in charge.
He was an entrepreneurial adventurer that used his contacts IRL to get stories for his writing.
11 page article:
It is impossible to know; there is just not enough information, and that situation is unlikely to change unless his entire NKVD file becomes accessible or previously unknown Hemingway letters come to light. We are left with the irony that four organizations that could not agree on muchthe NKVD, OSS, FBI, and Department of Stateall arrived separately at the same conclusion: Ernest Hemingway may have wanted to be a spy, but he never lived up to his potential.
https://www.cia.gov/library/center-for-the-study-of-intelligence/csi-publications/csi-studies/studies/vol.-56-no.-2/pdfs/Reynolds-Hemingway%20A%20Dubious%20Spy.pdf