konjoai/squash

GitHub: konjoai/squash

面向 AI/ML 团队的自动化合规工具,在 CI/CD 流水线中完成 EU AI Act 等多项政策框架的策略检查并自动生成审计文档与签名证明。

Stars: 1 | Forks: 0

# Squash — 消除违规,保障开发速度。 **AI 合规领域的 `pytest`。在您的 CI/CD 流水线中运行。10 秒内即可集成。** [![PyPI](https://img.shields.io/pypi/v/squash-ai?color=brightgreen&label=pip%20install%20squash-ai)](https://pypi.org/project/squash-ai/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/4eb6ae1e0c094700.svg)](https://github.com/konjoai/squash/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache_2.0-blue)](LICENSE) [![Python](https://img.shields.io/pypi/pyversions/squash-ai)](https://pypi.org/project/squash-ai/) [![EU AI Act](https://img.shields.io/badge/EU%20AI%20Act-Annex%20IV%20ready-green)](https://getsquash.dev) ## 10 秒内查看效果 ``` pip install squash-ai squash demo ``` ``` ──────────────────────────────────────────────────── Squash violations, not velocity. Running demo attestation on sample BERT model… ──────────────────────────────────────────────────── Model: bert-base-uncased (sample) Policy: eu-ai-act ✅ Attestation PASSED Artifacts generated: cyclonedx-mlbom.json 48,392 bytes sbom.spdx.json 22,104 bytes attestation.json 3,841 bytes annex-iv-technical-documentation.md 18,299 bytes provenance.json 1,203 bytes ──────────────────────────────────────────────────── This is squash. It runs in CI in <10 seconds. pip install squash-ai && squash attest ./your-model ──────────────────────────────────────────────────── ``` ## 安装 ``` # 社区版(免费,Apache 2.0) pip install squash-ai # 带有 REST API server pip install "squash-ai[api]" # 完整功能集 pip install "squash-ai[api,signing,sbom]" ``` ## 一行代码搞定 CI/CD ### GitHub Actions ``` - uses: konjoai/squash@v1 with: model-path: ./my-model policy: eu-ai-act fail-on-violation: true ``` ### GitLab CI ``` include: - remote: 'https://raw.githubusercontent.com/konjoai/squash/main/integrations/gitlab-ci/squash.gitlab-ci.yml' ``` ### CLI ``` squash attest ./my-model \ --policy eu-ai-act \ --policy nist-ai-rmf \ --sign \ --fail-on-violation ``` 输出: ``` ✓ CycloneDX 1.7 ML-BOM → cyclonedx-mlbom.json ✓ SPDX 2.3 SBOM → sbom.spdx.json ✓ EU AI Act Annex IV: PASS → annex-iv.md ✓ NIST AI RMF: PASS (42/42) ✓ OWASP LLM Top 10: PASS ✓ SLSA Level 2 provenance → provenance.json ✓ ModelScan: PASS (0 findings) ✓ Signed via Sigstore Rekor ``` ## 为什么选择 Squash | 没有 Squash | 使用 Squash | |---------------|-------------| | Annex IV 文档:3–6 个月 | Annex IV 文档:10 秒 | | 合规顾问:€150K–€400K/年 | Squash 专业版:$299/月 | | 每个模型的手动风险评估 | `squash attest ./model --policy eu-ai-act` | | 在审计中发现违规 | 在 CI 中阻止违规,防止被合并 | | 零可见性 | Grafana 中的 `squash_models_compliant_ratio 0.979` | ## 功能特性 | 功能 | 详情 | |-----------|--------| | **EU AI Act Annex IV** | 自动生成全部 12 个必需的文档章节 | | **CycloneDX 1.7 ML-BOM** | 机器可读的模型物料清单 | | **SPDX 2.3 SBOM** | 完整的依赖项和溯源图 | | **10+ 策略框架** | EU AI Act · NIST AI RMF · ISO 42001 · OWASP LLM Top 10 · FedRAMP · CMMC | | **ModelScan 安全** | Pickle 漏洞利用、序列化攻击、不安全操作 | | **Sigstore 签名** | 通过 Rekor 透明日志进行无密钥签名 | | **SLSA Provenance** | Level 1–3 溯源证明 | | **VEX Feed** | 针对已部署 AI 模型组件的实时 CVE 跟踪 | | **漂移检测** | 当模型行为偏离已证明的基线时发出警报 | | **Prometheus `/metrics`** | 兼容 Grafana 的证明计数、违规和延迟指标 | | **Slack / Teams 警报** | 针对违规、漂移事件和 CVE 命中的 Webhook 通知 | | **JIRA / Linear / GitHub Issues** | 在发生策略违规时自动创建工单 | | **FastAPI / Django 中间件** | 在每次推理响应中附加 `X-Squash-Compliant` 标头 | | **合规徽章** | `![Squash](https://api.getsquash.dev/badge/eu-ai-act/compliant)` | | **`squash watch`** | 在模型文件更改时重新证明 — 持续的本地合规保障 | | **`squash install-hook`** | git pre-push 钩子 — 阻止不合规的推送 | | **10+ MLOps 集成** | MLflow · W&B · HuggingFace · LangChain · SageMaker · Vertex AI · Ray · Kubernetes | | **开放核心** | 社区版在 Apache 2.0 协议下永久免费 | ## 在 60 秒内设置新项目 ``` squash init ./my-model # 自动检测 PyTorch / TensorFlow / JAX / MLflow / HuggingFace # 写入 .squash.yml,运行 dry-run attestation ``` ## 您 README 中的合规徽章 ``` ![Squash EU AI Act compliant](https://api.getsquash.dev/badge/eu-ai-act/compliant) ``` 可用状态:`compliant` · `non-compliant` · `partial` · `unknown` 可用框架:`eu-ai-act` · `nist-ai-rmf` · `iso-42001` 及其他 ## 策略框架 | 框架 | 状态 | 核心检查项 | |-----------|--------|------------| | EU AI Act (Annex IV) | ✅ 完整 | 技术文档、风险分类、人工监督 | | NIST AI RMF 1.0 | ✅ 完整 | 42 项控制:GOVERN · MAP · MEASURE · MANAGE | | OWASP LLM Top 10 | ✅ 完整 | LLM01–LLM10 漏洞类别 | | ISO 42001 | ✅ 核心 | 第 6, 8, 9 条款 | | NTIA 最低要素 | ✅ 完整 | 7 个必需的 SBOM 字段 | | FedRAMP AI | ✅ 核心 | 联邦 AI 采购要求 | | CMMC Level 2 | ✅ 核心 | 国防部 (DoD) 承包商 AI 要求 | ## Python API ``` from squash import AttestPipeline, AttestConfig result = AttestPipeline.run(AttestConfig( model_path="./my-model", policies=["eu-ai-act", "owasp-llm"], sign=True, fail_on_violation=True, )) print(f"Passed: {result.passed}") print(f"Attestation ID: {result.attestation_id}") ``` ## REST API ``` pip install "squash-ai[api]" uvicorn squash.api:app --host 0.0.0.0 --port 4444 curl -X POST http://localhost:4444/v1/attest \ -H "Authorization: Bearer $SQUASH_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model_path": "/models/bert-base", "policies": ["eu-ai-act"]}' ``` ## Prometheus 指标 ``` # HELP squash_attestations_total Total attestation 运行次数 squash_attestations_total{result="passed",policy="eu-ai-act"} 142 squash_models_compliant_ratio 0.979 squash_api_latency_seconds_bucket{le="0.1"} 138 ``` ## 版本与定价 | 版本 | 价格 | 每月证明次数 | 功能 | |------|-------|-----------------|----------| | **Community** | 免费 | 10 | 完整 CLI、SBOM、策略检查、签名、自托管 | | **Professional** | $299/月 | 200 | Cloud API、Annex IV 自动生成、漂移警报、Slack/Teams | | **Startup** | $499/月 | 500 | 专业版所有功能 + VEX 读取、3 个用户、GitHub Issues 工单集成 | | **Team** | $899/月 | 1,000 | 多租户、SAML SSO、HITL 工作流、审计导出 | | **Enterprise** | 定制 | 无限制 | 本地部署、离线环境、欧盟数据驻留、专属支持 | [免费开始 →](https://getsquash.dev) · [查看定价 →](https://getsquash.dev/pricing) ## 架构 ``` squash attest ./my-model │ ├── ModelScanner → Security scan (pickle, unsafe ops, CVEs) ├── CycloneDXBuilder → ML-BOM (CycloneDX 1.7) ├── SpdxBuilder → SBOM (SPDX 2.3) ├── PolicyEngine → EU AI Act · NIST · OWASP · ISO checks ├── SlsaBuilder → SLSA Level 1–3 provenance ├── AnnexIVGenerator → All 12 Annex IV sections (MD/HTML/PDF) ├── VexEvaluator → Live CVE vulnerability feed ├── OmsSigner → Sigstore keyless signing ├── DriftDetector → Baseline behavioral comparison └── AttestPipeline → Signed audit record (JSON) ``` ## 开发 ``` git clone https://github.com/konjoai/squash cd squash pip install -e ".[api,signing,sbom,dev]" # 运行所有测试(2,299 个通过) python -m pytest tests/ -v --timeout=120 # 立即试用 squash demo # Watch 模式 squash watch ./my-model ``` ## 许可证 社区版:[Apache 2.0](LICENSE) 企业功能(云 API、多租户控制面板、VEX feed、本地部署)在商业许可证下提供。[联系洽谈 →](mailto:wesleyscholl@gmail.com) *由 [Konjo AI](https://konjo.ai) 开发 · “消除违规,保障开发速度。”*
标签:AI治理, Annex IV, DevSecOps, DLL 劫持, EU AI Act, LNA, MLOps, pytest, Python, SBOM, 上游代理, 人工智能监管, 合规自动化, 大语言模型, 安全合规, 审计记录, 开源, 无后门, 机器学习运维, 模型合规, 欧盟人工智能法案, 硬件无关, 签名认证, 网络代理, 网络测绘, 自定义请求头, 跌倒检测, 软件物料清单, 逆向工具