Cobb still must pass a physical to complete the deal.
A 34-year-old free agent, Cobb would give the reigning NL West champions a key veteran near the front of the pitching rotation after the departure of All-Star righty Kevin Gausman to the Toronto Blue Jays on a $110 million, five-year contract.
Cobb went 8-3 with a 3.76 ERA over 18 starts and 93⅓ innings for the Los Angeles Angels this year. He struck out 98 batters and walked 33.
San Francisco set a franchise record with 107 wins and edged the rival, 106-win Dodgers on the final day of the regular season before losing to Los Angeles in a thrilling five-game NL Division Series.
Earlier this month, the Giants declined their $22 million contract option on right-hander Johnny Cueto.
MLB Network first reported Cobb was close to a deal.
Information from The Associated Press was used in this report.