nlink-jp/ai-ir2

GitHub: nlink-jp/ai-ir2

该工具利用 Google Vertex AI Gemini 模型自动化分析应急响应期间的 Slack 对话记录,生成包含总结、战术提取及多语言翻译的综合分析报告。

Stars: 0 | Forks: 0

# ai-ir2:AI 驱动的应急响应分析 [日本語](README.ja.md) `ai-ir2` 分析通过 [scat](https://github.com/nlink-jp/scat)、[stail](https://github.com/nlink-jp/stail) 或 [scli](https://github.com/nlink-jp/scli) 导出的应急响应 Slack 对话历史,并使用单个命令生成综合分析报告。 由 **Vertex AI Gemini** 提供支持,使用 Application Default Credentials 进行身份验证。 ## 功能 - **一站式分析** — 单个 `aiir2 analyze` 命令即可运行完整流程:摄取、总结、活动分析、角色推断、流程审查和战术提取 - **多格式输出** — Markdown 报告、独立的 HTML(可共享的单文件)以及 YAML/Markdown 知识文档 - **内置翻译** — 调用时指定 `--lang ja`(或 zh, ko, de, fr, es);始终生成英文版本 - **安全优先** — IoC 去除危害处理,使用 nonce 标记包装的提示注入防御 - **Vertex AI Gemini** — 通过 `response_schema` 实现结构化输出,ADC 身份验证 ## 前置条件 - Python 3.11+ - [uv](https://docs.astral.sh/uv/) 包管理器 - 已启用 Vertex AI API 的 GCP 项目 - Application Default Credentials:`gcloud auth application-default login` ## 安装 ``` uv sync ``` ## 快速开始 ``` # 导出 Slack 频道历史记录 stail export -c "#incident-response" --output incident.json # 运行完整分析 (English + Japanese) aiir2 analyze incident.json --lang ja # 输出目录结构: # {incident_id}/ # ├── en/report.md, report.html # ├── ja/report.md, report.html # ├── knowledge/*.yaml, *.md # └── preprocessed.json ``` ## 配置 | 环境变量 | 默认值 | 描述 | |---------------------|---------|-------------| | `AIIR2_PROJECT` | (必填) | GCP 项目 ID | | `AIIR2_LOCATION` | `us-central1` | Vertex AI 位置 | | `AIIR2_MODEL` | `gemini-2.5-flash` | Gemini 模型名称 | | `AIIR2_TIMEZONE` | `UTC` | 报告时间戳的时区(IANA 名称,例如 `Asia/Tokyo`) | CLI 标志 `--project`、`--location`、`--model`、`--timezone` 会覆盖环境变量。 ## 命令 ``` aiir2 analyze # Full analysis pipeline aiir2 analyze --lang ja --lang zh # With translation aiir2 analyze -o ./out # Custom output directory aiir2 analyze --timezone Asia/Tokyo # Timezone for timestamps aiir2 config show # Display current configuration ``` ## 文档 - [分析方法论](docs/en/analysis-methodology.md) / [分析手法](docs/ja/analysis-methodology.md) - [数据格式](docs/en/data-format.md) / [データフォーマット](docs/ja/data-format.md) ## 许可证 MIT
标签:AI, DLL 劫持, GCP, Gemini, Google Cloud, HTML, IoC, Markdown, Python, Ruby, Slack, Vertex AI, YAML, 人工智能, 多语言支持, 大语言模型, 安全库, 安全测试框架, 安全运营, 扫描框架, 指标去武装化, 提示注入防御, 无后门, 源代码安全, 用户模式Hook绕过, 知识库, 网络安全, 翻译, 自动化代码审查, 自动化分析, 跨站脚本, 逆向工具, 隐私保护