CD8-positive T cells protect the body against viral pathogens by two important mechanisms: production of antiviral cytokines and lysis of infected cells. Cytokine production can have both local and systemic consequences, whereas cytolytic activity is limited to infected cells that are in direct contact with T cells. Here we analyse activated CD8-positive T cells from mice infected with lymphocytic choriomeningitis virus and find that cytokines are not produced ex vivo in the absence of peptide stimulation, but that they are rapidly generated after T cells encounter viral peptides bound to the major histocompatibility complex. Remarkably, cytokine production ceases immediately upon dissociation of the T cells from their targets and resumes when antigenic contact is restored. In contrast to the 'on/off/on' cycling of cytokines, the pore-forming cytotoxic protein perforin is constitutively maintained. Our results indicate that there is differential expression of effector molecules according to whether the antiviral product is secreted (like cytokines) or stored inside the cell (like perforin). The ability to turn cytokines on and off while maintaining intracellular stores of perforin shows the versatility of the cellular immune response and provides a mechanism for maintaining effective immune surveillance while reducing systemic immunopathology.