In December 2010, Sheryl Sandberg gave a talk about women’s leadership in which she mentioned “sitting at the table.” Women, she said, have to pull up a chair and sit at the conference-room table rather than clinging to the edges of the room, “because no one gets to the corner office by sitting on the side.”

Less than a year later, I would take those words to heart. I had been working for six years at the Silicon Valley firm Kleiner Perkins Caufield & Byers as a junior partner and chief of staff for managing partner John Doerr. Kleiner was then one of the three most powerful venture-­capital firms in the world. One day, I was part of a small group flying from San Francisco to New York on the private jet of another managing partner, Ted Schlein. I was the first to arrive at Hayward Airport. The main cabin of the plane was set up with four chairs in pairs facing each other. Usually the most powerful seat faces forward, looking at the TV screen, with the second most powerful next to it. Then came the seats facing backward. I was sure the white men booked on the flight (Ted, senior partner Matt Murphy, a tech CEO, and a tech investor) would be taking those four seats and I would end up on the couch in back. But Sheryl’s words echoed in my mind, and I moved to one of the power seats — the fourth, backward-facing seat, but at the table nonetheless. The rest of the folks filed in one by one. Ted sat across from me, the CEO next to him, and the tech investor next to me on my right. Matt ended up with what would have been my original seat on the couch.

Once we were airborne, the CEO, who’d brought along a few bottles of wine, started bragging about meeting Jenna Jameson, talking about her career as the world’s greatest porn star and how he had taken a photo with her at the Playboy Mansion. He asked if I knew who she was and then proceeded to describe her pay-per-view series (Jenna’s American Sex Star), on which women competed for porn-movie contracts by performing sex acts before a live audience.

“Nope,” I said. “Not a show I’m familiar with.”

Then the CEO switched topics. To sex workers. He asked Ted what kind of “girls” he liked. Ted said that he preferred white girls — Eastern European, to be specific.

Eventually we all moved to the couch for a working session to help the tech CEO; he was trying to recruit a woman to his all-male board. I suggested Marissa Mayer, but the CEO looked at me and dismissively said, “Nah, too controversial.” Then he grinned at Ted and added, “Though I would let her join the board because she’s hot.”

Somehow, I got the distinct vibe that the group couldn’t wait to ditch me. And once we landed at Teterboro, the guys made plans to go to a club, while I headed into Manhattan alone. Taking your seat at the table doesn’t work so well, I thought, when no one wants you there. (When Sandberg’s book Lean In came out, that same Jenna Jameson–obsessed CEO became a vocal spokesperson for it.)

Seven months later, I would sue Kleiner Perkins for sexual harassment and discrimination in a widely publicized case in which I was often cast as the villain — incompetent, greedy, aggressive, and cold. My husband and I were both dragged through the mud, our privacy destroyed. For a long time I didn’t challenge those stories, because I wasn’t ready to talk about my experience in detail. Now I am.

When I first got the three pages of specs for a chief-of-staff position at Kleiner Perkins in 2005, it was almost as if someone had copied my résumé. The list of requirements was comically long: an engineering degree (only in computer science or electrical engineering), a law degree and a business degree (only from top schools), management-consulting experience (only at Booz Allen or Bain), start-up experience (only at a top start-up), enterprise-software-­company experience (only at a big established player known for training employees) … oh, and fluency in Mandarin.

John Doerr wanted his new chief of staff to “leverage his time,” which he valued at $200,000 per hour. I liked John. People sometimes compare him to Woody Allen, because he has that strange mixture of nervous energy, nerdy charm, and awkwardness, though John was also an unapologetic salesman. His pitch to me: I would be senior to others in this role; Kleiner Perkins was one of the few VC firms with women, and he wanted to bring even more onboard; diversity was important to him.

In retrospect, there were some early warning signs, like when John declared that he’d specifically requested an Asian woman for my position. He liked the idea of a “Tiger Mom–raised” woman. He usually had two chiefs of staff at a time, one of each gender, but the male one seemed to focus mostly on investing and the female one did more of the grunt work and traveled with him. “There are certain things I am just more comfortable asking a woman to do,” John once told me matter-of-factly.

