Exposing Security Vulnerabilities in LLM Based Educational Grading Agents

Xueyi Li, Zhuoneng Zhou, Zitao Liu, Yongdong Wu

TL;DR

This paper introduces "GradingAttack," a novel framework for testing the security of LLM-based educational grading agents. It reveals that these agents are surprisingly vulnerable to subtle adversarial attacks that can manipulate grading outcomes without being easily detected, highlighting a critical need for more robust security measures in educational AI.

What Problem Does This Paper Address?

Large language models (LLMs) are increasingly being used as automated grading agents for short answers in educational settings, promising to boost efficiency and scalability. However, as these agents operate "in the wild," their security and trustworthiness become paramount. This paper addresses the critical gap in understanding the vulnerability of these LLM-based grading agents to adversarial manipulation. While general LLM jailbreaking attacks are well-studied, the specific security challenges for educational grading agents, where the goal is to subtly alter grading outcomes rather than produce overtly harmful content, remain largely unexplored. The authors aim to systematically evaluate these vulnerabilities and expose fundamental weaknesses in current deployments.

Methods

The core contribution is the GradingAttack framework, designed to systematically evaluate LLM-based grading agents. It employs two main types of adversarial attack strategies:

  • Token-level Attack: This method optimizes an adversarial "suffix" appended to the grading prompt. The goal is to subtly alter the LLM's grading decision by iteratively refining this suffix.
  • Prompt-level Attack: This approach directly modifies the grading prompt itself using various strategies. The paper introduces a specific prompt-level attack called GradingAttackRole, which leverages role-playing to steer the LLM towards a desired grading outcome.

A key innovation is the Camouflage Attack Score (CAS), a novel metric designed to quantify both the attack's success rate (ASR) and its stealthiness. CAS balances the effectiveness of an attack in altering grading outcomes with its ability to maintain the agent's overall accuracy, providing a more comprehensive security evaluation than ASR alone.

Datasets

The authors evaluated their framework on five widely used educational datasets:

  • GAOKAO23: A subset of math word problems from the 2023 Chinese National College Entrance Examination.
  • MATH: A collection of high school mathematics competition problems.
  • GSM8K: Elementary school math word problems with complete solutions.
  • SciEntsBank: Contains questions and student answers across 15 scientific domains.
  • Math23K: Chinese elementary school math word problems focusing on single-variable linear equations.

For datasets that did not originally include student answers (GAOKAO23, MATH, GSM8K, Math23K), the researchers used 42 LLMs to generate student responses, treating them as "virtual students."

Key Insights and Ideas

  • LLM Grading Agents are Highly Vulnerable: The research clearly demonstrates that current LLM-based grading agents are susceptible to both token-level and prompt-level adversarial attacks. This is a significant concern for their deployment in real-world educational scenarios.
  • Prompt-Level Attacks are More Effective, Token-Level Attacks are Stealthier: Prompt-level attacks (like GradingAttackRole) generally achieve higher success rates in manipulating grading outcomes. Conversely, token-level attacks (like GCG) offer better camouflage, making them harder to detect by maintaining the agent's overall accuracy.
  • Role-Playing is a Powerful Attack Vector: The GradingAttackRole method, which uses role-playing prompts, proved particularly effective, especially with certain LLM architectures (e.g., Qwen2.5 instruct models) that are more inclined to follow role-play instructions.
  • Targeting Both Correct and Incorrect Labels Enhances Attacks: Attacking both correct and incorrect labels simultaneously (rather than just incorrect ones) leads to higher CAS and ASR, suggesting a more effective and camouflaged attack strategy.
  • Placement Matters for Prompt-Level Attacks: The position of role-play strings within the prompt significantly impacts attack effectiveness, with placements at the beginning and end, or exclusively at the end, yielding better results.

Key Results

  • Both token-level and prompt-level attacks can effectively compromise LLM-based grading agents.
  • Prompt-level attacks generally achieve higher success rates (ASR). For example, on the GAOKAO23 dataset, GradingAttackRole achieved an ASR of around 0.50.
  • Token-level attacks provide superior camouflage, as measured by the CAS metric.
  • The Qwen2.5 series models, while more resistant to token-level attacks, were found to be more vulnerable to prompt-level attacks.
  • Attacking both correct and incorrect labels resulted in higher CAS and ASR compared to targeting only incorrect labels. For instance, on the GAOKAO23 dataset, this strategy yielded a significantly higher CAS.

Limitations and Future Work

  • Misuse Potential: The authors acknowledge that their attack methods could be misused to manipulate grading outcomes. They plan to mitigate this risk through responsible disclosure practices.
  • Need for Robust Defenses: The findings strongly underscore the urgent need for developing secure and trustworthy agent systems for critical educational applications. Future work should focus on developing effective defenses against these identified vulnerabilities.
  • Further Exploration of Attack Strategies: While the paper introduces token-level and prompt-level attacks, further research could explore other attack modalities and their effectiveness against grading agents.
  • Broader Agent Security: The work contributes to a broader understanding of AI agent security, particularly in sensitive domains like education, and calls for continued research in this area.

Summary updated

BibTeX
@inproceedings{li2026exposing,
  author = {Xueyi Li and Zhuoneng Zhou and Zitao Liu and Yongdong WU},
  title = {{Exposing Security Vulnerabilities in LLM Based Educational Grading Agents}},
  booktitle = {AIWILD @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=YORu8xK6mY},
}
Figure