It is 2018, and the director of the National Science Foundation, France Córdova, is tired of learning that male scientists whose research she supports with public funds have sexually harassed their female students, staff and colleagues.

At 71, she still remembers an unwanted sexual remark from a graduate-school professor she had sought out for advice on her astrophysics research. And over the last few years, she has listened to stories — so many stories — shared by younger scientists at conferences for geologists and astronomers.

So last month, Dr. Córdova enacted the kind of structural change experts say is a prerequisite to increasing the ranks of women scientists, who hold only about 30 percent of senior faculty positions in colleges in the United States.

Institutions that accept an N.S.F grant must now notify the agency of any finding related to harassment by the leading scientists working on it — and face the possibility of losing the coveted funds. Individuals may also report harassment directly to the agency, which may then conduct its own investigation. That, too, may result in the suspension of funding.