Still, my new job felt thrilling. At Kleiner, we focused on the really big ideas: the companies that were trying to transform an industry or revolutionize daily life. And John was king of king­makers. He had some early hits: Genentech, Intuit, Amazon. He was one of the first to invest in the internet, with Netscape, and cemented his online reputation later with Google.

In venture capital, a ton of power is concentrated in just a few people who all know one another. Tips and information are exchanged at all-male dinners, outings to Vegas, and sports events. Networks are important inside a VC firm, too. One secret of the venture-capital world is that many firms run on vote trading. A person might offer to vote in favor of investing in another partner’s investment so that partner will support his upcoming investment. Many firms, including Kleiner, also had a veto rule: Any one person could veto another member’s investment. No one ever exercised a veto while I was there, but fear of it motivated us to practice the California art of superficial collegiality, where everything seems tan and shiny on the outside but behind closed doors, people would trash your investment, block it, or send you on unending “rock fetches” — time-consuming, unproductive tasks to stall you until you gave up.

Venture capital’s underbelly of competitiveness exists in part because the more I invest, the less money for you, my partner, to make your investments. And we’re all trying to make as many investments as possible because chances are low that any one investment is going to be successful. Partners can increase their own odds by excluding all of your investments. And as a junior partner you faced another dilemma: Your investments could be poached by senior partners. You wanted to pitch your venture so it would be supported but not so much that it would be stolen. Once a senior partner laid claim to a venture you were driving, you were better off just keeping quiet. Otherwise, you could be branded as having sharp elbows and not being a good team player. But this was true, I noticed, only for women. Junior men could sometimes even take ventures from senior partners.

Predicting who will succeed is an imperfect art, but also, sometimes, a self-fulfilling prophecy. When venture capitalists say — and they do say — “We think it’s young white men, ideally Ivy League dropouts, who are the safest bets,” then invest only in young white men with Ivy League backgrounds, of course young white men with Ivy League backgrounds are the only ones who make money for them. They’re also the only ones who lose money for them.

Sometimes the whole world felt like a nerdy frat house. People in the venture world spoke fondly about the early shenanigans at big companies. A friend told me how he sublet office space to Facebook, only to find people having sex there on the floor of the main public area. They wanted to see if the Reactrix — an interactive floor display hooked up to light sensors — would enhance their experience. At VC meetings, male partners frequently spoke over female colleagues or repeated what the women said and took the credit. Women were admonished when they “raised their voices” yet chastised when they couldn’t “own the room.” When I was still relatively new, a male partner made a big show of passing a plate of cookies around the table — but curiously ignored me and the woman next to him. Part of me thought, They’re just cookies. But after everyone left, my co-worker turned to me and shrugged. “It’s like we don’t exist,” she said.

Then, in 2006, I took a fateful business trip. Ajit Nazre, a fellow partner, had asked me to go with him on a tour of German green-tech start-ups. Every time we were alone in the evening, he would tell me that he and his wife had a terrible relationship, that he was desperately lonely, and that he and I would be good together.

Honestly, I might have considered dating him had he been less arrogant and less married. I was awfully lonely too. After our last set of meetings, Ajit asked for my room number. Since he and I were leaving the next morning, I figured he might want to coordinate our departure for the airport. So I told him the number. But I must have subconsciously given him the wrong one. The next morning at checkout, he was livid. It seemed he’d gone to what he thought was my room and I wasn’t there. He stormed off to the airport by himself.

After the trip, I tried to placate Ajit by sending a couple of friendly emails. He slowly became friendlier; then we worked on a project together, and he was actually helpful. I tried to keep the relationship professional, but he soon started saying that he and his wife were having problems again. I kept up my mantra: “You should do counseling.” Until, one day, he said, “I wanted you to know that my wife and I have separated. We’re getting divorced. I want to be with you.” He’d never said anything like that before. I felt a dash of hope that this could be a real thing.

We started seeing each other and had what eventually amounted to a short-lived, sporadic fling. It was fun bonding over work. Ajit told me the history of the firm and gave me the scoop on departed partners, and I felt like I was at last being let in on company secrets. Finally I had someone who was willing to talk about the dysfunction we saw in our workplace, and to be honest about how decisions were really made.

