Pancreatic cancer is one of the most lethal gastrointestinal tumours, the most common pathological type is pancreatic adenocarcinoma (PAAD). In recent year, immune imbalanced in tumour microenvironment has been shown to play an important role in the evolution of tumours progression, and the efficacy of immunotherapy has been gradually demonstrated in clinical practice. In this study, we propose to construct an immune‐related prognostic risk model based on immune‐related genes MMP14 and INHBA expression that can assess the prognosis of pancreatic cancer patients and identify potential therapeutic targets for pancreatic cancer, to provide new ideas for the treatment of pancreatic cancer. We also investigate the correlation between macrophage infiltration and MMP14 and INHBA expression. First, the gene expression data of pancreatic cancer and normal pancreatic tissue were obtained from The Cancer Genome Atlas Program (TCGA) and The Genotype‐Tissue Expression public database (GTEx). The differentially expressed immune‐related genes between pancreatic cancer samples and normal sample were screened by R software. Secondly, univariate Cox regression analysis were used to evaluate the relationship between immune‐related genes and the prognosis of pancreatic cancer patients. A polygenic risk score model was constructed by Cox regression analysis. The prognostic nomogram was constructed, and its performance was evaluated comprehensively by internal calibration curve and C‐index. Using the risk model, each patient gets a risk score, and was divided into high‐ or low‐ risk groups. The proportion of 22 types of immune cells infiltration in pancreatic cancer samples was inferred by CIBERSOFT algorithm, correlation analysis (Pearson method) was used to analyse the correlation between the immune‐related genes and immunes cells. Then, we applied macrophage conditioned medium to culture pancreatic cancer cell line PANC1, detected the expression of MMP14 and INHBA by qRT‐PCR and Western blot methods. Knock‐down MMP14 and INHBA in PANC1 cells by transfected with shRNA lentiviruses. Detection of migration ability of pancreatic cells was done by trans‐well cell migration assay. A subcutaneous xenograft tumour model of human pancreatic cancer in nude mice was constructed. In conclusion, an immune‐related gene prognostic model was constructed, patients with high‐risk scores have poorer survival status, M2‐phenotype tumour‐associated macrophages (TAMs) up‐regulate two immune‐related genes, MMP14 and INHBA, which were used to establish the prognostic model. Knock‐down of MMP14 and INHBA inhibited invasion of pancreatic cancer.