arthurpanhku/Arthor-Agent

GitHub: arthurpanhku/Arthor-Agent

面向安全团队的 AI 驱动文档评估工具,自动化安全问卷、合规证据和技术文档的风险与差距分析。

Stars: 31 | Forks: 6

[English](README.md) | [简体中文](README_zh.md) | [日本語](README_ja.md) | [한국어](README_ko.md) | [Français](README_fr.md) | [Deutsch](README_de.md)

Arthor Agent mascot

Arthor Agent
针对文档和问卷的自动化安全评估

Latest release License: MIT Python 3.10+ GitHub repo MCP Ready Agent Integration

## 什么是 Arthor Agent? **Arthor Agent** 是一款面向安全团队的 AI 驱动助手。它能自动审查安全相关的**文档、表格和报告**(例如:安全问卷、设计文档、合规证据),将其与您的策略和知识库进行比对,并生成包含风险、合规差距和整改建议的**结构化评估报告**。 🚀 **Agent 就绪**:支持 **Model Context Protocol (MCP)**,可作为 OpenClaw、Claude Desktop 及其他自主 Agent 的“技能”使用。 - **多格式输入**:PDF、Word、Excel、PPT、文本 — 解析为 LLM 可用的统一格式。 - **知识库 (RAG)**:上传策略和合规文档;Agent 在评估时将其作为参考依据。 - **多 LLM 支持**:通过统一接口使用 OpenAI、Claude、Qwen 或 **Ollama**(本地)。 - **结构化输出**:包含风险项、合规差距和可操作整改建议的 JSON/Markdown 报告。 非常适合需要在多个项目中扩展安全评估能力,而又不按比例增加人手的企业。 ## 为什么选择 Arthor Agent? | 痛点 | Arthor Agent 解决方案 | | :---------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | | **标准碎片化**
策略、标准和先例分散各处。 | 单一**知识库**确保发现结果的一致性和可追溯性。 | | **繁重的问卷流程**
业务方填写表单 → 安全审查 → 业务方补充证据 → 安全再次审查。 | **自动化初审**和差距分析减少了人工来回沟通的轮次。 | | **发布前审查压力**
安全团队需在上线前审查并签署技术文档。 | **结构化报告**帮助审查者专注于决策,而非逐行阅读。 | | **规模与一致性**
项目众多且标准不一,导致人工审查不一致或延期。 | 具有可配置场景的**统一流水线**确保评估的一致性和可审计性。 | *完整的問題陈述和产品目标请参阅 [SPEC.md](./SPEC.md)。* ## 架构 Arthor Agent 围绕一个 **Orchestrator(编排器)** 构建,该编排器协调解析器、知识库 (RAG)、技能和 LLM。您可以根据环境需求使用云端或本地 LLM,以及可选的集成(例如 AAD、ServiceNow)。 ``` flowchart TB subgraph User["👤 User / Security Staff"] end subgraph Access["Access Layer"] API["REST API / MCP"] end subgraph Core["Arthor Agent Core"] Orch["Orchestrator"] Mem["Memory"] Skill["Skills"] KB["Knowledge Base (RAG)"] Parser["Parser"] end subgraph LLM["LLM Layer"] Abst["LLM Abstraction"] end subgraph Backends["LLM Backends"] Cloud["OpenAI / Claude / Qwen"] Local["Ollama / vLLM"] end User --> API API --> Orch Orch <--> Mem Orch --> Skill Orch --> KB Orch --> Parser Orch --> Abst Abst --> Cloud Abst --> Local ``` **数据流(简化版):** 1. 用户上传文档并选择场景。 2. **Parser(解析器)** 将文件(PDF、Word、Excel、PPT 等)转换为文本/Markdown。 3. **Orchestrator(编排器)** 加载 **KB** 分块 (RAG) 并调用 **Skills(技能)**。 4. **LLM**(OpenAI、Ollama 等)生成结构化发现。 5. 返回**评估报告**(风险、差距、整改建议)。 *详细架构:[ARCHITECTURE.md](./ARCHITECTURE.md) 和 [docs/01-architecture-and-tech-stack.md](./docs/01-architecture-and-tech-stack.md)。* ## 功能 | 领域 | 能力 | | :----------------- | :---------------------------------------------------------------- | | **解析** | Word, PDF, Excel, PPT, 文本 → Markdown/JSON。 | | **知识库** | 多格式上传、分块、向量化 (Chroma)、RAG 查询。 | | **评估** | 提交文件 → 结构化报告(风险、差距、整改建议)。 | | **LLM** | 可配置提供商:**Ollama** (本地)、OpenAI 等。 | | **API** | REST API & **MCP Server** 用于 Agent 集成。 | | **安全** | 内置 RBAC、审计日志和 Prompt 注入防护。 | | **集成** | 支持 **MCP**,适用于 OpenClaw、Claude Desktop 等。 | 路线图(例如 AAD/SSO、ServiceNow 集成)请参阅 [SPEC.md](./SPEC.md)。 ## 👀 功能概览 ### 1. 评估工作台 上传文档,选择角色(例如 SOC2 Auditor),并获取即时风险分析。 ![Assessment Workbench](https://raw.githubusercontent.com/arthurpanhku/Arthor-Agent/main/docs/images/ui-dashboard.png) ### 2. 结构化报告 清晰展示风险、合规差距和整改步骤。 ![Structured Report](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/5029bcb3b1094936.png) ### 3. 知识库管理 将策略文档上传到 RAG。Agent 会引用这些内容作为证据。 ![Knowledge Base](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/51df264877094939.png) ## 快速开始 ### 选项 A:一键部署(推荐) 运行部署脚本以启动完整技术栈(API + Dashboard + Vector DB + 可选 Ollama)。 ``` git clone https://github.com/arthurpanhku/Arthor-Agent.git cd Arthor-Agent chmod +x deploy.sh ./deploy.sh ``` - **Dashboard**: [http://localhost:8501](http://localhost:8501) - **API 文档**: [http://localhost:8000/docs](http://localhost:8000/docs) ### 选项 B:Docker 手动部署 **前置条件**:**Python 3.10+**。可选:[Ollama](https://ollama.ai) (`ollama pull llama2`)。 ``` git clone https://github.com/arthurpanhku/Arthor-Agent.git cd Arthor-Agent python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt cp .env.example .env # Edit if needed: LLM_PROVIDER=ollama or openai uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 ``` - **API 文档**: [http://localhost:8000/docs](http://localhost:8000/docs) · **健康检查**: [http://localhost:8000/health](http://localhost:8000/health) ### 示例:提交评估 您可以使用 [examples/](examples/) 中的示例文件来试用 API。 ``` # 使用 repo 中的示例文件 curl -X POST "http://localhost:8000/api/v1/assessments" \ -F "files=@examples/sample.txt" \ -F "scenario_id=default" # 响应: { "task_id": "...", "status": "accepted" } # 获取结果 (将 TASK_ID 替换为返回的 task_id) curl "http://localhost:8000/api/v1/assessments/TASK_ID" ``` ### 示例:上传至 KB 并查询 ``` # 使用 repo 中的示例策略 curl -X POST "http://localhost:8000/api/v1/kb/documents" -F "file=@examples/sample-policy.txt" # 查询 KB (RAG) curl -X POST "http://localhost:8000/api/v1/kb/query" \ -H "Content-Type: application/json" \ -d '{"query": "What are the access control requirements?", "top_k": 5}' ``` ## 项目布局 ``` Arthor-Agent/ ├── app/ # Application code │ ├── api/ # REST routes: assessments, KB, health │ ├── agent/ # Orchestration & Assessment pipeline │ ├── core/ # Configuration (pydantic-settings) │ ├── kb/ # Knowledge Base (Chroma, chunking, RAG) │ ├── llm/ # LLM abstraction (OpenAI, Ollama) │ ├── parser/ # Document parsing (PDF, Word, Excel, PPT, text) │ ├── models/ # Pydantic models │ └── main.py ├── tests/ # Automated tests (pytest) ├── examples/ # Sample files (questionnaires, policies) ├── docs/ # Design & Spec documentation │ ├── 01-architecture-and-tech-stack.md │ ├── 02-api-specification.yaml │ ├── 03-assessment-report-and-skill-contract.md │ ├── 04-integration-guide.md │ ├── 05-deployment-runbook.md │ └── schemas/ ├── .github/ # Issue/PR templates, CI (Actions) ├── Dockerfile ├── docker-compose.yml # API only ├── docker-compose.ollama.yml # API + Ollama optional ├── CONTRIBUTING.md # Contribution guidelines ├── CODE_OF_CONDUCT.md # Code of conduct ├── CHANGELOG.md ├── SPEC.md ├── LICENSE ├── SECURITY.md ├── requirements.txt ├── requirements-dev.txt # Dev dependencies ├── pytest.ini └── .env.example ``` ## 配置 | 变量 | 描述 | 默认值 | | :--------------------------------------------- | :------------------- | :---------------------------------- | | `LLM_PROVIDER` | `ollama` 或 `openai` | `ollama` | | `OLLAMA_BASE_URL` / `OLLAMA_MODEL` | 本地 LLM | `http://localhost:11434` / `llama2` | | `OPENAI_API_KEY` / `OPENAI_MODEL` | OpenAI | — | | `CHROMA_PERSIST_DIR` | Vector DB 路径 | `./data/chroma` | | `UPLOAD_MAX_FILE_SIZE_MB` / `UPLOAD_MAX_FILES` | 上传限制 | `50` / `10` | *完整选项请参阅 [.env.example](./.env.example) 和 [docs/05-deployment-runbook.md](./docs/05-deployment-runbook.md)。* ## 文档与 PRD - **[ARCHITECTURE.md](./ARCHITECTURE.md)** — 系统架构:高层图表、Mermaid 视图、组件设计、数据流、安全。 - **[SPEC.md](./SPEC.md)** — 产品需求:问题陈述、解决方案、功能、安全控制。 - **[CHANGELOG.md](./CHANGELOG.md)** — 版本历史;[Releases](https://github.com/arthurpanhku/Arthor-Agent/releases)。 - **设计文档** [docs/](./docs/):架构、API 规范 (OpenAPI)、契约、集成指南 (AAD, ServiceNow)、部署手册。Q1 启动清单:[docs/LAUNCH-CHECKLIST.md](./docs/LAUNCH-CHECKLIST.md)。 ## 开发与测试 如需验证安装或为项目做贡献,请运行测试套件: ### 选项 A:一键测试(推荐) 自动设置测试环境并运行所有检查。 ``` chmod +x test_integration.sh ./test_integration.sh ``` ### 选项 B:手动 ``` # 1. 安装 dev dependencies pip install -r requirements-dev.txt # 2. 运行所有 tests pytest # 3. 运行特定 test (例如 Skills API) pytest tests/test_skills_api.py ``` ## 贡献 欢迎提交 Issue 和 Pull Request。请阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 了解设置、测试和提交指南。参与即表示您同意遵守 [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)。 🤖 **AI 辅助贡献**:我们鼓励使用 AI 工具进行贡献!请查看 [CONTRIBUTING_WITH_AI.md](CONTRIBUTING_WITH_AI.md) 了解最佳实践。 📜 **提交技能模板**:有一个很棒的安全角色设定?请提交 [Skill Template](https://github.com/arthurpanhku/Arthor-Agent/issues/new?template=new_skill_template.md) 或将其添加到 `examples/templates/`。我们欢迎真实世界(经脱敏处理)的安全问卷来改进我们的模板! ## 安全 - **漏洞报告**:请参阅 [SECURITY.md](./SECURITY.md) 了解负责任的披露流程。 - **安全要求**:遵循 [SPEC §7.2](./SPEC.md) 中的安全控制。 ## 许可证 本项目基于 **MIT 许可证** 授权 — 详情请参阅 [LICENSE](./LICENSE) 文件。 ## 作者与链接 - **作者**: PAN CHAO (Arthur Pan) - **仓库**: [github.com/arthurpanhku/Arthor-Agent](https://github.com/arthurpanhku/Arthor-Agent) - **SPEC 与设计文档**: 见上方链接。 如果您在组织中使用 Arthor Agent 或有贡献反馈,我们很乐意听到您的声音(例如通过 GitHub Discussions 或 Issues)。
标签:AI安全助手, AI风险缓解, DLL 劫持, Kubernetes, LLM, LLM评估, MCP, MIT协议, Ollama, OpenAI, Python, RAG, Ruby, Unmanaged PE, 企业安全, 修复建议, 内存规避, 反取证, 合规自动化, 多格式解析, 大语言模型, 安全合规模板, 安全报告生成, 安全评估, 差距分析, 数据隐私, 文档审查, 无后门, 知识库, 网络安全, 网络测绘, 网络调试, 网络资产管理, 自动化, 请求拦截, 逆向工具, 问卷调查, 隐私保护, 风险分析