Barrett played for the San Diego State Aztecs of San Diego State University from 2013 to 2016. He was redshirted in 2012. He played in 12 games in 2013, recording 8 solo tackles, 7 tackle assists and 3 sacks. He played in 10 games, all starts, in 2014, recording 21 solo tackles, 18 tackle assists, 3 sacks, 3 pass breakups and 1 forced fumble. Barrett earned Honorable Mention All-Mountain West honors in 2014. He played in 14 games, all starts, in 2015, totaling 33 solo tackles, 29 tackle assists, 5.5 sacks, 2 interceptions, 1 pass breakup and 2 forced fumbles. He was named First Team All-Mountain West in 2015. Barrett played in 14 games, all starts, in 2016, recording 29 solo tackles, 24 tackle assists, 7.5 sacks and 4 pass breakups. He garnered First Team All-Mountain West recognition in 2016, becoming the first San Diego State defensive lineman to earn First Team All-Mountain West honors multiple times. He was also a team captain his senior year in 2016. Barrett played in 50 games, starting 38, during his college career, totaling 91 solo tackles, 78 tackle assists, 19 sacks, 2 interceptions, 8 pass breakups, and 3 forced fumbles. His 19 sacks were tied for the fourth most in school history.
Professional career
Barrett was rated the 43rd best defensive end in the 2017 NFL Draft by NFLDraftScout.com.
Barrett signed with the Detroit Lions as an undrafted free agent on May 12, 2017. He was waived by the Lions on September 20 and signed to the team's practice squad on September 22, 2017. He signed a reserve/future contract with the Lions on January 1, 2018. On September 1, 2018, Barrett was waived by the Lions and was signed to the practice squad the next day. He was released on September 19, 2018. He was re-signed on October 31, 2018. He was released on November 6, 2018.
Barrett signed with the Oakland Raiders on April 5, 2019, three days after the AAF suspended football operations. He was waived/injured during final roster cuts on August 30, 2019. He reverted to injured reserve after clearing waivers on September 1, 2019, but was released with an injury settlement on September 3.
On November 27, 2019, Barrett was signed to the San Francisco 49ers practice squad. He re-signed with the 49ers on February 11, 2020. He was waived on July 30, 2020.