AI

apisec-inc/ai-surface

开发工具官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

138 stars 22 forks 质量 84 趋势 50MIT

Find and govern AI attack surfaces in application code, at PR time and inside your AI coding tool (MCP server, Claude Code hook). Free, OSS, runs offline.

概览

ai-surface maps the AI attack surface in your codebase: LLM calls, agents, MCP servers, RAG/vector stores, model gateways, self-hosted runtimes, provider keys, and the HTTP APIs that expose them. Run it locally, in CI, or inside your AI coding tool to see what AI surfaces a change introduces, generate an AI-BOM, and gate new high-risk findings before merge. Most layers of a codebase already have a check that runs before merge: Trivy for container images, Gitleaks for committed secrets, an SCA for dependencies. The AI layer, the agents, MCP servers, RAG, and LLM calls, has not had one. ai-surface is that check. Every risky finding carries a verdict: (an unambiguous fact of the code as written, like a financial-action tool with no approval step) or (inferred, wants a human look). Every scan ends on a scorecard with a posture grade. CI setup is one command: ai-surface init.

README

以下为原文 README 节选,完整内容请查看原文。

ai-surface maps the AI attack surface in your codebase: LLM calls, agents, MCP servers, RAG/vector stores, model gateways, self-hosted runtimes, provider keys, and the HTTP APIs that expose them. Run it locally, in CI, or inside your AI coding tool to see what AI surfaces a change introduces, generate an AI-BOM, and gate new high-risk findings before merge.

Most layers of a codebase already have a check that runs before merge: Trivy for container images, Gitleaks for committed secrets, an SCA for dependencies. The AI layer, the agents, MCP servers, RAG, and LLM calls, has not had one. ai-surface is that check.

Every risky finding carries a verdict: confirmed risk (an unambiguous fact of the code as written, like a financial-action tool with no approval step) or likely risk (inferred, wants a human look). Every scan ends on a scorecard with a posture grade. CI setup is one command: ai-surface init.

It runs as a local static analysis pass that executes no code, makes no network calls, sends no telemetry, and requires no credentials, so your source never leaves the host.

Try it without installing:

uvx --from apisec-ai-surface ai-surface scan .

If ai-surface is useful to you, star the repo so more engineers find it.

Findings map to the OWASP LLM Top 10 and the EU AI Act, NIST AI RMF, and ISO 42001, so the AI-BOM doubles as governance evidence (see Compliance). Runtime exploit validation is out of scope for this OSS scanner.

Who is this for?

Use ai-surface if you are:

  • adding agents, MCP servers, RAG, model gateways, or LLM calls to an application
  • reviewing AI-related pull requests before they merge
  • adding an AI risk gate to CI/CD
  • building an AI-BOM or AI-governance inventory from source code
  • trying to understand where AI risk enters your codebase
在 GitHub 查看完整 README

安装

uvx --from apisec-ai-surface ai-surface scan .

配置

{ "mcpServers": { "ai-surface": { "command": "ai-surface", "args": ["mcp"] } } }