Then one day in a meeting, one of the managing partners, oblivious to my relationship with Ajit, said, “Can you believe my weekend? I was in a suite at the Ritz-­Carlton at Half Moon Bay, standing on the balcony in my bathrobe, and who did I see? Ajit and his wife walking across the lawn!” I broke it off with Ajit, but I was hopeful we could move past it personally and professionally.

Women were admonished when they “raised their voices” yet

chastised when

they couldn’t

“own the room.”

As it turned out, I would soon meet and fall in love with the man I would marry, Buddy Fletcher. He was a financial arbitrageur who’d helped fund the first professorship for LGBTQ studies at Harvard. During our first date in New York, he told me during hours of conversation that he had previously been with men, something I never had a problem with but which would later be used in the press as evidence that our marriage was a sham. We got engaged just six weeks after we met.

My newly joyous home life was a liability in one sense, though: It made me recognize how very uncomfortable my work situation had become. Ajit had grown increasingly hostile toward me, excluding me from information and meetings. Even with other managers, I often got ignored or interrupted. At one point, John had a suggestion for how I could get more airtime.

He wanted me to go to school — to learn to be a stand-up comic.

Partners had become so aggressive about pursuing ventures I was working on that CEOs started to point it out. One CEO I had been working with, Mike McCue, called me to relate how John and another managing partner, Bing Gordon, had met with him and asked to invest more money in his start-up Flipboard. Just a few months earlier, I had lobbied hard for the firm to go all in and invest a large amount in Flipboard, but had been pushed to take a smaller investment. “They offered to pay $15 million for another 5 percent,” Mike told me. That price worked out to 20 percent higher than in the latest round. When Mike told them he was done raising, they upped their offer to $25 million for 5 percent. I gasped inwardly. We’d had a chance to buy the same number of shares for only $10 million just a month ago.

“Then,” he continued, “Bing asked for a board seat for himself or John. I said no. You know I don’t want anyone but you on my board right now. What is going on?” Now I understood why they hadn’t invited me to the meeting or even told me about it. I had made the initial investment and was a board member, so standard practice would have been for me to be part of any discussions about Flipboard. After the call, I confronted the two partners with Mike’s account. John seemed sheepish and blamed the gambit on Bing. Bing just looked alarmed. I don’t think he ever expected to fail in his bid or be held accountable for his bad manners. I didn’t get an apology, but the look of shock on his face was almost enough to make me feel better. And I could console myself with the knowledge that at least I had relationships worth trying to steal.

Of the few women I encountered at or above my professional level, almost none had young families. One partner told me that when she happily announced her third pregnancy, a male senior partner responded, “I don’t know any professional working woman who has three kids.”

When I gave birth to my first child, some partners at work treated my taking maternity leave as the equivalent of abandoning a ship in the middle of a typhoon to get a manicure. Juliet de Baubigny, one of the partners who had helped recruit me, had warned me that taking time off would put my companies at risk of being commandeered by another partner. I knew two other women who had board seats taken away during their maternity leaves. Juliet coached me on how to keep at least one company by leading their search for a CEO even though technically I was on leave. I’d arranged to take four months off, but after three I felt pressure to return.

Back at Kleiner, I continued to have a huge problem with Ajit. Not only was he blocking my work, he had been promoted to a position of even greater responsibility and was giving me negative reviews. I started to lodge formal complaints about him. In response, the firm suggested I transfer to the China office.

It wasn’t until the spring of 2011 that I finally told a few colleagues about my harassment by Ajit. One instructed me never to mention it again. But when I told fellow junior partner Trae Vassallo, she grew uncharacteristically quiet. Then she said something I never expected: She had been harassed by Ajit, too. He’d asked her out for drinks to talk shop, and in the course of the evening he started touching her with his leg under the table. Then I said something I still feel bad about. I recommended that she not report it. I had, and had been paying the price ever since.

Fortunately, Trae didn’t take my advice. She reported Ajit’s behavior soon after, when she found out he was about to do her review. She was promised that the firm would keep an eye on it, but no other action was taken.

