公开指南

启用 AI Gateway 和 AI 提供商连接

连接您首选的 AI 提供商和 MCP 客户端,以便团队可以运行辅助分类和安全审核工作流程。 受众: 安全平台管理员和集成工程师. 典型配置时长: 20-30分钟.

reference

Use this if

连接您首选的 AI 提供商和 MCP 客户端,以便团队可以运行辅助分类和安全审核工作流程。

Audience: 安全平台管理员和集成工程师Typical time: 20-30分钟

开始之前

  • 选择经过批准的模型提供商并将凭据存储在您的秘密管理器中。
  • 确认您的内部风险政策允许哪些人工智能任务。
  • 确保 MCP 客户端可以安全地发送工作区 JWT 凭据。

Guide walkthrough

1

步骤 1

安全配置提供商凭据

将模型提供程序机密保留在您自己的机密管理器中,并从 BlackShield 配置中引用它们。

  • 为您批准的模型端点创建提供商凭据。
  • 通过映射凭据引用`AI_SHIM_SECRET_VALUES` 使用 `credentials_ref` 密钥。
  • 仅启用您的团队打算使用的 AI 任务。

What success looks like

仅启用您的团队打算使用的 AI 任务。

2

步骤 2

启用带有护栏的AI辅助工作流程

从高价值工作流程开始,并对生产决策实施人工审查。

  • 启用 `smart_alert_triage` 以进行积压优先级。
  • 启用`pr_diff_analysis`以确保代码安全查看支持。
  • 设置与风险策略一致的模型、令牌、超时和温度限制。

What success looks like

设置与风险策略一致的模型、令牌、超时和温度限制。

3

步骤 3

集成您的MCP客户端

配置您的MCP客户端以调用BlackShield工具,同时保持模型推理在您的控制之下。

  • 将 MCP 端点设置为`/api/v1/mcp` 并在授权标头中包含工作区 JWT。
  • 在之前运行 `initialize` 和 `tools/list`调用 `tools/call`。
  • 使用 `/api/v1/mcp/manifest` 发现可用的工具元数据。
  • 将提供程序密钥保留在您自己的运行时中,并需要人工批准才能进行生产更改。

What success looks like

将提供程序密钥保留在您自己的运行时中,并需要人工批准才能进行生产更改。

Demonstration only

This configuration is designed for ease of use. To deploy scanner clients at scale, please plan your deployment architecture accordingly or contact us for enterprise best practices.

运行命令

Exchange client credentials for a short-lived token
curl -X POST https://api.blackshield.chaplau.com/api/v1/ai-gateway/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "your-client-id",
    "client_secret": "your-client-secret"
  }'
Query OpenAI completions via the Gateway Proxy
curl -X POST https://api.blackshield.chaplau.com/api/v1/ai-gateway/openai/v1/chat/completions \
  -H "Authorization: Bearer <your_short_lived_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "openai",
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": "List the security requirements for the tenant onboarding flow."
      }
    ]
  }'
Configure the Stdin/Stdout MCP Proxy in Cursor / VS Code / Claude Desktop
{
  "mcpServers": {
    "blackshield-gateway": {
      "command": "blackshield-mcp",
      "args": [
        "--client-id", "<your-client-id>",
        "--client-secret", "<your-client-secret>",
        "--url", "https://api.blackshield.chaplau.com/api/v1/mcp"
      ]
    }
  }
}

What success looks like

  • MCP 握手和工具/list 成功完成。
  • AI辅助操作让人类批准影响生产的变更。
启用 AI Gateway 和 AI 提供商连接 | BlackShield Docs