Sarfraz is due to play the final five group games as a replacement overseas player for Peter Handscomb, who will leave after Sunday’s match against Notts at Trent Bridge to attend a training camp ahead of Australia’s tour to Bangladesh.
Shaun Marsh, the club’s other T20 overseas player, will stand in for Handscomb in the remaining five County Championship fixtures.
Sarfraz, 30, is due to arrive in England later this week and is set to make his debut against Derbyshire at Headingley on August 3.
“I’ve always wanted to play county cricket, so this is an exciting opportunity for me,” he said.
“Yorkshire are a big club with a rich history and huge reputation, and I’m proud to be following in the footsteps of other Pakistanis who have played at Headingley like Younus Khan and Inzamam-ul-Haq.
“It’s a dream come true for me and hopefully it can help me become an even better professional.”
Martyn Moxon, Yorkshire’s director of cricket, said: “We looked at Pete’s role in T20 as a wicketkeeper/batsman who bats in the top five.
“Through trying to keep the consistency and balance of the team as it is currently, Sarfraz was the perfect choice for that role.”