In 2017, Kavanagh announced that he would run in the special election to succeed Senator
Daniel Squadron, who was resigning to found a non-profit. Not without criticism, Kavanagh was nominated as the Democratic candidate, despite representing very little of the same territory in the state Assembly that the Senate district encompassed. Despite this, Kavanagh easily won election. He was easily re-elected to a full first term in 2018. Kavanagh has been a proponent of election reform. Stating New Yorkers "have some of the worst election laws in the country," Kavanagh introduced a bill "that would allow voters to cast ballots before Election Day". Until New York enacted early voting in 2019, it was the largest state with no advance voting regime. With Democrats taking the majority in the Senate in 2019, Kavanagh was named Chair of the Committee on Housing, Construction and Community Development. Kavanagh was a co-sponsor of the
Climate Leadership and Community Protection Act (CLCPA), enacted in 2019, and has served on the Environmental Conservation Committee in each of his years in the legislature. One of Kavanagh's priorities has been the introduction of extended producer responsibility legislation, which would require producers to be responsible for products from the beginning to end of life. He has introduced legislation in this area for rechargeable batteries, lamps, mattresses, and textiles, among others. Kavanagh authored the "All-Electric Building Act," which became law in 2023, requiring the state energy construction code to halt the use of fossil fuels in new construction in the state. Kavanagh has pursued legislation that would curb gun violence in New York. As the founder and chair of the American State Legislators for Gun Violence Prevention, Kavanagh prioritized working across the aisle to curb access to illegal guns. He is the sponsor of New York's red flag law, which would prevent those who may be a threat to themselves or others from purchasing or possessing a firearm. In February 2026, Kavanaugh stated that he will not seek reelection. ==Personal life==