Michael Ellsberg, a writer in Berkeley, Calif., learned about taking a stand at an early age. His father is Daniel Ellsberg, the former military analyst who leaked the Pentagon Papers in the early 1970s (a story recounted in Steven Spielberg’s Oscar-nominated film “The Post”).

At 40, Michael is taking a very different stand of his own: asking men to honor the #MeToo movement by signing an online Consent Pledge. “I’m a Man, and I Commit to Making Sure All My Sexual Encounters Are Fully Consensual,” it reads.

The idea is for men to take a public vow to honor so-called affirmative consent — that is, to “commit to getting a clear verbal or non-verbal ‘yes’” from sexual partners. Signatories also agree to stop if they do not believe, in their “honest assessment,” that their partners are sober enough to give full consent. The campaign, he said, was inspired in part by a hard look at his own dating history, where he saw in himself too many of the behaviors that women are vividly describing as unwanted.

Mr. Ellsberg, who has written three books including “The Education of Millionaires,” which chronicles the success of wealthy college dropouts, wants 10,000 men to take the vow by June 1. Here are excerpts from a recent interview.

For obvious reasons, women have been most vocal in debating the shifting boundaries of consent. What inspired you to try to get more men involved?

When I read about the Aziz Ansari allegations, I had to reckon with myself and realize, “I’ve been that guy, more than once.” I’ve been that guy who’s pressured, pestered, begged or badgered a woman for sex while on a date. And I know I’m not the only man who is having that realization right now. It’s time for us men to take the lead on educating other men, rather than just getting defensive when women are telling us they want us to change.

Who are you trying to reach with the campaign?

Consent is important for everyone, obviously, including women and gay men. But I’m focusing on men who have sex with women because that’s where I see the most widespread crisis in society, and that’s the group I belong to. The Consent Pledge is for men who are single, in a relationship, married, divorced, monogamous, polyamorous — everyone. As I say on the Pledge, signing it does not mean one has or hasn’t followed it in the past. Many of us are ashamed about times in the past that we’ve disrespected women’s boundaries, and we’re terrified to talk about it, certainly in public.

Are you terrified?

I’m nervous as hell about putting this out, because when you’re a guy talking about consent issues, the first question is, “What’s your record?” My record is far from perfect. I’ve definitely been Robert from “Cat Person.” My personal opinion is that very few guys have a perfect record on respecting sexual boundaries. But I think it’s important for guys to be able to talk about this even knowing that they might be called out for past behavior.

What are your own memories that make you squirm?

I spent my entire 20s completely immersed in the pickup world. I was a wannabe pickup artist. What pickup teaches young men is to view women as objects, and basically try to figure out what kind of robotic, mechanical thing you can say to play on her emotions enough to get her to want to have sex with you.

I used to try to pick up women on the New York City subway. I never touched women on the subway, but I definitely invaded their space. If it’s crowded and a guy is hitting on them, they’re definitely a captive audience and can’t get away. I always thought it was just a numbers game, and was just trying to approach as many as possible. But I realize now that they probably felt really uncomfortable, and I feel terrible about that.

Aside from online channels, how else do you plan to get the word out?

I’m also having as many face-to-face conversations with men as I can. We’re asking young men in particular to make a massive shift in the way the whole courtship dance has played out for hundreds of years — assuming things without knowing things. When it comes to talking about sex before it happens, there are essentially zero examples in movies, TV, books, songs or poems of a guy saying, “Hey, do you want to do this?” before they have sex.

What about the view expressed by some that affirmative consent might be difficult to achieve in all circumstances, given the murkiness of courtship, desire and even sex?

Affirmative consent was created at Antioch College in 1991, and for the first two decades or so of its existence, it’s basically just been the butt of jokes. And I can understand why. It seems mechanical, and foreign. The concept has really only had any widespread cultural currency in the past several years, since California made it state law on college campuses.

It’s now also state law in New York for college campuses, and possibly soon in the entire nation of Sweden. It’s clear to me that enthusiastic consent is the wave of the future. We men can complain about that, ignore it or try to resist it — futilely. But it’s better to get ahead of the curve and learn to do it well.

What do you say to skeptics who insist that it kills the mood to pause before sex to hammer out terms?

The essence of affirmative consent is making sure that your partner is totally good about what’s happening and there’s no reservation. You can make sure in lots of different ways. You don’t have to ask at every juncture, “Can I unbutton your blouse?” “Can I touch your breasts?”

If you’re really committed to looking for the nonverbal signals, you’re just going slowly and making sure from your partner’s body language and eye contact that she’s clearly into it. If you can’t tell, then you stop and ask with words. Once you get the hang of it, it really doesn’t need to be that big of a deal. It’s just like talking about S.T.I.s or birth control before sex. We’ve learned how to do that, I hope, without destroying the possibility of eroticism afterwards.

The campaign is in its infancy, but what’s the response been like among men so far?

Some men are saying that they don’t need to sign it, because they think it’s ridiculous and unnecessary, or because they feel confident they’ve never, ever violated consent.

Some men get it instantly. I am actively encouraging them to do outreach to other men. I want to build an army of male missionaries of affirmative consent, and these are my guys. Some men agree with it, but they’re scared to sign it or talk about it publicly. I can empathize with these men.

I’m a writer who writes openly about sex, drugs and rock ’n’ roll, so to speak. I grew up in a political family and am used to a lot of public jostling. But I must admit, even I am scared about talking about these issues right now.

Was your father an inspiration to you in this campaign?

My father set out some really big shoes for me, and I’m not at all convinced I’m filling them, or ever will. But he was my primary example of how to live life as a man. If you look at my father’s two memoirs, an undertone is the intense guilt he felt at being part of two systems — the nuclear holocaust arsenal he helped build as a war planner, and the Vietnam War — that he came to view as, basically, decent people committing truly evil acts.

His books show the process he went through of extracting himself from these systems and doing what he could to counteract them. This is what I was hearing every night, in seemingly endless lectures at the dinner table, since I was a little boy. So I got the message that, when you see yourself as part of a system that is wrong, you need to extract yourself from it, and do what you can to counteract it.

This interview has been edited and condensed.