ALL INTELLIGENCE
蚂蚁 inclusionAI 官方仓库T1·Agents

Ant Group Open-Sources Agent3σ-Canary for Sandboxed Agent Safety Evaluation

By inclusionAIOriginal title: ⭐ inclusionAI/Agent3Sigma-Canary (42 stars)
58AI Score

Ant Group's Agent3σ project has open-sourced AgentCanary, which drives agents inside controlled sandboxes to invoke real tools and process realistically formatted task materials, scoring full execution trajectories across risk outcome, security awareness and normal-task utility rather than only checking textual safety. It now supports the Hermes and NanoClaw frameworks and adds a Skill-to-Sandbox workflow for building custom evaluation environments.

Full Report

Contents6 sections

Agent3σ-Canary

Agent3σ-Canary, abbreviated as AgentCanary, is part of the Agent3σ project. It provides security evaluation capabilities for AI Agents in realistic runtime environments. AgentCanary does not simply check whether a model gives a safe textual answer; it drives agents in controlled sandboxes to invoke real tools, process task materials in realistic formats, and evaluate the agent's complete execution trajectory across risk outcome, security awareness, and normal-task utility.

Agent3σ-Canary overview

📢 What's New

  • 2026-08-09: Added the Skill-to-Sandbox workflow, enabling users to build customized evaluation environments and extend evaluation tasks with greater flexibility. See the tutorial for more details.
  • 2026-06-23: Added support for the Hermes and NanoClaw agent frameworks. Issues and pull requests for supporting more frameworks are welcome!
  • 2026-06-23: Added the safety evaluation suite — no-attacker tasks measuring risky agent behavior under ambiguous, conflicting, or urgent instructions.

💡 Key Features

  • Comprehensive risk coverage: Tasks are organized through a systematic "risk entry x risk impact" taxonomy. Risk entries capture different sources of risk and their threat models, including direct injection, indirect prompt injection, Skills poisoning, and memory poisoning. Risk impacts describe the different consequences an attack can cause, such as local environment damage, sensitive data leakage, and persistent state pollution. See risk definition for details.
  • Realistic usage scenarios: AgentCanary covers real agent workflows such as web browsing, email processing, SMS handling, and financial operations. Risk sources are embedded into the workflows that agents are expected to complete, following realistic threat models.
  • Realistic runtime environment: AgentCanary uses real interfaces to access resources such as web pages, email, and files, preserving high-fidelity tool-call chains and data formats. It also dynamically prepares task-specific materials, such as inboxes, test files, virtual financial accounts, and websites, so each evaluation runs with sufficient context.
  • Sandboxed evaluation: Each task runs in an isolated environment, reducing the impact of high-risk samples on the host and other tasks while keeping evaluations controlled and reproducible.
  • Multiple attack methods: AgentCanary supports automatic generation, mutation, and optimization of attack samples for evaluation tasks, covering one-shot transformations, multi-step iterative optimization, and long-chain attack scenarios.
  • Defense framework evaluation: AgentCanary supports evaluating different agent security defense frameworks, making it easier to compare defense effectiveness.
  • Trajectory-based multidimensional scoring: Scoring is not based only on a single-step result. AgentCanary evaluates the agent's complete execution trajectory across safety outcome, security awareness, and task utility.
  • High extensibility: Task definitions and environment construction are modular, making it easy to add custom evaluation tasks.

🔄 Evaluation Workflow

AgentCanary evaluation workflow

🚀 Quick Start

1. Prepare the Environment

System requirements:

  • Python 3.10+
  • uv for Python dependency management
  • Docker

Install uv:

BASH
curl -LsSf https://astral.sh/uv/install.sh | sh
BASH
uv sync

2. Configure Models and API Keys

Running AgentCanary requires configuring two types of LLMs:

  • Target model: The LLM used by the agent under test inside the Docker container. Specify it with the --model argument.
  • Auxiliary models: LLMs used by the evaluation framework itself, such as PAIR attackers and judge scorers.

Configuration steps:

BASH
# 1. Create a configuration file from the template
cp config.example.yaml config.yaml

# 2. Edit the configuration with your API keys and model information
vim config.yaml

# 3. Optional: validate whether the configured model APIs are available
uv run python scripts/validate_api.py

In config.yaml, configure:

  • providers: API endpoints, keys, and available model lists. You can define multiple providers, and each provider can contain multiple models. The provider-id/model-id pair is the value used by the --model argument.
  • roles: Auxiliary model assignments for roles such as pair, judge, and ipi. Auxiliary model requests currently use OpenAI-compatible Chat Completions APIs.

Example:

YAML
providers:
  openai-compatible:
    base_url: "https://api.openai.com/v1"
    api_key: "sk-xxx"
    api: "openai-completions"
    models:
      - id: "gpt-4o"
        name: "GPT-4o"

  anthropic:
    base_url: "https://api.anthropic.com/v1"
    api_key: "sk-ant-xxx"
    api: "anthropic-messages"
    models:
      - id: "claude-sonnet-4"
        name: "Claude Sonnet 4"

roles:
  # pair:
  #   base_url: "https://api.openai.com/v1"
  #   api_key: "sk-xxx"
  #   model: "gpt-4o"
  judge:
    base_url: "https://api.openai.com/v1"
    api_key: "sk-xxx"
    model: "gpt-4o"
  # ipi:
  #   base_url: "https://api.openai.com/v1"
  #   api_key: "sk-xxx"
  #   model: "gpt-4o"

Generate runtime configuration:

BASH
# Generate env.sh and openclaw.json from config.yaml
bash setup.sh

# Load environment variables
source env.sh

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)