Foster attended Seaside High School, where he played for the Seaside Spartans high school football team, leading them to a 12-1 overall record, a 5-0 league record, a Monterey Bay league title and the CIF Central Coast Section small school championship in 2006. Foster led a defense that allowed just six points per game during the regular season and recorded four shutouts, as well as taking over at quarterback midway through the season. Foster was named the Monterey County player of the year by the Monterey Herald, defensive player of the year by the Salinas Californian, an All-Central Coast Section first-team linebacker by the San Jose Mercury News, and CalHiSports all-state first team for 2006. He was ranked the No. 68 linebacker recruit in the country by Rivals.com.
Considered a three-star recruit by Rivals.com, Foster was listed as the No. 68 outside linebacker in the nation in 2007.
As a true freshman in 2007, Foster played in all 13 games, starting four games including three at weakside linebacker and one at middle linebacker.
As a sophomore in 2008, Foster started all 12 at one outside linebacker spot, leading the Pac-10 Conference in tackles per game with 8.75 and topped the Washington's team with 12.0 tackles for loss. Foster earned honorable mention All-Pac-10 as well as being named the Huskies' team MVP (Defense).
As a junior in 2009, Foster started all 12 of the Huskies' games at one linebacker spot, finishing second on the team with 85 total tackles while leading the Pac-10 with six forced fumbles. Named honorable mention All-Pac-10 as well as The Sporting News' All-Pac-10 first team.
As a senior in 2010, Foster started all 13 of the Huskies' games at linebacker, recording 162 tackles (12.46/gm) finishing second in FBS. Foster was named an All-American. Earned Defensive MVP honors for the 2011 Holiday Bowl in a win over Nebraska. Was invited to, and played in the 2011 Senior Bowl.
In the months leading up to the 2011 NFL Draft, Foster was considered one of the top linebackers and was expected to be selected in the 3rd or 4th round. After the Senior Bowl, analysts were in agreement that he had in fact improved his draft stock with many saying he could go as high as the late second round. Foster continued to impress at the NFL Scouting Combine where he performed very well in the on-field drills.
Foster was selected in the 3rd round (84th overall) by the Tampa Bay Buccaneers in the 2011 NFL Draft. He was fined $20,000 for a hit on Chad Ochocinco following the second preseason game. Ochocinco offered to pay the fine for him, as he disagreed with the league's decision, but the league stated that he would not be able to. Foster began his rookie season as the Buccaneers' starting middle linebacker. Foster would finish the season with 84 combined tackles, two sacks, and a forced fumble and interception.
Foster's sophomore campaign in 2012 would yield yet another strong outing. Along with rookie outside linebacker Lavonte David, Foster would post solid numbers only second to David creating a strong linebacker corps. His stats for 2012 were 105 combined tackles and 2 quarterback sacks. His 2013 season saw his tackle production decrease to 92 combined tackles, but he again posted 2 Quarterback sacks followed by 1 forced fumble and 3 interceptions with 2 of the interceptions being returned for touchdowns. With the arrival of new head coach Lovie Smith in 2014, Foster would see a decline in his over all play as well as a shortened season due to injuries. The complicated system and injuries sustained late in the year saw a dramatic drop from his usual prowess only compiling 62 combined tackles all year with no interceptions, quarterback sacks, or forced fumbles feeling very out of place in the Tampa 2 resulting in the end of his Buccaneers career.
On March 24, 2015, Foster signed a one-year deal with the Chicago Bears. On September 5, 2015, Foster was waived.
Foster signed with the Washington Redskins on September 29, 2015. He made his first start with the team at inside linebacker on a Monday Night Football game against the Dallas Cowboys on December 7, 2015. Foster ended up starting every game for the rest of the season at the position, and eventually re-signed with the team on March 9, 2016. In a game against the Los Angeles Rams in September 2017, Foster caught an interception from Rams quarterback Jared Goff late in the fourth quarter in a 27–20 Redskins victory.