The deal is worth $42 million with $21.3 million guaranteed, $16.7 million of which is fully guaranteed at signing, a source told ESPN's Dan Graziano.
After the Los Angeles Rams and Joyner were unable to come to a long-term agreement, he played last season on the franchise tag and earned $11.28 million. He intercepted one pass and ranked third on the team with 78 tackles.
The Raiders' deal with Joyner comes just two days after the team reportedly agreed to a trade with the Pittsburgh Steelers for All-Pro receiver Antonio Brown. Oakland will be handing Brown a three-year deal worth up to $54.125 million, with $30.125 million guaranteed, a source told Schefter.
The Rams selected Joyner from Florida State in the second round (41st overall) of the 2014 draft.
Joyner, 5-foot-8 and 191 pounds, played primarily at cornerback for three seasons before defensive coordinator Wade Phillips moved him to safety in 2017.
In five seasons, Joyner, 28, has four interceptions, including one returned for a touchdown, 25 pass deflections and five sacks.
ESPN's Lindsey Thiry contributed to this report.