Secure Knowledge Retrieval for English-Teaching Agents: A Multi-Stage Auditing and Knowledge Purification Method
Jiming Yin, Xianfeng Xie, Shanyi Guo, Jiawei Chen, Jie CuiEnglish-teaching agents use external knowledge retrieval to update instructional content, broaden domain coverage, and personalize support beyond standalone large language models (LLMs). However, open sources may introduce harmful, biased, or misleading content into retrieval-augmented generation (RAG) pipelines, affecting learners’ judgment, cultural understanding, and value formation. To address this problem, this study proposes a multi-stage secure knowledge retrieval method for English-teaching agents. The method coordinates safeguards across knowledge-source access, retrieval execution, and model output. At the access stage, custom rules and Semgrep-based static scanning perform preliminary risk screening. At the retrieval stage, LLM-based dynamic evaluation identifies tool-description contamination and cross-file data-flow risks. At the output stage, semantic-embedding pre-screening, LLM review, and bounded knowledge purification detect and rewrite risky responses. Our experiments use public safety benchmarks, a mixed corpus of benign and poisoned passages, synthetic purification cases, and controlled end-to-end teaching scenarios. Compared with vanilla RAG, the framework reduces Poison Exposure@5 from 92.0% to 3.0% and retrieval attack success from 86.0% to 2.0% while preserving retrieval coverage. These results provide preliminary evidence that the framework can empower English teaching by enabling agents to deliver safer materials and trustworthy support for classroom questioning, academic writing, and intercultural learning.