In 1999, after nearly a year of working for Rajaratnam, Khan quit Galleon, wanting to start trading her own money in the Internet-stock boom. A month into trading solo, she was visited by F.B.I. agents, who confronted her with the evidence from her indiscretions at Intel. In 2001, she pleaded guilty to wire fraud, and for the next four years, chastened by her crime, she says, she played by the rules and steered clear of Rajaratnam.

Then one day in 2005, “out of the blue, I got a call as I was driving to my house,” she recalled. “Raj said: ‘Oh, I haven’t heard from you. How are you?’ Then he gave me some skinny on the quarter at Intel.”

Rajaratnam’s call came at a time when Khan needed money; within a few years of the Internet bust in 2001, she had lost $49.6 million, according to her lawyer. The Khans paid cash for the Atherton house, but after the meltdown, they took out a $5 million mortgage on it. To pay it, Khan needed to generate $42,000 a month. But it wasn’t only a sense of financial need that led her back to Rajaratnam; Khan’s thinking about her earlier run-in with the law was starting to change. “It’s almost like you are a drug addict, and you go through rehab, and you are clean,” she says. “And then you are constantly at a party every day where people are doing cocaine. How long can you stay clean?” She was struck by the pervasiveness of insider trading on Wall Street and the extent to which skilled traders bent the rules and took calculated risks by defying the law.

At Intel, she had broken the rules by supplying inside information to someone else; now she was willing to use it to make money for herself. Khan began tapping her vast network, leaning on friends, associates and even a cousin to find new avenues of information. She made inroads into Silicon Valley’s close-knit South Asian community, mixing business and pleasure to her advantage. She invited Sunil Bhalla, an executive at Polycom who was dating one of her close friends, to her home for a holiday dinner in December 2005; a few weeks later, she followed up to ask how his company’s quarter was looking. She played auntie to a young woman from Bangladesh who worked for an investor-relations company. Before long, the woman was feeding her information on Google, one of the firm’s clients, and asking for money in exchange (Khan never paid her). Because Khan had been trading on her own, she often wasn’t invited to one-on-one meetings with company executives like other money managers. “That is how you garner all your nuggets in a legal way,” she said. She would talk to a young investment analyst she knew in New York named Tom Hardin. “Tom was my buddy,” she told me. “We used to barter information all the time.”

From time to time, when Khan picked up a juicy bit from Bhalla or her young investor-relations friend, she would call Rajaratnam and pass it along. In 2005, she landed a job at a hedge fund, Trivium, and she liked that Rajaratnam would share information with her that she could pass on to her new bosses. She also hoped by ingratiating herself with Rajaratnam that he might hire her again.

On Nov. 28, 2007, Khan was working in her home office in Atherton when she heard a knock on the door. There were two people standing outside, a man and a woman. She did not recognize either of them. But “the moment they showed me their badges, my heart sank,” she said.

Khan had been maniacal about covering her tracks, registering cellphones under false names and paying off a source through an intermediary. But she was sloppy once. Two years earlier, she was receiving insider tips on Polycom’s earnings from Bhalla. Distracted by the lawsuit with Deutsche Bank and fighting with her housekeeper, she called Bhalla on his cellphone and his home phone. The feds obtained these phone records and discovered that conversations between Khan and Bhalla followed an incriminating instant message Khan sent Rajaratnam: “do not buy plcm till I het guidance.” When investigators showed Khan that they had the instant-message exchange, she knew she would have to come clean. “With Polycom, I felt I couldn’t really lie, because they had the phone communications.” (When the S.E.C. later sued Bhalla, he denied tipping Khan and reached a settlement.)