Cybersecurity AI (CAI) - 轻量级网络安全AI框架

文章目录


一、关于CAI

1、项目概览

CAI是一个轻量级、符合人体工程学的框架,用于构建具备漏洞赏金能力的网络安全AI(CAI)。该框架专注于使网络安全代理的协调和执行变得轻量级、高度可控且对人类有用。


2、相关链接资源


3、功能特性

1、多模型支持

支持300+模型,包括:

  • Anthropic: Claude 3.7/3.5/3/Opus
  • OpenAI: GPT-4o/GPT-4.5
  • DeepSeek: V3/R1
  • Ollama: Qwen2.5等

2、模块化架构

基于7大核心组件:

  • Agents(代理)
  • Tools(工具)
  • Handoffs(交接)
  • Patterns(模式)
  • Turns(轮次)
  • Tracing(追踪)
  • HITL(人在回路)

二、安装配置

bash 复制代码
# 基础安装
pip install cai-framework

# 创建虚拟环境(推荐)
python3.12 -m venv cai_env
source cai_env/bin/activate

三、使用示例

1、基础代理使用

python 复制代码
from cai.sdk.agents import Agent
from cai.core import CAI

ctf_agent = Agent(
    name="CTF Agent",
    instructions="网络安全专家",
    model="gpt-4o"
)

client = CAI()
response = client.run(agent=ctf_agent, 
                     messages=[{"role":"user","content":"目标IP:192.168.1.1"}])

2、工具集成示例

python 复制代码
from cai.tools.common import run_command

def scan_tool(target_ip: str):
    return run_command(f"nmap -sV {target_ip}")

ctf_agent.functions.append(scan_tool)

四、架构设计

核心组件交互图

复制代码
                  ┌───────────────┐           ┌───────────┐
                  │      HITL     │◀─────────▶│   Turns   │
                  └───────┬───────┘           └───────────┘
                          │
                          ▼
┌───────────┐       ┌───────────┐       ┌───────────┐      ┌───────────┐
│  Patterns │◀─────▶│  Handoffs │◀────▶ │   Agents  │◀────▶│    LLMs   │
└───────────┘       └─────┬─────┘       └───────────┘      └───────────┘
                          │                   │
                          │                   ▼
┌────────────┐       ┌────┴──────┐       ┌───────────┐
│ Extensions │◀─────▶│  Tracing  │       │   Tools   │
└────────────┘       └───────────┘       └───────────┘

五、开发指南

1、贡献代码

bash 复制代码
# 安装pre-commit
pip install pre-commit
pre-commit install

2、本地CI测试

bash 复制代码
docker run --rm -it \
  --privileged \
  --network=exploitflow_net \
  -v /cache:/cache \
  registry.gitlab.com/aliasrobotics/alias_research/cai:latest bash

其它

参考项目

  • PentestGPT
  • LiteLLM
  • Phoenix

参考文献

bibtex 复制代码
@misc{mayoralvilches2025caiopenbugbountyready,
      title={CAI: An Open, Bug Bounty-Ready Cybersecurity AI},
      author={Víctor Mayoral-Vilches et al.},
      year={2025},
      eprint={2504.06017},
      primaryClass={cs.CR}
}

伊织 xAI 2025-07-02(二)

相关推荐
Hello.Reader13 分钟前
一个开源项目,让 AI 做逆向不再靠猜reverse-skill 架构解析与本地实战
人工智能·架构·开源
wespaul1 小时前
VeapAI 自然语言操作实战|第 05 篇:向量与召回——从知识条目到可检索资产
大数据·数据库·人工智能·milvus
mingbaiceping1 小时前
复旦-华盛顿大学EMBA:2026年AI课程矩阵解析
人工智能
李福春1 小时前
技术思考问题17:上了LangChain框架就等于AI-Agent工程化吗?
大数据·人工智能·langchain·深圳同盟·腾讯云架构师技术同盟·llm应用架构·编排抽象
揽秀亭长1 小时前
AIGC 检测原理拆解与论文降 AI 率的可复现处理流程(2026版)
人工智能·aigc
羞儿1 小时前
【DSH】为什么需要-Harness
人工智能·大模型·harness·认知构建
JackLam4 小时前
AI-安装ChatGpt Codex
人工智能
强哥聊算力4 小时前
《算力江湖·英伟达传奇》第七集:ChatGPT出现前夜,英伟达发生了什么?
服务器·人工智能·算法·ai·chatgpt·gpu算力
吴佳浩4 小时前
Run:ai 开源了,我把 GPU 编排摆回 AI 栈里看了一遍
人工智能
IT_Octopus6 小时前
【零基础入门 LLM 开发 · Day 13】:LangChain 的对话记忆——Message 对象版
人工智能·python·langchain