Here i am sending you a paper, it may help you to understand mechanism of cyanotoxin production.... many other publications are also available on Google scholar.
Cyanotoxins appear to have evolved due to a combination of pressures from abiotic or biotic factors. According to review by Holland and Kinner (2013), cyanotoxin production is dependent on a number of environmental conditions including nutrient concentration (e.g. nitrogen limiting or nitrogen abundant environments), light intensity (e.g. the transcription of two genes responsible for microcystin production was shown to be influenced by light quality) and temperature (e.g. maximum cylindrospermopsin concentrations are often found at 20 °C whereas production ceasing at temperatures exceeding 35 °C). The presence of a competitor or predator influences the level of production of many cyanotoxins (e.g. production of anatoxin-a by Anabaena flos-aquae was shown to increase in the presence of the green alga Chlamydomonas reinhardtii, microcystin production by Microcystis were shown to increase upon direct or indirect exposure to grazers such as microcrustaceans and phytoplanktivorous fish
Reference
Aleicia Holland and Susan Kinnear 2013. Interpreting the Possible Ecological Role(s) of Cyanotoxins: Compounds for Competitive Advantage and/or Physiological Aide? Mar. Drugs. 11: 2239-2258; doi:10.3390/md11072239.