← Lab /Security & privacy

Hierarchical optimization improves system prompt extraction from LLM agents

ExtraHerO extracts system prompts with higher fidelity and utility than prior attacks

Security & privacy arXiv 3 Nov 2026 Attack Prototype evidence Threat model

Published as “Extracting System Prompt of LLM Services in Complex (Agentic) Settings: Hierarchical Optimization and Reliable Evaluation Metrics”

Why it matters

Extracted system prompts can be reused as white-box proxies, boosting downstream attacks such as prompt injection by up to ~10% success rate.

Summary

EXTRAHERO improves system-prompt extraction from modern LLM agents, achieving average gains of 12.5% in fidelity, 2.3% in functionality, and 6.0% in adversarial utility on chatbots (and up to 34.3% functionality on agents) compared to prior attacks. It does this by hierarchically reconstructing prompts using a structural template and iteratively refining queries with text-gradient feedback, while monitoring information gain to stop or reset optimization. The paper provides extensive experiments on GPT-4o chatbots and six GUI agents, showing consistent superiority but also noting performance drops on some agents and a trade-off when adding hierarchical decomposition.

What they found 2

  1. EXTRAHERO outperforms all baselines with substantial improvements in fidelity, functionality, and adversarial utility.

    “Experimental results demonstrate the consistent superiority of EXTRAHERO, with average improvements of 12.5% (fidelity), 2.3% (functionality), and 6.0% (adversarial utility) on chatbots, and 12.2%, 34.3%, and 30.5% on agents.”

  2. The method achieves higher global, structural prompt similarity than prior attacks.

    “In contrast, our EXTRAHERO yields higher global, structural prompt similarity, demonstrating its superiority in recovering the key property of the prompt.”

Caveats 3

  • Although a performance drop is seen on BrowserUse, we further notice that we can rely on the leaked tool-use logic to invoke open tab to redirect the agent to a sinkhole (/agent-dos.html).
  • adding HMSD into IRTG results in a 20.6% relative decrease in SKM (from 17.08 to 13.55).
  • the primary bottleneck for adversaries is the inherent noise within the system-level instructions themselves.

What’s new here 4

  • Hierarchical multi-stage decomposition of the prompt using a pre-defined structural template.
  • Iterative adversarial query updates guided by text-gradient differences between current template and observed feedback.
  • Dynamic early-stop/reset based on monitored information gain for better query efficiency.
  • Introduction of evaluation metrics that prioritize sentence-level similarity, structural keyword matching, and adversarial utility.

Threat model stated by the source

Adversaryblack-box
Capabilitycan submit queries via the public interface and observe only the final, post-processed output (text or actions); no access to model weights, gradients, or token probabilities