inkog-io/inkog

GitHub: inkog-io/inkog

AI Agent 静态安全扫描工具,在部署前检测无限循环、Prompt 注入、护栏缺失等问题并生成合规报告

Stars: 31 | Forks: 5

Inkog

AI Agent 开发的安全副驾驶。

从一开始就构建安全的 AI Agent。在上线前扫描逻辑漏洞、Prompt 注入、缺失的护栏以及合规缺口。

English · 简体中文 · 日本語 · 한국어 · Español · Português · Deutsch · Français

Release License Go Report Card CI Slack

Inkog scanning AI agent code for vulnerabilities

AI Agent 可能陷入无限循环,在几分钟内耗尽你的 API 预算,执行来自用户输入的任意代码,或者在零人工监督的情况下做出高风险决策。大多数此类缺陷都能通过代码审查,因为它们看起来像正常代码——危险在于其运行时行为。 Inkog 静态扫描你的 Agent 代码,并在部署前捕捉这些问题。只需一条命令,支持 20 多种框架,并将发现结果映射到 EU AI Act 和 OWASP LLM Top 10。 ## 何时使用 Inkog - **构建 AI Agent** — 在开发过程中扫描,以便在上线前捕捉无限循环、Prompt 注入和缺失的护栏 - **为 CI/CD 添加安全性** — 将 `inkog-io/inkog@v1` 添加到 GitHub Actions,以便在每个 PR 上设置自动化安全门禁 - **为 EU AI Act 做准备** — 生成合规报告,将你的 Agent 映射到 Article 14、NIST AI RMF、OWASP LLM Top 10 - **审查 Agent 代码** — 通过 Claude Code、Cursor 或任何 MCP 客户端使用,在编写代码时获取安全分析 - **审计 MCP Server** — 在安装前检查任何 MCP Server 是否存在工具投毒、权限提升或数据泄露风险 - **验证 AGENTS.md** — 验证治理声明是否与实际代码行为相符 - **扫描 Skill 包** — 在将 SKILL.md 包添加到你的 Agent 之前,审计其是否存在工具投毒、命令注入和过度权限问题 - **生成 MLBOM** — 创建机器学习物料清单 (MLBOM),记录你的 Agent 组件、工具和数据流 - **构建多 Agent 系统** — 检测 Agent 之间的委托循环、权限提升和未授权交接 (A2A 审计) ## 快速开始 无需安装: ``` npx -y @inkog-io/cli scan . ``` 或永久安装: | Method | Command | |--------|---------| | **Install script** | `curl -fsSL https://inkog.io/install.sh \| sh` | | **Homebrew** | `brew tap inkog-io/inkog && brew install inkog` | | **Go** | `go install github.com/inkog-io/inkog/cmd/inkog@latest` | | **Binary** | [从 Releases 下载](https://github.com/inkog-io/inkog/releases) | ``` # 在 https://app.inkog.io 获取您的免费 API key export INKOG_API_KEY=sk_live_... inkog . ``` ## 检测能力 | Category | Examples | Why it matters | |----------|----------|----------------| | **Infinite loops** | Agent re-calls itself with no exit condition, LLM output fed back as input without a cap | Your agent runs forever and racks up API costs | | **Prompt injection** | User input flows into system prompt unsanitized, tainted data reaches tool calls | Attackers can hijack your agent's behavior | | **Missing guardrails** | No human-in-the-loop for destructive actions, no rate limits on LLM calls, unconstrained tool access | One bad decision and your agent goes rogue | | **Hardcoded secrets** | API keys, tokens, and passwords in source code (detected locally, never uploaded) | Credentials leak when you push to GitHub | | **Compliance gaps** | Missing human oversight (EU AI Act Article 14), no audit logging, missing authorization checks | You're legally required to have these controls by August 2026 | [完整检测目录 →](https://docs.inkog.io/vulnerabilities) ## 支持的框架 **Code-first:** LangChain · LangGraph · CrewAI · AutoGen · AG2 · OpenAI Agents · Semantic Kernel · Azure AI Foundry · LlamaIndex · Haystack · DSPy · Phidata · Smolagents · PydanticAI · Google ADK **No-code:** n8n · Flowise · Langflow · Dify · Microsoft Copilot Studio · Salesforce Agentforce ## GitHub Actions ``` - uses: inkog-io/inkog@v1 with: api-key: ${{ secrets.INKOG_API_KEY }} sarif-upload: true # Shows findings in GitHub Security tab ``` [完整 CI/CD 文档 →](https://docs.inkog.io/ci-cd/github-action)
Deep scan Run an advanced orchestrator-based analysis with enriched findings, an agent profile, compliance coverage, and a premium HTML report: ``` inkog -deep . inkog -deep -output html . > deep-report.html ``` Requires the Inkog Deep role. [Deep scan 文档 →](https://docs.inkog.io/cli/deep-scan)
Skill & MCP scan Scan SKILL.md packages, agent tools, and MCP servers for vulnerabilities: ``` # 扫描 skill package inkog skill-scan . inkog skill-scan --repo https://github.com/org/repo # 通过 registry name 扫描 MCP server inkog mcp-scan github inkog mcp-scan github --repo https://github.com/org/mcp-server # 深度扫描二者 inkog skill-scan --deep . inkog mcp-scan --deep --repo https://github.com/org/mcp-server ``` [Skill & MCP scan 文档 →](https://docs.inkog.io/cli/skill-scan)
Scan policies ``` inkog . --policy low-noise # Only proven vulnerabilities inkog . --policy balanced # Vulnerabilities + risk patterns (default) inkog . --policy comprehensive # Everything including hardening tips inkog . --policy governance # Article 14 controls, authorization, audit trails inkog . --policy eu-ai-act # EU AI Act compliance report ``` [策略参考 →](https://docs.inkog.io/cli/policies)
## MCP Server Scan agent code directly from Claude, ChatGPT, or Cursor: ``` npx -y @inkog-io/mcp ``` 7 tools including MCP server auditing, Skill package scanning, and multi-agent topology analysis. [MCP 文档 →](https://docs.inkog.io/integrations/mcp) ## Inkog Red — 即将推出 Automated adversarial testing for AI agents. Inkog Red probes your running agents with prompt injection, jailbreaks, and tool misuse attacks to validate that defenses hold under real-world conditions. [加入候补名单 →](https://inkog.io/red) ## Star History Star History Chart ## 许可证 Apache 2.0 — See [LICENSE](LICENSE)
标签:AI基础设施, DevSecOps, EVTX分析, Go语言, MITM代理, 上游代理, 云安全监控, 人工智能安全, 合规性, 大模型安全, 安全副驾驶, 开源安全工具, 护栏, 日志审计, 程序破解, 越狱检测, 逆向工程平台, 逻辑漏洞, 防御工程, 静态分析, 飞行前检查