In that round of summer reviews, Kleiner had six junior partners who had worked there for four or more years. The women had twice as many years at Kleiner, but only the men got promoted.

Around the end of November, Ajit persuaded Trae to go to New York with him for an important work trip. He said they’d be having dinner with a CEO who might be able to help one of Trae’s companies. But when they arrived, Trae saw that the table was set for two. The trip was just her and Ajit, in a hotel together for the weekend. Later that night he came to her room in his bathrobe, asking to be let in. She eventually had to push him out the door. Later, when she told one of the managing partners about the fake trip, he said, “You should feel flattered.”

It was now clear to me that the firm was unwilling to take the difficult actions needed to fix its problems. On January 4, 2012, I sent an email to the managing partners presenting all the facts as clearly as I could and asking for substantive changes and either protection from further ostracism or help with an exit.

After more than a month, the company put Ajit on leave. Two tense months after that, he finally left. When I spoke to the COO, he asked how much I wanted in order to quietly leave. “I want no less than what Ajit gets,” I said — which I suspected was around $10 million. The COO gasped.

Life at Kleiner got progressively worse. At one point I found out the partners had taken some CEOs and founders on an all-male ski trip. They spent $50,000 on the private jet to and from Vail. I was later told that they didn’t invite any women because women probably wouldn’t want to share a condo with men.

Finally, an outside independent investigator looked into Trae’s complaint and the issues I’d raised in my memo. Almost all of the women came to me after their interviews with him and said the same thing: “He really didn’t ask questions. He asked if we had ever seen porn in the office.” He didn’t seem interested in finding out about actual discrimination, bias, or harassment.

In my own interview, when I mentioned that my colleagues had talked about a porn star when we were on a plane together, the investigator asked if it was Sasha Grey. I said no. He pressed the point, saying that Sasha Grey was crossing over into legitimate acting. At another point, the investigator asked, in a ­“gotcha” tone, “Well, if they look down on women so much, if they block you from opportunities, they don’t include you at their events, why do they even keep you around in the first place?”

I hadn’t thought about it before. I replied slowly as the answer crystallized in my mind: If you had the opportunity to have workers who were overeducated, underpaid, and highly experienced, whom you could dump all the menial tasks you didn’t want to do on, whom you could get to clean up all the problems, and whom you could create a second class out of, wouldn’t you want them to stay?

I noticed he didn’t write that down in his notebook. Among the other things the investigator did not write down: that there was no sexual-harassment training, not even a line in the hiring paperwork saying: Hey, be appropriate. Don’t do things that make people feel uncomfortable. Don’t touch people. Kleiner’s managing partners flouted hiring rules, too, asking inappropriate questions in interviews like: Are you married? Do you have kids? How old are you? Are you thinking about having kids? What does your husband do? What did your ex-husband do? It was noted at some point that such questions created a giant legal risk, and the response was, effectively, Well, who’s going to sue us?

Courtroom drawings from the 2015 Pao v. Kleiner Perkins trial. Clockwise: Pao on the stand; Doerr, Pao’s former boss, testifying before the jury.; Pao hugging her lawyer after the closing arguments.; The court clerk reading the verdict. Illustration: Vicki Behringer

Apparently, me. My claim — 12 pages covering everything that had happened to me over seven years at Kleiner — specified gender discrimination in promotion and pay, and retaliation against me after I reported the harassment. I asked for damages to cover the lost pay and to prevent them from doing it again. Meanwhile, Kleiner had notified me that its investigation was done: The finding was that there had been no retaliation or discrimination.

In response to my suit, Kleiner hired a powerful crisis-­management PR firm, Brunswick. On their website, they bragged about having troll farms — “integrated networks of influence,” used in part for “reputation management” — and I believe they enlisted one to defame me online. Dozens, then thousands, of messages a day derided me as bad at my job, crazy, an embarrassment. Repeatedly, Kleiner called me a “poor performer.” A Vanity Fair story implied that Buddy was gay, a fraud, and a fake husband.

