The 22-year-old flanker has made 36 appearances for the Blues and scored three tries but will now move to the French side, who could be promoted back into the Top 14.
Agen are in fine form having won their last five games, securing a Pro D2 play-off position, in their fight to regain top-flight status.
A former Coleg Sir Gar student, Hamilton came through the Scarlets Academy after playing for them at U18 level. He was invited to join the Blues Academy following his release from the West Wales region.
Hamilton was an integral part of the Wales U20 Junior World Championship campaigns in 2011 and 2012 – scoring one try in his 13 appearances. He made his Blues debut at flanker during the 2010/11 season against Exeter Chiefs in the LV= Cup and has played 10 times so far this term.
The back-row has penned a two-year deal with the eight-time French champions and expressed his delight on twitter.
“Delighted to have signed for Agen Rugby for the next two years, really looking forward to it,” said the former Llandovery and Glamorgan Wanderers player, who also thanked the Blues and their fans for their support during his four-and-a-half-year stay.
Hamilton becomes the second Blues player to commit his future to France after Chris Czekaj confirmed his switch to Colomiers.
The winger, who has nine caps for Wales, enjoyed a long and successful period with the region, having made 143 appearances over the last decade. He has scored 26 tries since making his Celtic League debut back in 2004 and is fifth in the Blues’ all-time try scoring standings. Czekaj and Hamilton could face each other next season if Agen fail to win promotion.