The Hollywood heartthrob, 58, will apparently play a driver who decides to come out of retirement to help and up and coming driver.
Hamilton, 37, won't star in the movie but will be behind the scenes.
Rumours about the project started swirling this week, and Hamilton has now said that it's a go.
The website formula1.com quoted him as saying: "It’s a really cool project and we are already working on the script for example, I’m much involved in the script, which is fun, and spending good time with Brad, which is pretty epic… and really from my responsibilities and something that I take on is just making sure the cast and crew in the background is diverse, something I really highlighted at the beginning."
Hamilton - who has won has won a joint-record seven World Drivers' Championship titles (tied with Michael Schumacher) - said that those behind the film want to show how great the sport really is.
They are also focused on keeping the real heritage and the true racing spirit in the film, which so far doesn't have a title.
"If you look at all the racing movies, you can't necessarily say all the racing movies that have been in the past have been spectacular and that’s something we want to change," he said.
Top Gun: Maverick filmmaker Joseph Kosinski looks set to direct.
Watch: Brad Pitt and Angelina Jolie are headed back to court