Inclusion
Age \>= 18 years
Eastern Cooperative Oncology Group (ECOG) Performance Status 0-2
Triple Negative Breast Cancer:
Patients with a history of clinical stage T1cN1-2 or T2-4N0-2 (clinical stage II or III prior to preoperative therapy) breast cancer at time of diagnosis according to the primary tumor-regional lymph node anatomic staging criteria of the American Joint Committee on Cancer (AJCC), 8th edition as determined by the investigator in radiologic assessment, clinical assessment or both
Patients must have no residual invasive disease in the breast or lymph nodes after the completion of neoadjuvant therapy. Residual ductal carcinoma in situ (DCIS) is allowed. Isolated tumor cells are considered node-negative
Estrogen receptor (ER) and progesterone receptor (PR) =\< 10%; HER2-negative by American Society of Clinical Oncology (ASCO)/College of American Pathologists (CAP) guidelines (immunohistochemistry \[IHC\] and fluorescence in situ hybridization \[FISH\])
If invasive disease was present in both breasts, participation in the study is permitted as long as the eligibility criteria are met for both tumors/breasts
Patients must have received neoadjuvant chemotherapy in combination with pembrolizumab for a minimum of 6 cycles. All systemic chemotherapy must have been completed preoperatively
An interval of no more than 12 weeks between the completion date of the final surgery and the date of randomization
Use of investigational anti-cancer agents must be discontinued at time of registration
Adequate excision: Surgical removal of all clinically evident disease in the breast and lymph nodes as follows:
Breast surgery: Total mastectomy or breast-conserving surgery with histologically negative margins, including no ink on tumor for DCIS, at the time of excision
Lymph node surgery:
For a patient with clinically N0 disease, a sentinel lymph node biopsy should have been performed at time of surgical evaluation, and if pathologically node positive, the patient is no longer eligible. Isolated tumor cells are considered node-negative
For a patient with clinically N1 disease at diagnosis (with positive results from a fine-needle aspiration, core biopsy, or sentinel node biopsy performed prior to preoperative therapy) additional surgical evaluation of the axilla following preoperative therapy is required
If sentinel node biopsy performed before preoperative therapy was negative, no additional surgical evaluation of the axilla is required after preoperative therapy. If sentinel node biopsy performed before preoperative therapy was positive, an ALND is required after preoperative therapy
If the only sentinel node identified by isotope scan is in the internal mammary chain, surgical evaluation of the axilla is still required
If sentinel node evaluation after preoperative therapy is negative, no further additional surgical evaluation of the axilla is required
Axillary dissection without sentinel node evaluation is permitted as the initial or sole axillary evaluation after preoperative therapy
If breast-conserving surgery was performed but patient will not be receiving breast radiation, the patient is not eligible
Not pregnant and not nursing, because this study involves an agent whose genotoxic, mutagenic and teratogenic effects on the developing fetus and newborn are unknown. Therefore, for women of childbearing potential only, a negative serum or urine pregnancy test done =\< 7 days prior to randomization is required
Absolute neutrophil count (ANC) \>= 1,000/mm\^3
Platelet Count \>= 100,000/mm\^3
Estimated glomerular filtration rate (eGFR) \>= 15 mL/min/1.73m\^2
Total Bilirubin =\<1.5 x upper limit of normal (ULN)
Aspartate aminotransferase (AST) serum aspartate aminotransferase \[SGOT\] / alanine aminotransferase (ALT) serum glutamic pyruvic transaminase \[SGPT\] =\< 3 x institutional ULN
Patients must be willing to provide tumor tissue from the diagnostic core biopsy. If inadequate tumor tissue is available, patients are still eligible to participate in the trial
Patients with a prior or concurrent malignancy whose natural history or treatment does not have the potential to interfere with the safety or efficacy assessment of the investigational regimen are eligible for this trial
Patients with known history or current symptoms of cardiac disease, or history of treatment with cardiotoxic agents, should have a clinical risk assessment of cardiac function using the New York Heart Association Functional Classification. To be eligible for this trial, patients should be class 2B or better
Patients with known HIV infection who are on effective anti-retroviral therapy with undetectable viral load within 6 months prior to registration are eligible for this trial
Exclusion
No stage IV (metastatic) breast cancer
No history of any prior (ipsi- or contralateral) invasive breast cancer. Prior DCIS is allowed
No evidence of recurrent disease following preoperative therapy and surgery
No known active liver disease, e.g. due to hepatitis B virus (HBV), hepatitis C virus (HCV), autoimmune hepatic disorders, or sclerosing cholangitis
No history of intolerance, including Grade 3 or 4 infusion reaction or hypersensitivity to pembrolizumab or murine proteins or any components of the product
No medical conditions that require chronic systemic steroids (\>10 mg prednisone daily or equivalent) or any other form of immunosuppressive medications and has required such therapy in the last two years. Replacement therapy (e.g. thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc.) is not considered a form of systemic therapy
Patients who are unable or unwilling to comply with the requirements of the protocol per investigator assessment are not eligible