SuperAPI AI 工具集

mantis-configure

办公与效率

查看项目

更新于 10-15 21:53

技能介绍

用途:Mantis 的流水线配置器(/mantis-configure),负责把 workflow.json 配置为可运行状态,包括沙箱执行机制、AI 模型提供商、API 端点与凭据绑定,并提供预检验证,确保 LLM 凭据和沙箱隔离在启动安全审查任务前可用。

主要能力:支持四种沙箱机制——static-only(仅静态分析,零主机风险,始终可用)、gvisor(无网络 OCI 容器,需 docker/podman 且注册 runsc)、microsandbox(临时 Linux 微虚拟机,需 /dev/kvm 读写权限)、gce(经 IAP SSH 隧道的临时 GCE 虚拟机,需 gcloud CLI 与 GCP 认证)。模型侧支持 Gemini、Vertex AI 上的 Claude、Vertex Model Garden 的 MaaS 开源模型,以及通过 openai/{MODEL_ID} 接入的 OpenAI 兼容端点(可配 --api-base,如 vLLM、Ollama、LiteLLM)。

使用方式:脚本位于 Mantis 安装目录的 reference/scripts/configure.py,必须用绝对路径或 $MANTIS_HOME 调用,禁止在受审目标仓库内用相对路径执行。常用命令:python3 "$MANTIS_HOME/reference/scripts/configure.py" --test 做约 1 秒静态校验,加 --probe 主动探测 LLM 可达性;--auto 自动检测主机能力并选择最佳沙箱;--sandbox static-only 切换纯静态分析;--sandbox gvisor --image mantis-sandbox:latest;--sandbox gce --project my-gcp-project --zone us-central1-b;--model vertex_ai/claude-opus-5 或 --model openai/my-model --api-base http://localhost:8000/v1;--interactive 进入交互向导。其他选项包括 --reasoning-effort、--timeout、--image、--subnet、--workdir、--workflow、--db、--save、--save-tracked/--global、--show、--dry-run、--update-nodes、--json。也可通过 Python API 调用 detect_capabilities、ensure_configured、run_preflight_checks 等函数。

适用场景:在启动 Mantis 安全审查任务前完成环境与模型配置、切换沙箱隔离级别、切换模型或本地端点、排查凭据与沙箱就绪状态。

限制:各沙箱机制有明确前置条件(runsc、/dev/kvm、gcloud 认证等),不满足时无法启用;配置默认写入 workflow.local.json,仅在指定 --save-tracked 时写入基础 workflow.json;资料未提供具体收费、价格或性能数据。