文章标题:AI 防护栏演示 暂无成功案例
正文: 无防护栏
未受保护的 AI 机器人
AI 机器人 · 即时发送
有防护栏
受 Guardrail API 保护
选择一个预设或编辑表单,然后运行实时检查。
在此服务器上调用 POST /verify。
正在对照策略进行验证……
先执行第 1 层规则,再由第 2 层 AI 评判
5 行代码完成集成
在你的智能体执行之前调用它。如果未获批准,就转交给人工处理。
30 秒内通过 Cursor 或 Claude Code 完成安装
将此提示粘贴到你的 AI 代码编辑器中。它会找到你的退款和折扣操作,添加 verifyWithGuardrail 辅助函数,并将它们包装在 Shadow Mode 中,这样对线上客户不会有任何改变。
Act as a senior software engineer. I want to integrate an external AI Transaction & Refund Guardrail API into this codebase to verify AI-generated refunds, discounts, and policy commitments before they execute.
### Integration Instructions
1. **Locate High-Stakes AI Actions:** Search this repository for where our AI customer support agent or workflow executes refunds, creates discount/promo codes, modifies orders, or sends final policy promises to customers.
2. **Add Environment Variables:** Add `GUARDRAIL_API_URL` (defaulting to `https://YOUR-RAILWAY-URL.up.railway.app/verify`) and `GUARDRAIL_API_KEY` (placeholder `YOUR_API_KEY_HERE`) to our `.env.example` or config file.
3. **Create a Non-Blocking Helper Function (`verifyWithGuardrail`):**
- Send a `POST` request to `GUARDRAIL_API_URL` with header `Authorization: Bearer ${GUARDRAIL_API_KEY}` and `Content-Type: application/json`.
- Pass this JSON body:
{ "action_type": "refund", "proposed_amount": 0.0, "order_total": 0.0, "days_since_purchase": 0, "policy_text": "STORE_RETURN_POLICY_HERE", "customer_message": "USER_MESSAGE_HERE", "ai_draft_reply": "AI_DRAFT_REPLY_HERE", "shadow_mode": true }
- Set a strict `1000ms` fetch timeout. If the request times out or fails, log a warning and default to allowing execution (`fail-open` during Shadow Mode) so live customer traffic is never interrupted.
4. **Wrap Our Existing Action:** Call `verifyWithGuardrail` right before our refund/discount tool executes or sends its reply. Log the returned `blocked_by_policy` and `reason` fields to our console/logger. Keep `shadow_mode: true` by default so we can monitor results safely before switching `shadow_mode` to `false` for active blocking.
Show me the exact files you modified and confirm how to test it locally.
简单定价。从 Shadow Mode 开始。
用一周时间零风险地观察防护栏本会拦截哪些内容,然后开启主动拦截。
免费 7 天 Shadow 试用
$0for 7 days
查看你的 AI 本会搞错的每一笔退款和承诺,同时不影响线上流量。
- 完整的两层验证
- 仅 Shadow Mode 日志记录
- 本会被拦截内容的报告
- 即时获取密钥,无需银行卡
入门版
适合运行一个会发放退款或折扣的 AI 客服智能体的品牌。
- 主动拦截或 Shadow Mode
- 规则引擎 + 带后备的 AI 评判
- 自定义退款、折扣和退货窗口限制
- 每次决策的审计日志
成长版
适合高流量商店、客服平台以及运营多个机器人的代理机构。
- 包含入门版全部功能
- 专为高流量并发流量打造
- 多商店和多策略
- 优先支持
付费方案:检查通过 Stripe 计量,你的 API 密钥会在结账后立即显示。随时可取消。