Riley announced his destination on Twitter on Friday:
The Fresno State product joined the Titans after going undrafted in 2015. After sitting out his first NFL season with an ankle injury, he filled a reserve role in the secondary over the next two years. He made 11 combined tackles and one interception across 11 appearances.
Riley signed a one-year contract with the Giants last March and won a starting job for the first time in his career.
The 26-year-old safety tallied 75 combined tackles, five passed defended and four interceptions, including one he returned for a touchdown, while starting all 16 games for New York.
Although he posted his best statistical season, Pro Football Focus only graded him as the league's 79th-best safety for 2018.
Riley was benched during the Giants' Week 17 game against the Dallas Cowboys for his lackluster effort to make a tackle on a 39-yard touchdown catch by Blake Jarwin.
"I don't need one," he told Greg Joyce of the New York Post about not being given a reason for his benching. "I'm straight. They made a decision that they needed to make."
Riley will likely serve in a depth capacity behind Lamarcus Joyner and Karl Joseph in Oakland.