适用场景
将 `/ai-gateway` 作为设置中心:连接一个 BYOK 提供商密钥,在策略中将其加入允许列表,然后为您的 IDE 或自动化工具创建一个客户端。
将 `/ai-gateway` 作为设置中心:连接一个 BYOK 提供商密钥,在策略中将其加入允许列表,然后为您的 IDE 或自动化工具创建一个客户端。 受众: 租户管理员、安全主管和工作区所有者. 典型配置时长: 15-20 分钟.
将 `/ai-gateway` 作为设置中心:连接一个 BYOK 提供商密钥,在策略中将其加入允许列表,然后为您的 IDE 或自动化工具创建一个客户端。
步骤 1
从 `/ai-gateway` 开始,然后打开 OpenAI 提供商连接以添加您的团队已经信任的第一个租户自有密钥。
达成目标状态
在返回 AI Gateway 之前运行提供商预检。
步骤 2
在策略显式允许连接的提供商之前,AI Gateway 会限制活动的路由和访问。
达成目标状态
保持咨询模式 (advisory),直到试点团队看到您预期的警告,然后再转为强制执行 (enforce)。
步骤 3
为每个 IDE、MCP 客户端或服务主体分配其专用的 AI Gateway 客户端,以便轻松轮换或禁用访问权限。
达成目标状态
将每个客户端限制在团队实际需要的提供商连接和 MCP 工具范围内。
步骤 4
首先运行一次低风险测试,以确认身份验证、策略行为和活动日志记录。
达成目标状态
在邀请更多用户之前,审查策略警告和使用日志。
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.
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"
}'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."
}
]
}'{
"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"
]
}
}
}