Reconnaissance-driven pentesting can extract knowledge assets
The KYA framework can automatically probe AI agents, build target profiles, and generate more effective indirect prompt injection attacks
AI/ML arXiv 22 Jul 2026 Method Prototype evidence
Published as “Know Your Agent: Reconnaissance-Driven Pentesting of AI Agents”
Why it matters
The work shows that testing AI agents without probing their operational knowledge can vastly underestimate security risks, prompting developers to incorporate reconnaissance-style evaluations and stronger defenses.
Summary
KYA dramatically improves indirect prompt-injection success, reaching 86.0% attack success rate on the AgentDojo benchmark and 99.3% on InjecAgent, up to 67 percentage points higher than prior methods. The paper evaluates across three foundation models, multiple baselines, ablations, and a real-world coding agent, showing the benefit of reconnaissance-driven testing, though defenses and real-world settings still limit effectiveness.
What they found 6
- KYA attains the highest attack success rates on both benchmarks.
“KYA achieves the highest ASR on both benchmarks, reaching 86.0% on AgentDojo and 99.3% on InjecAgent.”
- Reconnaissance contributes the majority of KYA's advantage.
“Reconnaissance is the dominant factor: 34% of successes occur only in configurations that include reconnaissance, while tactics alone adds just 4% beyond Recon only.”
- A single knowledge asset (the agent's task) can raise ASR substantially.
“knowing the user’s current objective (e.g., to send an email) raises ASR to 61.9% undefended and 38.1% defended.”
- KYA remains effective across models, e.g., achieving 89.2% on Gemini where baselines drop to 8.1%.
“KYA remains effective even when baseline performance varies widely, including on Gemini 3 Flash, where Important Instructions drops to 8.1% but KYA reaches 89.2%.”
- Defenses reduce but do not eliminate KYA's success; delimiters have minimal impact.
“KYA achieves the highest ASR under every defense. Delimiters have almost no effect, with ASR remaining 86.3% compared to 86.0% without defenses.”
- In a real-world coding agent (OpenHands), KYA achieves 21.9% overall ASR.
“KYA achieves an overall ASR of 21.9%.”
Caveats 4
- Against a strong PI detector defense, KYA's ASR drops to 30.4%, showing defenses can substantially curb its effectiveness.
- In the OpenHands real-world case study, overall ASR is only 21.9%, far lower than benchmark results.
- All KYA runs were conducted under a fixed interaction budget, limiting each run to at most 3 selected tactics and a total of 10 exploitation attempts, after which the run is considered a failure if no successful attack is achieved.
- Because the iterative-framework implementations were not open-sourced, we evaluate our best-effort reproductions; implementation details are given in Appendix C.
What’s new here 4
- Introduces agent reconnaissance as a systematic, black-box step to extract knowledge assets before attacks.
- Interleaves reconnaissance actions with exploitation rather than only mutating payloads.
- Uses discovered tool schemas, task context, and other assets to craft more context-aware IPI payloads.
- Provides an autonomous pentesting platform (KYA) and releases code and benchmarks for reproducibility.