We report an unprecedented, eco-friendly, in situ activatable model antibiotic, phenylalanyl-polyethylenimine (PhePEI), to potentially diminish antibiotic pollution of the environment and associated antibiotic resistance. The inactive PhePEI can be reversibly activated upon supramolecular crosslinking by cucurbit[8]uril, conferring potent antibacterial activity.