All chemicals and solvents were of analytic grade and were bought from commercial sources without further purification. The solutions of anions and metal ions were used as sodium and chloride salts, respectively. UV/visible (UV/Vis) absorption spectra were recorded through UV 1901 spectroscopy (Shanghai Lengguang Technology Co., Ltd., China). The pH measurements This paper reports that changing metal ions (Co 2+ , Ni 2+ , Cu 2+ , or Cd 2+ ) in the 2-(2-thiazolylazo)-p-cresol (TAC)-metal ensemble may generate varied optical responses to anions. The TAC and Ni 2+ ensemble can detect and quantify CN -in a highly sensitive and selective manner. CN -competes for the Ni 2+ present in the ensemble during recognition events, which thereby triggers colorimetric and absorption spectral changes. CN -and S 2-decomposed TAC-Cu 2+ ensemble by forming [Cu(CN)x] n-species and CuS, respectively; however, the discrimination of CN -and S 2-was not achieved. The TAC-Co 2+ ensemble exhibited discriminated interaction with CN -through the absorption channel, but CN -was not quantitatively determined. Although the TAC-Cd 2+ ensemble responded to different anions, it did not recognize each anion selectively. These results demonstrated that metal ions can powerfully modulate anion identification to some extent, which can be an effective strategy to achieve selectivity of certain anions by varying the metal ions in the ensemble.