Williams follows team-mates Cam Winnett, Ben Thomas, Liam Belcher and Alun Lawrence in signing new deals at the Arms Park, as well as Regan Grace until the end of the season.
Cardiff-born fly-half Ioan Lloyd, 23, also looks set to join Cardiff from Scarlets in the summer.
Sherratt added: “We have been very clear with our ambition of ensuring our homegrown players are committed to the club and I am delighted that we have secured the services of Teddy.”
Williams’ late father Owain played for Cardiff, while younger brother Gabe has also broken into the region’s under-18s squad.
“The club means a lot to me and it just feels like this is the right place for me to progress,” said Williams.
“The club is moving in the right direction and I feel I’m playing some of my best rugby right now. Hopefully that can see me play more for Wales.”