Agentic AI
AI Agent Learns to Write Its Own Forensics Tools for Detecting Fake Images
Researchers introduce ForenAgent, an AI system that combines multimodal language models with autonomous tool generation to catch image forgeries more effectively.
A research team has developed ForenAgent, an intelligent framework that teaches AI systems to autonomously generate and refine Python-based tools for detecting manipulated images. Rather than relying on either traditional low-level artifacts or high-level semantic reasoning alone, the approach bridges both methods to improve forgery detection accuracy.
The Core Challenge#
Current image forgery detection methods split into two camps: those focused on detecting subtle technical artifacts, and those leveraging multimodal large language models (MLLMs) that understand image content at a semantic level. While these approaches complement each other in theory, they operate in vastly different paradigms, making it difficult for systems to integrate their strengths or reason across the gap between granular technical signals and broader contextual understanding.
How ForenAgent Works#
The system operates through an iterative, interactive loop inspired by human investigation. An MLLM examines an image, then autonomously writes, executes, and refines Python tools on the fly to probe specific forensic hypotheses. This "code-in-the-loop" approach allows the AI to generate bespoke analysis techniques tailored to each detection task, rather than applying fixed pre-built methods.
The team trained ForenAgent using a two-phase strategy:
- Cold Start phase: Initializes the model's ability to interact with tools
- Reinforcement Fine-Tuning: Progressively refines tool-use competence and reasoning flexibility
The reasoning pipeline follows four stages: global perception of the entire image, local focusing on suspicious regions, iterative probing with targeted tools, and holistic adjudication of findings.
The Training Dataset#
To support this work, researchers built FABench, a large-scale dataset pairing approximately 100,000 images with roughly 200,000 agent-interaction question-answer pairs. The dataset is designed specifically for training agents to reason about image forgeries across diverse scenarios.
Early Results#
Experiments demonstrate that ForenAgent develops emergent tool-use capabilities—behaviors not explicitly programmed—and shows stronger reflective reasoning on challenging detection tasks when assisted by the low-level forensic tools it generates itself. The authors frame this as a promising direction for developing general-purpose forgery detection systems.

