Cancer vaccines based on autologous tumor antigens hold profound promise for antitumor immunotherapy but are challenged by the low efficiency and lack of cancer-selectivity in terms of antigen capture and immune activation. Herein, a self-adjuvanted vaccine precursor was developed from conformation-transformable, spiked polypeptides that can mediate conditional antigen capture and STING activation to form in situ cancer vaccine. The vaccine precursor was constructed from melittin-encapsulated mesoporous silica nanoparticles (MSN) covalently decorated with the DMXAA (a STING agonist)-conjugated polypeptides. At the dormant state, the polypeptides adopted the flexible, random-coiled conformation, preventing the capture of nonantigen proteins and camouflaging the hydrophobic DMXAA. Inside the mildly acidic tumor microenvironment, the polypeptides transformed into rigid, rod-like helices which formed the spiked array structure. Such a structure triggered melittin release to kill cancer cells and generate autologous antigens and, more noteworthy, enabled antigen capture inside the pockets among helix rods and STING activation through polyvalent display of the DMXAA motifs. As such, the in situ formed nanovaccine elicited robust antitumor immunity to inhibit tumor growth and recurrence in B16F10 tumor-bearing mice. This study represents an enlightened paradigm for constructing personalized cancer vaccines, and the control over polymer conformation, realized via the manipulation of chain rigidity and flexibility, provides a distinctive design strategy to regulate the interactions with biomacromolecules.