> ## Documentation Index
> Fetch the complete documentation index at: https://exosphere-auto-translate-docs-20260626-1023.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Failproof AI

> FailproofAI 为 AI 智能体提供 39 条内置故障策略，一次安装即可捕获循环、密钥泄露、破坏性工具调用等问题。

[![npm weekly downloads](https://img.shields.io/npm/dw/failproofai?style=flat-square\&color=2ea44f)](https://www.npmjs.com/package/failproofai)

用于 **AI 故障处理**、**错误恢复**和 **LLM 可靠性**的 Hooks 与策略。让你的 AI 智能体在 **Claude Code**、**OpenAI Codex**、**GitHub Copilot**、**Cursor Agent**、**OpenCode**、**Pi**、**Gemini CLI** 以及 **Agents SDK** 上稳定运行、自主执行任务。

AI 智能体的失败方式往往是可预测的：执行破坏性命令、泄露密钥、偏离任务、陷入循环，或直接推送到主分支。如果不加干预，小故障会逐步演变成服务中断、凭证泄露和数据丢失。

FailproofAI 通过**策略**来解决这些问题。这些规则会介入智能体的每一次工具调用，**检测故障**、**进行缓解**（阻止、指令纠正、信息脱敏），并在需要关注时**及时提醒你**。本地仪表板让你可以事后回溯每一次工具调用、智能体故障和恢复操作。

所有数据均不离开你的本机。

## 快速上手

<CardGroup cols={2}>
  <Card title="39 条内置策略" icon="shield" href="/zh/built-in-policies">
    开箱即用：阻止破坏性命令、防止密钥泄露、将智能体限制在项目边界内，以及更多功能。
  </Card>

  <Card title="自定义策略" icon="code" href="/zh/custom-policies">
    使用 JavaScript 编写自己的规则，支持简洁的 allow / deny / instruct API。
  </Card>

  <Card title="智能体监控" icon="chart-line" href="/zh/dashboard">
    查看智能体在你离开期间做了什么。浏览会话记录、检查工具调用、回顾策略触发情况。
  </Card>

  <Card title="便捷配置" icon="gear" href="/zh/configuration">
    无需编写代码即可调整任何策略。按项目或全局设置白名单、受保护分支或触发阈值。
  </Card>
</CardGroup>

## 快速安装

<CodeGroup>
  ```bash npm theme={null}
  npm install -g failproofai
  ```

  ```bash bun theme={null}
  bun add -g failproofai
  ```
</CodeGroup>

```bash theme={null}
failproofai policies --install   # enable policies (or skip — `failproofai` will offer to set them up on first run)
failproofai                      # launch the dashboard
```

完整操作流程请参阅[快速入门](/zh/getting-started)指南。
