The deal is pending a physical.
Originally signed out of the Dominican Republic in 2007, Baez posted a 3.03 ERA, a 1.10 WHIP and a 3.08 strikeout-to-walk ratio in 355 career appearances while having what felt like a love-hate relationship with Dodgers fans because of some dramatic highs and lows.
Baez, 32, missed nearly a month with a groin injury in 2020 but still managed 3.18 ERA and a 1.00 WHIP in 17 regular-season innings.
Baez’s agreement with the Astros was first reported by the Los Angeles Times.
ESPN’s Alden Gonzalez contributed to this report.