My lawyer said my case would be stronger if I continued to work at Kleiner. The general partners sometimes had long meetings to discuss the lawsuit; the ten of them would file into one of the large, windowed conference rooms. I could see them hunched around the table looking annoyed as a team of lawyers blared over the speaker­phone. If I walked down the hall, the room would fall silent and their eyes would follow me until I was out of sight.

I tried to stay focused on my personal life. After a lot of trying, I was pregnant with our second child. Still, the negativity wore me down. Then in June 2012, during a regular checkup, my doctor looked at the sonogram and I could tell something was wrong. I’d had a miscarriage.

“When I saw all the horrible things being said about you,” he said, “I was worried about you and the baby. Stress can be a factor.” He was referring to an article in the New York Times in which an expert was quoted saying he was skeptical about my claims because he hadn’t ever heard of mistreatment of women in Silicon Valley. I felt, in that moment, that Kleiner had taken everything from me.

Then I had my summer review. Ted and Matt told me that CEOs had complained about my board performance. When I asked which ones, Matt just said, “All of them.”

A few months later, Matt asked me to leave, claiming I hadn’t improved since my last review. I was told to be out of the office by the end of the day. On the drive home, I wept. Some of it was sorrow. Most of it was relief.

The trial would last five weeks. Lynne Hermle of Orrick, Kleiner’s defense attorney, had once been so intense during another case that she’d made an opponent vomit in the courtroom, and she wasted no time in painting a picture of me as talentless, stupid, and greedy. “She did not have the necessary skills for the job,” she said. “She did not even come close.”

At other times, the trial was almost gratifying. The CFO, who was also still at Kleiner, admitted that until 2012 the company didn’t even have an HR department and didn’t provide employees with an anti-discrimination policy; they hadn’t had one until Trae and I formally raised our concerns. When Hermle tried to show that women did rise at Kleiner, we pointed out that nearly all those promotions had happened since I brought up these issues. At the start of 2012, when Trae and I had lodged our complaint, only one woman in the firm’s 40-year history had ever been promoted to senior partner.

And anomalies in reviews were finally cleared up: It turned out that Ted had set up a process designed to make me look bad. He started with the standard procedure: I was asked to list people I had worked with; our outside consultant asked everyone on my list to review me; she organized their feedback and sent it to Ted. Ted then solicited negative feedback from phantom reviewers — people I had not worked closely with, who were not on my list, and whom he didn’t list as reviewers in the final document. The everyone-hates-you feedback Ted had delivered was in fact from a board-member crony of his and another venture capitalist I had not worked with much at all.

I’d be lying if I said it wasn’t a thrill to hear Ted questioned by one of my lawyers, Alan Exelrod, about the positive feedback he’d hidden from me and excluded from my review. Had we not gone to trial, it would never have surfaced.

Alan: He said that “She was very engaged and proactive,” correct? Ted: Yes. Alan: And that “She tries very hard to be helpful”? Ted: Correct. Alan: “100 percent behind the company”? Ted: Yes. Alan: “She is one of the three people I call from the board for her advice”? Ted: Correct.

Such satisfaction was short-lived. The verdict came down on March 27, 2015: I had lost on all four counts.

Before suing, I’d consulted other women who had sued big, powerful companies over harassment and discrimination, and they all gave me pretty much the same advice: “Don’t do it.” One woman told me, “It’s a complete mismatch of resources. They don’t fight fair. Even if you win, it will destroy your reputation.”

Renée Fassbender Amochaev, an investment adviser, told me she’d been miserable from the moment she filed her lawsuit. She became an outcast and a target. Her co-workers started a petition to have her leave. Every morning, she would get to the parking lot and throw up.

“You have to prepare for it to be harder than you can even imagine,” she said. “Do you regret it?” I asked. There was a pause. “No,” she said.

Losing my suit hurt, but I didn’t have regrets either. I could have received millions from Kleiner if I would just have signed a non-disparagement contract; I turned it down so I could finally share my story, which I have been doing by speaking at events across the country and through Project Include — a nonprofit I co-founded to give everyone a fair shot to succeed in tech. I started it with an impressive group of women from the tech industry, many of whom shared similarly painful experiences.

