cognis-digital/embedaudit

GitHub: cognis-digital/embedaudit

面向 RAG 应用的向量存储审计工具,用于检测嵌入漂移、数据投毒、近重复项及向量支配问题。

Stars: 0 | Forks: 0

EMBEDAUDIT # EMBEDAUDIT ### Embedding / 向量存储漂移与投毒审计 [![PyPI](https://img.shields.io/pypi/v/cognis-embedaudit.svg?color=6b46c1)](https://pypi.org/project/cognis-embedaudit/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/aab7cf5182082035.svg)](https://github.com/cognis-digital/embedaudit/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *数据与数据集 — 零配置的质量、血缘与治理。*
``` pip install cognis-embedaudit embedaudit scan . # → prioritized findings in seconds ``` ## 使用说明 — 逐步指南 1. **安装** CLI: pip install embedaudit 2. **审计**你的向量存储快照 — 一个包含 embedding 记录的 JSONL 文件 — 以检查近乎重复的项和单一向量支配: embedaudit audit snapshot.jsonl --dup-threshold 0.999 --domination-share 0.30 3. **与受信任的基线进行比较**,以捕获两个快照之间的漂移 / 投毒: embedaudit drift baseline.jsonl current.jsonl --drift-threshold 0.15 4. **阅读输出。**添加 `--format json` 以获取机器可读的报告,并在发现的结果超过你的阈值时返回非零退出代码: embedaudit audit snapshot.jsonl --format json > report.json 5. **将其接入 CI** — 当索引出现回归时使构建失败: embedaudit drift baseline.jsonl current.jsonl --format json || exit 1 ## 目录 - [为什么选择 embedaudit?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing) ## 为什么选择 embedaudit? RAG 运维利器 `embedaudit` 是单一用途、可编写脚本且可自托管的:将其指向目标,以你的工作流已有的格式(表格 · JSON · SARIF)获取优先级排序的结果,通过它来控制 CI,并让代理通过 MCP 驱动它。
↑ 返回顶部
## 功能 - ✅ 加载 Jsonl - ✅ 审计存储 - ✅ 漂移报告 - ✅ 运行于 Linux/macOS/Windows · Docker · devcontainer - ✅ 支持 Python、JavaScript、Go 和 Rust 移植版本 (`ports/`)
↑ 返回顶部
## 快速开始 ``` pip install cognis-embedaudit embedaudit --version embedaudit scan . # scan current project embedaudit scan . --format json # machine-readable embedaudit scan . --fail-on high # CI gate (non-zero exit) ```
↑ 返回顶部
## 示例 ``` $ embedaudit scan . [HIGH ] EMB-001 example finding (./src/app.py) [MEDIUM ] EMB-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 返回顶部
## 架构 ``` flowchart LR IN[target / manifest] --> P[embedaudit
checks + rules] P --> OUT[findings (JSON / SARIF)] ```
↑ 返回顶部
## 从任何 AI 技术栈中使用 `embedaudit` 可与所有流行的 AI 使用方式互操作: - **MCP 服务器** — `embedaudit mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 通过管道将 `embedaudit scan . --format json` 传递给任何代理或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码将 CLI/JSON 封装为工具 - **CI / 脚本** — 为非 AI 流水线提供退出代码 + SARIF
↑ 返回顶部
## 对比 | | **Cognis embedaudit** | RAG 安全 | |---|:---:|:---:| | 可自托管,无需账号 | ✅ | 视情况而定 | | 单一命令,零配置 | ✅ | ⚠️ | | 支持 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生 (AI 代理) | ✅ | ❌ | | 多语言移植 (JS/Go/Rust) | ✅ | ❌ | | 开源许可证 | ✅ COCL | 视情况而定 | *秉承 **RAG 安全**的精神,以 Cognis 的方式重塑。遗漏了致谢?提交一个 PR。*
↑ 返回顶部
## 集成 可接入你的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI 代理的 **MCP 服务器** (`embedaudit mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。请参阅 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 返回顶部
## 安装 — 各种方式,所有平台 ``` pip install "git+https://github.com/cognis-digital/embedaudit.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/embedaudit.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/embedaudit.git" # uv pip install cognis-embedaudit # PyPI (when published) docker run --rm ghcr.io/cognis-digital/embedaudit:latest --help # Docker brew install cognis-digital/tap/embedaudit # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/embedaudit/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | 云平台 | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/embedaudit` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 返回顶部
## 相关的 Cognis 工具 - [`duckprobe`](https://github.com/cognis-digital/duckprobe) — 通过 DuckDB 对任何文件或数据仓库进行零配置数据质量检查 - [`schemadrift`](https://github.com/cognis-digital/schemadrift) — Schema 变更检测器和数据契约测试 - [`csvlens`](https://github.com/cognis-digital/csvlens) — 用于剖析和清理超大 CSV / Parquet 文件的快速 CLI - [`piiscan`](https://github.com/cognis-digital/piiscan) — 跨数据仓库和数据湖的 PII 发现(数据端扫描器) - [`lineagemap`](https://github.com/cognis-digital/lineagemap) — 从 SQL 和 dbt 提取的列级血缘 - [`datasetcard`](https://github.com/cognis-digital/datasetcard) — 带有 Croissant + 血缘的自动 Dataset Cards / datasheets **探索全套工具 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 返回顶部
## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件组合使用 — JSON 输入/输出以及共享的兼容 OpenAI 的 `/v1` 骨干网络。请参阅 **[INTEROP.md](INTEROP.md)** 了解套件图谱、组合模式和参考技术栈。 ## 许可证 在 **Cognis Open Collaboration License (COCL) v1.0** 下提供源代码 — 个人、内部评估、研究和教育用途免费;**商业 / 生产用途需要许可证** (licensing@cognis.digital)。请参阅 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中 170+ 工具之一 · Making Tomorrow Better Today
标签:Linux系统监控, 人工智能, 可视化界面, 向量数据库, 数据可视化, 数据质量, 日志审计, 模型安全, 用户模式Hook绕过, 请求拦截, 逆向工具