[2607.29254] Tool Specifications Matter: Uncovering and Mitigating Safety Risks in AI Agents
Skip to main content
Search arXiv
Press Enter to search · Advanced search
-->
Computer Science > Artificial Intelligence
arXiv:2607.29254 (cs)
[Submitted on 31 Jul 2026]
Title:Tool Specifications Matter: Uncovering and Mitigating Safety Risks in AI Agents
Authors:Minghui Pan, Jiayuxuan Yang, Yuanyuan Yuan, Yu Jiang, Zhenpeng Chen<br>View a PDF of the paper titled Tool Specifications Matter: Uncovering and Mitigating Safety Risks in AI Agents, by Minghui Pan and 4 other authors
View PDF<br>HTML (experimental)
Abstract:AI agents extend large language models (LLMs) with external tools, enabling them to perform complex tasks and translate model outputs into consequential real-world actions. Yet LLMs often become substantially less safe when deployed as agents, and the source of this degradation remains poorly understood. In this paper, we identify schema-formatted tool specifications as a primary source of agent safety degradation and show, through white-box representation analysis, that they weaken the model's internal refusal signals and contribute to unsafe tool execution. Building on this finding, we propose SafeKeep, an inference-time safeguard that decouples safety judgment from tool execution: it assesses requests using flattened textual tool specifications while retaining the original schema-formatted specifications for execution. Across two representative benchmarks and four LLMs, including both white-box and black-box models, SafeKeep increases the average refusal rate for harmful requests from 23.8% to 70.6% and reduces the average attack success rate under observation-level prompt injection from 25.6% to 2.5%. It also outperforms existing safeguards and preserves task-handling capability. We release the code and data at this https URL .
Subjects:
Artificial Intelligence (cs.AI)
Cite as:<br>arXiv:2607.29254 [cs.AI]
(or<br>arXiv:2607.29254v1 [cs.AI] for this version)
https://doi.org/10.48550/arXiv.2607.29254
Focus to learn more
arXiv-issued DOI via DataCite (pending registration)
Submission history<br>From: Minghui Pan [view email]<br>[v1]<br>Fri, 31 Jul 2026 10:25:04 UTC (2,329 KB)
Full-text links:<br>Access Paper:
View a PDF of the paper titled Tool Specifications Matter: Uncovering and Mitigating Safety Risks in AI Agents, by Minghui Pan and 4 other authors<br>View PDF<br>HTML (experimental)<br>TeX Source
view license
Current browse context:
cs.AI
next >
new<br>recent<br>| 2026-07
Change to browse by:
cs
References & Citations
NASA ADS<br>Google Scholar
Semantic Scholar
export BibTeX citation<br>Loading...
BibTeX formatted citation
×
loading...
Data provided by:
Bookmark
Bibliographic Tools
Bibliographic and Citation Tools
Bibliographic Explorer Toggle
Bibliographic Explorer (What is the Explorer?)
Connected Papers Toggle
Connected Papers (What is Connected Papers?)
Litmaps Toggle
Litmaps (What is Litmaps?)
scite.ai Toggle
scite Smart Citations (What are Smart Citations?)
Code, Data, Media
Code, Data and Media Associated with this Article
alphaXiv Toggle
alphaXiv (What is alphaXiv?)
Links to Code Toggle
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub Toggle
DagsHub (What is DagsHub?)
GotitPub Toggle
Gotit.pub (What is GotitPub?)
Huggingface Toggle
Hugging Face (What is Huggingface?)
ScienceCast Toggle
ScienceCast (What is ScienceCast?)
Demos
Demos
Replicate Toggle
Replicate (What is Replicate?)
Spaces Toggle
Hugging Face Spaces (What is Spaces?)
Spaces Toggle
TXYZ.AI (What is TXYZ.AI?)
Related Papers
Recommenders and Search Tools
Link to Influence Flower
Influence Flower (What are Influence Flowers?)
Core recommender toggle
CORE Recommender (What is CORE?)
Author
Venue
Institution
Topic
About arXivLabs
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .
Which authors of this paper are endorsers? |<br>Disable MathJax (What is MathJax?)
Major funding support from