Inclusion Criteria:
* The participant is willing and able to provide written informed consent for the trial.
* Histologically/cytologically confirmed diagnosis of NSCLC.
* Have inoperable or metastatic disease that is measurable based on RECIST v1.1.
* Not a candidate for any molecular / biomarker directed targeted therapy approved in the country where the participant is enrolled for the treatment of advanced NSCLC, including but not limited to therapies targeting epidermal growth factor receptor (EGFR), anaplastic lymphoma kinase (ALK), Proto-oncogene tyrosine-protein kinase ROS1 (ROS1), B-RAF-proto-oncogene, serine/threonine kinase, with a valine-to-glutamic acid substitution at amino acid position 600 (BRAF V600E), MET proto-oncogene, receptor tyrosine kinase, exon 14 (MET exon 14), RET proto-oncogene, receptor tyrosine kinase (RET), neurotrophic receptor tyrosine kinase (NTRK), human epidermal growth factor receptor 2 (HER2), Neuregulin 1 (NRG1), and KRAS proto-oncogene, GTPase, with a glycine-to-cysteine-substitution at amino acid position 12 (KRAS-G12C) alterations. Tumors must be negative for EGFR and ALK sensitizing mutations.
* An Eastern Cooperative Oncology Group (ECOG) performance status of 0 or 1 during screening.
* Able and willing to tolerate a polyethylene glycol (PEG)-electrolyte bowel preparation and provide stool samples.
* Meets the applicable cohort-specific requirements (1 of the following):
* Cohort 1: Participants not receiving chemotherapy that have PD-L1 tumor proportion score (TPS) of at least 50% and with no prior systemic therapy for inoperable or metastatic disease.
* Cohort 2: Participants receiving chemotherapy that are PD-L1 positive\* with TPS of at least 1% with no prior systemic therapy for inoperable or metastatic disease.
* Cohort 3: PD-L1 TPS of at least 1% disease progression after at least 4 cycles of immune checkpoint inhibitor therapy combined with chemotherapy; last immune checkpoint inhibitor dose within 60 days before baseline; and progressive disease confirmed by a second computed tomography scan performed at least 4 weeks after the first scan.
Exclusion Criteria:
* Treatment with either a live biotherapeutic product and/or a fecal microbiota transplant therapy (within the past year).
* Use or planned usage of any probiotic(s) (within 14 days), or use of antibiotics\* (within 7 days) prior to KAN-001 administration.
* Received a live vaccine\* (within 30 days) prior to first dose of pembrolizumab.
* Certain digestive conditions including: prior large bowel gastrointestinal (GI) surgery\*, active GI disorders (uncontrolled vomiting, diarrhea, etc.), inflammatory bowel disease (Crohn's, ulcerative colitis) that has required treatment within six months prior to screening, or a known history of an active GI parasitic infection within three months prior to screening.
* Has received prior systemic anti-cancer therapy including investigational agents within 4 weeks of study treatment\* (excluding continuation of ongoing ICI treatment regimen).
* Has received major surgery within last 4 weeks, without adequate recovery from the toxicity and/or complications from the prior intervention before starting study treatment.
* Has received prior radiotherapy within 14 days of study enrollment.\*
* An unwillingness or inability to swallow size 0 capsules.
* Screening blood test results outside the ranges required by the study, or certain positive tests for HIV, hepatitis B, or hepatitis C.\*
* Any past or current medical, psychiatric, or substance-use condition, therapy, or laboratory abnormality that, in the study doctor's opinion, could affect the study results, prevent full participation in the study, or make participation not in the participant's best interest.
* Pregnant, breastfeeding, or unwillingness to use protocol-specified contraception.
* A life expectancy of less than 4 months.
* History of solid-organ transplantation.
* Additional active malignancy that could interfere with interpretation of the study, except for certain adequately treated cancers.
* Symptomatic or unstable brain metastases\* or leptomeningeal disease.
* Clinically significant or uncontrolled cardiovascular disease\*.
* Active interstitial lung disease or pneumonitis, or a history of interstitial lung disease or pneumonitis requiring systemic corticosteroids.
* Active autoimmune disease that required systemic immunosuppressive treatment within 7 days of KAN-001 administration, or diagnosis of immunodeficiency\*.
* Prior Grade 3 or 4 immune-related adverse events that were symptomatic and required \> 6 weeks of immunosuppression.
* \*Exceptions and full details will be discussed with participants by the study team.
Note: Additional criteria apply; the study team will confirm full eligibility at screening.