Yes, there is a serious risk of terrorism in Tunisia and foreign travelers are vulnerable. Extremist Islamic groups are active across the region. Previous Modus Operandi (MO) has included the targeting of popular tourist locations resulting in mass fatalities.
It is likely extremist organizations have the capability to mount attacks against foreign travelers in Tunis if the opportunity is presented. Remain cautious of the threat and consider the risks if located in tourist locations.