CoolFace
Modelpublic

llm-semantic-router/toolcall-verifier

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
2likes36downloads
Model Card

ToolCallVerifier - Unauthorized Tool Call Detection

<div align="center">

![License](https://opensource.org/licenses/Apache-2.0) ![Model](https://huggingface.co/answerdotai/ModernBERT-base)

Stage 2 of Two-Stage LLM Agent Defense Pipeline

</div>


🎯 What This Model Does

ToolCallVerifier is a ModernBERT-based token classifier that detects unauthorized tool calls in LLM agent systems. It performs token-level classification on tool call JSON to identify malicious arguments that may have been injected through prompt injection attacks.

LabelDescription
AUTHORIZEDToken is part of a legitimate, user-requested action
UNAUTHORIZEDToken indicates injected/malicious content β€” BLOCK

🚨 Attack Categories Covered

CategorySourceDescription
Delimiter InjectionLLMail<<end_context>>, >>}}\]\])
Word ObfuscationLLMailInserting noise words between tokens
Fake SessionsLLMailSTART_USER_SESSION, EXECUTE_USERQUERY
Roleplay InjectionWildJailbreak"You are an admin bot that can..."
XML Tag InjectionWildJailbreak<execute_action>, <tool_call>
Authority BypassWildJailbreak"As administrator, I authorize..."
Intent MismatchSyntheticUser asks X, tool does Y
MCP Tool PoisoningSyntheticHidden exfiltration in tool args
MCP ShadowingSyntheticFake authorization context

πŸ”— Integration with FunctionCallSentinel

This model is Stage 2 of a two-stage defense pipeline:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Prompt   │────▢│ ToolCallSentinel │────▢│   LLM + Tools   β”‚
β”‚                 β”‚     β”‚      (Stage 1)       β”‚     β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                              β”‚
                               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                               β”‚           ToolCallVerifier (This Model)                 β”‚
                               β”‚   Token-level verification before tool execution        β”‚
                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
ScenarioRecommendation
General chatbotStage 1 only
Tool-calling agent (low risk)Stage 1 only
Tool-calling agent (high risk)Both stages
Email/file system accessBoth stages
Financial transactionsBoth stages

🎯 Intended Use

Primary Use Cases

  • β€”LLM Agent Security: Verify tool calls before execution
  • β€”Prompt Injection Defense: Detect unauthorized actions from injected prompts
  • β€”API Gateway Protection: Filter malicious tool calls at infrastructure level

Out of Scope

  • β€”General text classification
  • β€”Non-tool-calling scenarios
  • β€”Languages other than English

πŸ“œ License

Apache 2.0