We channeled our frustration with the tepid “diversity solutions” prevalent in the industry, ones focused on PR-oriented initiatives that spend more time outlining the problems than implementing solutions. To become truly inclusive, companies needed solutions that included all people, covered everything a company does, and used detailed metrics to hold leaders accountable. So we decided to give CEOs and start-ups just that. We launched on May 3, 2016, with 87 recommendations. Since then, more than 1,500 people have signed up in support of our efforts, including 100 tech CEOs. Soon after, we partnered with ten start-up CEOs who were far along in their understanding of diversity and inclusion to help them address these issues in their own companies. We’ve had to reassure some of them that we aren’t out to shame them; we just offer a starting point and a supportive community. We’ve also partnered with 16 tech-focused investment firms; through them, we’ll be collecting industry­wide diversity data to help set benchmarks across the tech sector.

It was a huge relief to be past the explain-define-and-prove-the-problem-exists conversations my co-founders and I had each gotten dragged into too many times. Over the past year, despite the ongoing public exposure of the ways both the president and tech companies like Uber discourage diversity and inclusion, we’ve seen results that give us hope. More personally, I’ve come out of the experience with great friends and supporters. We’ve changed jobs, started companies, taken time off, moved across the country, and switched careers. I’ve watched as each of us — myself included — has become more vocal, more open, and more courageous in advocating for change in tech.

In the wake of my suit, I often heard people say that my case was a matter of “right issues, wrong plaintiff,” or that the reason I lost was because I wasn’t a “perfect victim.” I’ll grant that only someone a little bit masochistic would sign up for the onslaught of personal attacks that comes with a high-profile case, but I reject the argument that I wasn’t the right person to bring suit. I was one of the only people who had the resources and the position to do so. I believed I had an obligation to speak out about what I’d seen.

Since the trial, I have had time to think of all the things I wished I’d done differently. I might have had better luck with public opinion, for instance, if I’d spent more time with the press and prepared a few pages of talking points every day, like Kleiner had. But Kleiner also had tremendous resources that I couldn’t match, and it made a difference. For example, I didn’t have time to go through all my emails to figure out which ones to give Kleiner, so during the discovery process we gave them practically everything, some 700,000 emails — most of which we could have legally withheld. Kleiner meanwhile handed over just 5,000 emails, claiming they didn’t have the resources to search for anything other than emails that we specifically requested. They did have the resources to pick over my emails, though — I heard they hired a team in India to read and sort through every single one. Their work would show: During depositions, they brought up everything from my nanny’s contract to an exercise I’d done in therapy where I listed resentments. Emails to friends, emails to my husband, emails to other family members, even emails to my lawyers.

In retrospect, the most painful part of the trial was being cross-examined by Kleiner’s lawyer. At one point, she claimed I’d never invested in a woman’s company. “You’ve never done anything for women, have you?” she said snidely. I’d been instructed by my lawyers not to respond to comments like that, because it might open me up to more criticism — jurors could find me difficult or aggressive, the very things Kleiner was trying so hard to portray me as in court. I ended up coming across as distant, even a bit robotic, as I tried to keep my answers noncombative. But it hurt to leave that one unchallenged. It was patently false. At Kleiner, I helped drive investments in six women founders. A few months after I was fired by Kleiner, I invested in ten companies with my own money; five had women CEOs. But I didn’t say any of that. I just sat there.

Before my suit was over, though, other women had begun to sue tech companies with public filings. One of my lawyers represented a Taiwanese woman who sued Facebook for discrimination; her suit alleged that she was given menial tasks like serving drinks to the men on the team. Another lawyer at the firm represented Whitney Wolfe, one of the co-founders at Tinder, who sued for sexual harassment. Both of those suits settled, but others, against Microsoft and Twitter, are ongoing. Some reporters even came up with a name for the phenomenon of women or minorities in tech suing or speaking up. They called it the “Pao effect.”

Excerpted from the book Reset, by Ellen Pao. Copyright © 2017 by Ellen K. Pao. Published by Spiegel & Grau, an imprint of Random House, a division of Penguin Random House LLC.

*This article appears in the August 21, 2017, issue of New York Magazine.