TLDR: SIRAJ is a novel framework for red-teaming LLM agents, designed to efficiently discover safety vulnerabilities. It employs a two-step process: generating diverse initial test cases covering various risks and agent actions, then iteratively refining these into adversarial attacks based on agent feedback. A key innovation is the distillation of reasoning from large red-teaming models into smaller, more efficient ones using a structured reasoning format, which significantly enhances attack success rates and diversity while reducing operational costs.
Large Language Model (LLM) agents, with their ability to plan and use tools, are becoming increasingly common. While powerful, this capability also introduces new safety risks. Ensuring these agents are safe before deployment requires a robust system to find and address their vulnerabilities. This is where a new framework called SIRAJ comes in.
The Challenge of Agent Safety
Traditional LLMs have safety concerns, but agents, which can perform actions in the real world, pose even more complex and diverse threats. Existing safety evaluations for these agents often lack the necessary diversity, focusing only on broad safety categories without delving into the specific, fine-grained risks an agent might encounter. Furthermore, many current red-teaming frameworks either demand impractical ‘white-box’ access to the agent’s internal workings or target only a narrow range of risks, which isn’t enough for the varied threats agents face.
Introducing SIRAJ: A Unified Red-Teaming Framework
SIRAJ, which stands for Structured Iterative Reasoning for Agents safety Judgement, is designed to fill these gaps. It’s a unified framework for red-teaming LLM agents that only requires ‘black-box’ access, meaning it doesn’t need to know the agent’s internal code or architecture. This makes it widely applicable to any LLM agent.
The framework operates in a dynamic two-step process:
1. Diverse Seed Test Case Generation: SIRAJ starts by creating a wide variety of initial test cases. These cases are designed to cover different potential risk outcomes (e.g., leaking user credentials vs. personal data), various ways an agent might trigger a risk (its action sequence or ‘trajectory’), and different risk sources (e.g., a malicious user instruction versus a compromised environment like a phishing email).
2. Iterative Adversarial Red-Teaming: After generating initial test cases, SIRAJ iteratively builds and refines adversarial attacks. It does this by observing how the agent responds to previous attempts and then adjusting the attack strategy based on those execution trajectories. This feedback loop helps in crafting more effective attacks.
Efficiency Through Structured Reasoning Distillation
A significant challenge in red-teaming with large models is the cost and time involved. To address this, SIRAJ introduces a novel model distillation approach. It leverages the structured reasoning of a large ‘teacher’ model to train smaller, more efficient ‘student’ models that are equally effective at red-teaming.
This distillation process involves:
- Defining a structured reasoning format that breaks down the complex red-teaming thought process into distinct, manageable components.
- Collecting successful red-teaming attempts from a large teacher model (like Deepseek-R1) that has been prompted to follow this structured reasoning.
- Using this high-quality, structured data to train smaller models through supervised fine-tuning (SFT) and reinforcement learning (RL), which further enhances their red-teaming capabilities.
Also Read:
- Silent Takeover: QueryIPI Unveils a New Era of Persistent Attacks on AI Coding Agents
- SecureReviewer: Boosting AI’s Role in Automated Security Code Review
Key Findings and Impact
The research demonstrates SIRAJ’s effectiveness across various evaluation agent settings:
- The seed test case generation method significantly boosts the coverage of risk outcomes and tool-calling trajectories by 2 to 2.5 times compared to baselines.
- The distilled 8B red-teamer model shows a remarkable 100% improvement in attack success rate, even outperforming the much larger 671B Deepseek-R1 model.
- The framework, structured reasoning, and the SFT and RL training stages are all validated through ablations and analyses, confirming their effectiveness and the generalization capabilities of the red-teamer models to new agent settings and risk types.
- The distilled model also uses significantly fewer tokens, making the red-teaming process more cost-efficient.
In essence, SIRAJ provides a comprehensive, efficient, and diverse framework for evaluating the safety of LLM agents, making a crucial step towards their safer deployment in real-world applications. You can read the full research paper here.


