The Rushmore actress will appear in Sergei Bodrov's fantasy movie, reports Deadline.
The film is based on Joseph Delaney's novel The Spook's Apprentice, the first volume in the children's series 'The Wardstone Chronicles'.
It centres around Thomas J Ward, a seventh son of a seventh son living in the 18th century who goes into training to become a magic-wielding spook.
Williams joins a cast featuring Jeff Bridges, Ben Barnes, Julianne Moore, Alicia Vikander and Kit Harington.
Superman: Man of Steel actress Antje Traue most recently joined the film.
Williams starred in Hanna and will feature in the forthcoming drama Now is Good.
She will play Eleanor Roosevelt in Hyde Park on the Hudson, and will also be seen alongside Keira Knightley, Kelly Macdonald and Downton Abbey's Michelle Dockery in Joe Wright's take on Anna Karenina.
Watch a trailer for Hanna below: