failproofai
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseFailproofAI
FailproofAI
Observability and enforcement for every harness your agents run in — coding CLIs, chat
gateways, self-hosted assistants, and your own instrumented agents.
Session → Audit → Finding → Issue → Policy
what happened is it a pattern what broke who owns it stop it recurringThis is the single umbrella for the whole product. It orients, explains every vertical,
sets a machine up, moves data, operates the fleet, and carries enough reference material to
work alone. When focused sibling skills are installed, route to them for a smaller context.
Source pointers are grep anchors inside the package —
in an installed project, the repo root in a checkout. They survive refactors; line numbers
do not.
failproofainode_modules/failproofai/为 Agent 运行于其上的每个 harness 提供可观测性与强制执行能力——编程 CLI、聊天网关、自托管助手,以及你自己完成插桩的 Agent。
Session → Audit → Finding → Issue → Policy
发生了什么 是否构成模式 出了什么问题 谁负责 阻止再次发生这是面向整个产品的唯一总入口。它负责提供整体视角、解释每个垂直领域、配置机器、迁移数据、运维 fleet,并包含足够的参考资料,可独立完成工作。安装了聚焦特定场景的 sibling skill 时,应将任务路由过去,以缩小上下文。
源码定位点是 包内可通过 grep 查找的锚点——在已安装项目中位于 ,在代码检出(checkout)中位于仓库根目录。它们能够承受重构;行号不能。
failproofainode_modules/failproofai/The one thing that will confuse you
最容易令人困惑的一点
FailproofAI is one product with two halves, and each half has its own binary. Almost
every early mistake is a category error between them.
| Local | FailproofAI Cloud | |
|---|---|---|
| Binary | | |
| Install | | |
| Does | hooks, policies, enforcement, capture, machine enrollment | query sessions, audits, issues, alerts, keys, orgs; publish, deploy and roll back policy |
| Needs an account | no — works fully offline | yes |
| Config | | |
Never write . is the Python module; the distribution is
. The module name installs nothing.
uv tool install fp-clifp_clifp-cloud-cliSeparate packages and separate auth — but not separate config trees any more. The cloud
CLI's session file moved inside the local home, so existing tells you
nothing about whether you are signed in to the cloud, and being signed in tells you nothing
about whether the local half is set up. Check each with its own command. (
and are read once for adoption and never written.)
~/.failproofai/~/.fp/cli.json$FP_HOME/cli.jsonA machine can run the local half forever without ever connecting to the cloud, and that is a
legitimate end state — do not treat "not connected" as a broken install.
FailproofAI 是一个包含两半的产品,而每一半都有自己的 binary。 早期几乎所有错误,都是把两者混为一谈所导致的类别错误。
| 本地 | FailproofAI Cloud | |
|---|---|---|
| Binary | | |
| 安装 | | |
| 功能 | hook、Policy、强制执行、采集、机器注册 | 查询 session、审计、issue、告警、key、org;发布、部署及回滚 Policy |
| 是否需要账号 | 否——可完全离线运行 | 是 |
| 配置 | | |
绝不要执行 。 是 Python module;发行包名称是 。module 名称不会安装任何东西。
uv tool install fp-clifp_clifp-cloud-cli二者使用不同的包和不同的认证方式,但现在已不再使用彼此独立的配置目录树。Cloud CLI 的 session 文件已移至本地 home 内部,因此, 存在并不能说明是否已登录 Cloud,而已登录 Cloud 也不能说明本地部分是否配置完成。必须分别使用各自的命令进行检查。( 和 仅在迁移时读取一次,之后不会再被写入。)
~/.failproofai/~/.fp/cli.json$FP_HOME/cli.json机器可以永远只运行本地部分,而从不连接 Cloud;这是一种合法且受支持的最终状态——不要将“未连接”视为安装损坏。
The cloud half was called AgentEye
Cloud 部分过去名为 AgentEye
It is now FailproofAI Cloud. Use that name; never introduce "AgentEye" yourself. But
recognise it, because the old name is still load-bearing in places a rename cannot cheaply
reach, and an agent that meets one of these needs to know it is the same product:
| Still says AgentEye | What it is |
|---|---|
| the wire and the session. |
| the local daemon's legacy SDK spool, which it still watches |
| ingest credentials. |
| self-hosted infrastructure |
dist | the RETIRED v1 evaluator package. Scoring is Evaluator v2 now: author a hosted evaluation in the dashboard, or run a worker on the SDK ( |
| retired grants and arguments the server still parses |
The env prefix follows the binary. reads , , ,
, , , (plus ) and
zero variables. Legacy reads ,
, . Note the dropped infix: it is and
, not / — a mechanical → rewrite
produces names nothing reads. is read by neither CLI. And
in the SDK install doc is an invented name for a GitHub PAT, defined by no
artifact — it must not become .
fpFP_HOMEFP_JSONFP_TOKENFP_API_KEYFP_ORGFP_DASHBOARD_URLFP_INSECUREFAILPROOFAI_HOMEAGENTEYE_*agenteyeAGENTEYE_HOMEAGENTEYE_CLI_TOKENAGENTEYE_CLI_JSONFP_TOKENFP_JSONFP_CLI_TOKENFP_CLI_JSONAGENTEYE_FP_AGENTEYE_ENVIRONMENTAGENTEYE_TOKENFP_TOKENWhat never modernises is the other half of that rule: headers, the cookie, registry paths,
namespaces and the daemon's own spool. Rename an env var when the binary
changed; never rename a literal something on the wire still reads.
AGENTEYE_HOMETwo binaries can be on PATH, and wins. Resolve it once, at the start:
fpbash
command -v fp agenteye # fp first — prefer it whenever both resolveLegacy (0.1.13) has no , , or at all, so a
missing command there means "wrong binary", not "not shipped".
agenteyepoliciesfleetguardrailsusage"Audit" is also two unrelated things — see Audits: pick the right one. Getting that
fork wrong wastes the most time of anything in this product.
它现在名为 FailproofAI Cloud。请使用该名称,不要自行引入“AgentEye”。但仍需识别旧名称,因为在无法低成本完成重命名的位置,旧名称仍然发挥关键作用。如果 Agent 遇到以下内容,需要知道它们指向同一个产品:
| 仍显示 AgentEye 的内容 | 含义 |
|---|---|
| 网络传输层与会话。 |
| 本地 daemon 的旧版 SDK spool,daemon 仍会监视它 |
| ingest 凭据。 |
| 自托管基础设施 |
dist | 已淘汰的 v1 evaluator 包。评分现已使用 Evaluator v2:在 dashboard 中编写托管评估,或在 SDK 上运行 worker( |
| 已淘汰的授权和参数,但服务端仍会解析 |
环境变量前缀取决于 binary。 读取 、、、、、、(以及 ),并且完全不读取任何 变量。旧版 读取 、、。注意中间部分已被删除:现在是 和 ,而不是 /——机械地将 替换为 会生成无人读取的名称。两个 CLI 都不读取 。SDK 安装文档中的 是为 GitHub PAT 杜撰的名称,没有任何 artifact 对它作出定义——绝不能将其改为 。
fpFP_HOMEFP_JSONFP_TOKENFP_API_KEYFP_ORGFP_DASHBOARD_URLFP_INSECUREFAILPROOFAI_HOMEAGENTEYE_*agenteyeAGENTEYE_HOMEAGENTEYE_CLI_TOKENAGENTEYE_CLI_JSONFP_TOKENFP_JSONFP_CLI_TOKENFP_CLI_JSONAGENTEYE_FP_AGENTEYE_ENVIRONMENTAGENTEYE_TOKENFP_TOKEN但规则的另一半永远不会改变:headers、cookie、registry paths、namespaces,以及 daemon 自己的 spool。binary 改变时可以重命名环境变量;但绝不要重命名网络传输层仍会读取的字面量。
AGENTEYE_HOME两个 binary 可能同时位于 PATH 上,而 优先。 开始时只解析一次:
fpbash
command -v fp agenteye # fp first — prefer it whenever both resolve旧版 (0.1.13)完全没有 、、 或 ,因此命令缺失表示“binary 用错了”,而不是“该功能未提供”。
agenteyepoliciesfleetguardrailsusage“Audit”也指两件互不相关的事——参见审计:选择正确的审计方式。选错分支是本产品中最浪费时间的问题。
Route first
先进行路由
Read this before doing any work. Two of the specialists — and
— are mirrors, synced from a private repo and marked do-not-hand-edit; duplicating or patching
them here is a maintenance bug. is a mirror too, and answers the
question the retired skill used to: what is worth measuring. It stops at
the proposal — the dashboard's eval authoring page composes, backtests and deploys the
evaluation itself, so nothing here scaffolds an evaluator service any more.
fp-cloud-clifailproofai-sdkfailproofai-eval-brainstormagenteye-evaluator| The request is | Go to |
|---|---|
| Stop a behaviour — "agents keep force-pushing", turn audit findings into enforcement, make a CLAUDE.md real, write/enable a policy | |
| Publish tested policies as a GitHub pack others can install | |
| Publish a Cloud policy version, deploy it to fleet machines, observe, enforce, or roll back | |
| Query FailproofAI Cloud — browse sessions, events, errors, evals; triage issues/alerts; manage keys, users, roles, settings | |
| Decide what to score — which dimensions are worth tracking, grounded in real sessions | |
| Instrument an agent that is not one of the 12 supported CLIs — Python or TypeScript/JavaScript, on a framework (LangChain/LangGraph, CrewAI, LlamaIndex, Pydantic AI, Vercel AI SDK, Mastra) or hand-built | |
| Run your own evaluator worker (the eval pod) — LLM judges or checks on your own infra, in Python or TypeScript | |
| Every surface at once — product architecture, commands, terminology, setup, and skill selection | stay here |
| Anything local-machine: install, connect, daemon, backfill, flush, capture paths, upgrade, uninstall | stay here |
| Keys and org concepts, self-hosting, "what is X" | stay here |
Two routes run the other way:
- Policy work on an unset-up machine. A policy cannot be enforced without an installed
CLI and (for cloud policy) a daemon. Do Set up a machine first, then hand off. The one
exception is , which needs nothing but
fp policies teston PATH.node - "My SDK events never appear in the dashboard." Split by evidence, not symptom. Verify
the delivery half here (, then
config --status) before sending them toflush --wait— the bug is usually delivery, not instrumentation.failproofai-sdk
If a specialist skill is not installed, do the job here — carries a compact
version of each. Say which specialist would have done it better and how to install it:
references/bash
npx skills add FailproofAI/skills --skill failproofai-policy-author执行任何工作前请先阅读本节。两个 specialist—— 和 ——是 mirror,内容从私有仓库同步并标记为禁止手动编辑;在此复制或修补它们属于维护缺陷。 同样是 mirror,它回答已淘汰的 skill 曾经处理的问题:什么值得衡量。它只负责提出方案;dashboard 的 eval 编写页面会自行组合、回测和部署评估,因此这里不再为 evaluator service 生成脚手架。
fp-cloud-clifailproofai-sdkfailproofai-eval-brainstormagenteye-evaluator| 请求类型 | 去哪里 |
|---|---|
| 阻止某种行为——“Agent 持续 force-push”、将审计发现转化为强制执行、让 CLAUDE.md 真正生效、编写或启用 Policy | |
| 将经过测试的 Policy 发布为可供他人安装的 GitHub pack | |
| 发布 Cloud Policy 版本、将其部署到 fleet 机器、观察、执行或回滚 | |
| 查询 FailproofAI Cloud——浏览 session、event、error、eval;对 issue/告警进行分类处理;管理 key、用户、角色和设置 | |
| 决定需要评分的内容——哪些维度值得跟踪,并以真实 session 为依据 | |
| 为不属于 12 个受支持 CLI 的 Agent 插桩——使用 Python 或 TypeScript/JavaScript,基于框架(LangChain/LangGraph、CrewAI、LlamaIndex、Pydantic AI、Vercel AI SDK、Mastra)或自行构建 | |
| 运行自己的 evaluator worker(eval pod)——在自己的基础设施上使用 Python 或 TypeScript 执行 LLM judge 或检查 | |
| 同时覆盖所有入口——产品架构、命令、术语、安装和 skill 选择 | 留在本 skill |
| 任何本机操作——安装、连接、daemon、回填、刷新、采集路径、升级、卸载 | 留在本 skill |
| key 和 org 的概念、自托管、“X 是什么” | 留在本 skill |
另有两类路由方向相反:
- 在尚未配置的机器上进行 Policy 工作。 没有安装 CLI,就无法执行 Policy;对于 Cloud Policy,还需要 daemon。请先执行从零配置机器,然后再移交给对应 skill。唯一的例外是 ,它只要求 PATH 中存在
fp policies test。node - “我的 SDK event 从未出现在 dashboard 中。” 应根据证据而非症状拆分问题。先在这里验证交付部分(,然后
config --status),再转交flush --wait——问题通常出在交付,而不是插桩。failproofai-sdk
如果未安装某个 specialist skill,则在这里完成工作—— 包含每个 specialist 的精简版本。请说明哪个 specialist 本来会处理得更好,以及如何安装:
references/bash
npx skills add FailproofAI/skills --skill failproofai-policy-authorEstablish state before you act
行动前先确认状态
Never advise from assumption. Five commands, in this order, cost seconds:
bash
command -v failproofai fp agenteye # which halves exist at all
failproofai config --status # cloud rows, daemon, layout/version, pause state
failproofai policies # what is enabled, and in which scope
fp --json whoami # cloud session — read .logged_in, not the exit code
command -v claude codex copilot cursor-agent opencode pi hermes openclaw droid devin agy goosefp whoami{"logged_in": false, "auth_mode": "none"}config --status| Row says | Means |
|---|---|
| the key stopped being accepted after connecting. Nothing is arriving. Reconnect |
| policy connected, ingest absent | an |
daemon | enforcement is failing closed — see Troubleshoot |
| paused | enforcement suspended, max 8h, one session only |
config --status绝不要基于假设提供建议。按以下顺序执行五个命令只需几秒:
bash
command -v failproofai fp agenteye # which halves exist at all
failproofai config --status # cloud rows, daemon, layout/version, pause state
failproofai policies # what is enabled, and in which scope
fp --json whoami # cloud session — read .logged_in, not the exit code
command -v claude codex copilot cursor-agent opencode pi hermes openclaw droid devin agy goose无论是否已登录, 都会以 0 退出;未登录时输出 。应根据字段分支处理。任何要求将非零退出码视为“未登录”的指令都是错误的,会错误报告一台健康的机器。
fp whoami{"logged_in": false, "auth_mode": "none"}config --status| 输出行 | 含义 |
|---|---|
| key 在连接后不再被接受。数据没有到达。重新连接 |
| Policy 已连接,但 ingest 缺失 | key 仅包含 |
daemon 为 | 强制执行正在fail closed——参见故障排查 |
| paused | 强制执行已暂停,最长 8 小时,且仅限一个 session |
当 自己的“connected”行与交付健康状况结论冲突时,应信任 rejection 行,而不是 connection 行。
config --statusSet up a machine from zero
从零配置机器
State the fork before running anything, because it decides whether you need sudo:
- Local only — hooks and policies on this machine, nothing leaves it, no account. Never
run . This is a complete, supported setup.
--connect - Cloud connected — adds centrally-managed policy, session capture and the fleet view. Requires the daemon, which requires sudo.
bash
npm install -g failproofai # Node >= 20.9
failproofai config # the interactive wizardOnly the interactive wizard installs the daemon.
deliberately avoids sudo and merely warns. Without a daemon there is no policy pull, no
transcript capture and no delivery — so a -only machine looks configured and
ships nothing. This is the single most common broken setup.
failproofai configconfig --connect--connectThe wizard is six steps, and the two that matter most are the ones people forget:
daemon (step 0, takes sudo, runs before any hook config is touched so a failure leaves the
machine untouched) and scope. It needs a TTY — see Running these as an agent.
references/setup.md运行任何操作前先明确选择哪个分支,因为它决定是否需要 sudo:
- 仅本地——hook 和 Policy 仅位于本机,数据不会离开本机,也不需要账号。绝不要运行 。这是完整且受支持的配置方式。
--connect - 连接 Cloud——增加集中管理的 Policy、session 采集和 fleet 视图。需要 daemon,而 daemon 需要 sudo。
bash
npm install -g failproofai # Node >= 20.9
failproofai config # the interactive wizard只有交互式 wizard 会安装 daemon。 有意避免使用 sudo,只会发出警告。没有 daemon,就不会拉取 Policy、采集 transcript 或交付数据;因此,仅执行 的机器看起来已经配置完成,却不会发送任何数据。这是最常见的错误配置。
failproofai configconfig --connect--connectwizard 共有六个步骤,其中最容易遗漏的是 daemon(步骤 0,需要 sudo,并且会在修改任何 hook 配置之前运行,因此失败时机器不会受到影响)和 scope。它需要 TTY——参见以 Agent 身份运行这些工具。
references/setup.mdVerify it, do not assume it
进行验证,不要想当然
bash
failproofai config --status # daemon running? both credentials present?
failproofai policies # hooks installed for the CLIs you expect?Then make one real tool call in the target agent CLI and confirm a decision appears in the
local dashboard's Policies → Activity log (, port 8020). An install that has
never evaluated a single event is not a verified install.
failproofaibash
failproofai config --status # daemon running? both credentials present?
failproofai policies # hooks installed for the CLIs you expect?然后在目标 Agent CLI 中发起一次真实工具调用,并确认本地 dashboard(,端口 8020)的 Policies → Activity log 中出现相应 decision。从未评估过任何 event 的安装不算验证成功。
failproofaiConnect to the cloud and prove both halves
连接 Cloud 并验证两部分
One URL and one token configure two independent capabilities:
| Capability | Permission | Verified against | Written to |
|---|---|---|---|
| Pull managed policy | | | |
| Push events/transcripts | | empty | collector block + ingest credential |
bash
failproofai config --connect https://app.befailproof.ai --token "<one-time-secret>"Each half is probed before anything is written, and only what verified is written. So a
partial success is normal and is reported per-half.
Four traps here, all of which have bitten people:
- The exit code tracks only the policy half. An -only key writes a working ingest credential and still exits 1. Never
events:add-chain on this command — read the output.&& - Transcripts are sent by default. limits to hook decisions. It is matched by exact string, and the
--no-transcriptsbranch validates no unknown flags — soconfig,--no-transcript, any typo, is silently ignored and full transcripts (prompts, file contents) ship. Confirm with--notranscripts, not with the exit code.config --status - The machine id does not default to the hostname, despite what says. It is an explicit
config --help, else the one already on disk, else a random UUID. The hostname is only the mutable label. Passing--machine-idon several machines silently merges them into one.--machine-id "$(hostname)" - Use a scoped key, not an admin key. +
events:addis the whole requirement. The secret is shown exactly once.policies:pull
一个 URL 和一个 token 会配置两项彼此独立的能力:
| 能力 | 权限 | 验证方式 | 写入位置 |
|---|---|---|---|
| 拉取托管 Policy | | | |
| 推送 event/transcript | | 空的 | collector 配置块 + ingest 凭据 |
bash
failproofai config --connect https://app.befailproof.ai --token "<one-time-secret>"写入任何内容之前,会分别探测两部分,并且只写入验证通过的部分。因此,部分成功属于正常情况,系统会按部分分别报告。
这里有四个陷阱,曾让许多人栽跟头:
- 退出码只跟踪 Policy 部分。 仅含 的 key 会写入可用的 ingest 凭据,同时仍以 1 退出。绝不要用
events:add串联此命令——应读取输出。&& - 默认发送 transcript。 会将范围限制为 hook decision。该选项通过精确字符串匹配,而
--no-transcripts分支不验证任何未知 flag——因此,config、--no-transcript或任何拼写错误都会被静默忽略,并继续发送完整 transcript(prompt、文件内容)。请通过--notranscripts确认,而不是依赖退出码。config --status - machine id 默认不会使用 hostname,尽管 如此说明。它的取值依次为:显式指定的
config --help、磁盘上已有的值、随机 UUID。hostname 只是可变的标签。在多台机器上传入--machine-id会将它们静默合并为同一台机器。--machine-id "$(hostname)\" - 使用 scoped key,而不是 admin key。 +
events:add已覆盖全部需求。secret 只显示一次。policies:pull
Bring in existing history
导入现有历史数据
This is the "transfer" surface. Four commands, each for a different situation:
| Situation | Command |
|---|---|
| Connected later than the work happened; dashboard cleared; machine re-enrolled | |
| Spooled batches not shipped yet; want them now | |
| Sessions live somewhere the collector does not watch (second profile, team share, container home) | |
| Upgraded npm but the daemon/layout is behind | |
bash
failproofai backfill --since 7d --dry-run # always preview first
failproofai backfill --since 7d这是“传输”操作入口。四个命令分别适用于不同情况:
| 情况 | 命令 |
|---|---|
| 连接时间晚于工作发生时间;dashboard 已清空;机器重新注册 | |
| spool 中仍有批次未发送,希望立即发送 | |
| session 位于 collector 未监视的位置(第二个 profile、团队共享目录、容器 home) | |
| 已升级 npm,但 daemon 或布局仍为旧版 | |
bash
failproofai backfill --since 7d --dry-run # always preview first
failproofai backfill --since 7dwait for the daemon's next tick before flushing — see below
wait for the daemon's next tick before flushing — see below
failproofai flush --wait
**`backfill` then `flush --wait` back to back is a race that reports success while nothing
shipped.** `backfill` only writes a *request file* that the daemon drains on its next tick;
`flush` exits 0 with "Nothing spooled" the instant the spool is empty. Run `backfill`, wait
for the collector to actually re-read (watch `config --status`), then `flush`.
The collector will not re-read a file it already holds a cursor for — that is exactly what
`backfill` exists to override. `--since` takes `30d`, `6m`, or `YYYY-MM-DD`; default 30 days.
`references/transfer.md` covers re-enrolling into a different org, keeping vs resetting the
machine id, and moving capture paths.failproofai flush --wait
**连续执行 `backfill` 和 `flush --wait` 会产生竞态:命令报告成功,但实际上没有发送任何数据。** `backfill` 只写入一个*请求文件*,daemon 会在下一个 tick 中处理它;而 spool 一旦为空,`flush` 就会立即以 0 退出并显示“Nothing spooled”。应先运行 `backfill`,等待 collector 实际重新读取文件(观察 `config --status`),然后再执行 `flush`。
collector 不会重新读取已持有 cursor 的文件——这正是 `backfill` 所要覆盖的场景。`--since` 接受 `30d`、`6m` 或 `YYYY-MM-DD`;默认值为 30 天。
`references/transfer.md` 介绍重新注册到其他 org、保留或重置 machine id,以及迁移采集路径。Install hooks and policies across the 12 agent CLIs
在 12 个 Agent CLI 中安装 hook 和 Policy
bash
failproofai policies --install --cli claude --scope user
failproofai policies add block-rm-rfSupported: , , , , , , , ,
(binary ), , (binary ), .
claudecodexcopilotcursoropencodepihermesopenclawfactorydroiddevinantigravityagygooseFour things to get right:
- Scope is not just a location. writes a committable
--scope projectcommand with no machine-specific paths;npx -y failproofai/userwrite an absolute binary path. Hermes and OpenClaw are user-scope only — they have no project config at all.local - Bare with no policy names is interactive on a TTY (an arrow-key picker that will block an agent forever) and, off a TTY, silently installs only the 11 default-enabled builtins out of 39. Name the policies explicitly.
--install - Installs are additive. Repeated unions with what is already enabled; a second
--installadds another path. There is no "exactly these and nothing else" — use--customto subtract.--uninstall - Convention policies load by filename. Any file matching in
policies.{js,mjs,ts}(project) or.failproofai/policies/(user) auto-loads.~/.failproofai/policies/is skipped silently and enforces nothing; name itblock-force-push.mjs.block-force-push-policies.mjs
Enforcement is not uniform across the 12 harnesses. A only stops something where
that harness consumes the verdict — is the only event that blocks everywhere.
is observation-only on 10 of 12. has the matrix; for
authoring, owns it in depth.
denyPreToolUsePostToolUsereferences/harnesses.mdfailproofai-policy-authorOne builtin, , is always on and cannot be disabled — it
bypasses the enabled set entirely, including during a pause and when the config fails to
parse. That is deliberate: it is what stops an agent disabling its own guardrails.
block-failproofai-commandsbash
failproofai policies --install --cli claude --scope user
failproofai policies add block-rm-rf支持:、、、、、、、、(binary 为 )、、(binary 为 )、。
claudecodexcopilotcursoropencodepihermesopenclawfactorydroiddevinantigravityagygoose有四件事必须处理正确:
- Scope 不只是位置。 写入可提交到版本库的
--scope project命令,不包含机器专属路径;npx -y failproofai/user则写入 binary 的绝对路径。Hermes 和 OpenClaw 仅支持 user scope——它们完全没有项目配置。local - 在 TTY 上直接执行不带 Policy 名称的 会进入交互模式(方向键选择器会让 Agent 永久阻塞);在非 TTY 环境中,则会静默只安装 39 个内置 Policy 中默认启用的 11 个。应明确指定 Policy 名称。
--install - 安装是累加式的。 重复执行 会与已启用项取并集;第二次执行
--install会新增另一条路径。不存在“只启用这些且不启用其他任何项”的选项——需要移除时使用--custom。--uninstall - 约定 Policy 按文件名加载。 (项目)或
.failproofai/policies/(用户)中,任何匹配~/.failproofai/policies/的文件都会自动加载。policies.{js,mjs,ts}会被静默跳过,不会执行任何强制措施;应命名为block-force-push.mjs。block-force-push-policies.mjs
12 个 harness 的强制执行机制并不统一。 只有当某个 harness 会处理 verdict 时, 才能阻止相应行为—— 是唯一能在所有 harness 上阻止操作的事件。在 12 个 harness 中,有 10 个仅能通过 进行观察。 提供了矩阵;若需编写 Policy,则由 深入负责。
denyPreToolUsePostToolUsereferences/harnesses.mdfailproofai-policy-author内置 Policy 始终启用且无法禁用——它会绕过启用集合,包括暂停期间以及配置解析失败时。这是有意设计的:它用于阻止 Agent 禁用自己的 guardrail。
block-failproofai-commandsAudits: pick the right one
审计:选择正确的审计方式
This fork is unavoidable and is the most common source of wasted effort.
| Local audit | Cloud audit | |
|---|---|---|
| Command | | dashboard, or |
| Scans | this machine's own agent history, offline | sessions already delivered to the cloud |
| Account | not needed | required |
| Scheduling | | server-side cadence |
| Output | localhost:8020 dashboard + a JSON cache | findings → issues in the dashboard |
failproofai audit--help-h--status--schedule [days]--no-schedule--email=--scheduled--since--cli--json--portfailproofai auditbash
timeout 180 failproofai audit >/dev/null 2>&1 || true # exits 124; cache is written
cat ~/.failproofai/audit/dashboard.json # layout 4 pathTurning findings into enforcement is 's job — it reads that same
cache. Send them there rather than hand-writing policies here.
failproofai-policy-author这个分支无法回避,也是最常导致效率损失的问题。
| 本地审计 | Cloud 审计 | |
|---|---|---|
| 命令 | | dashboard,或 |
| 扫描范围 | 离线扫描本机自身的 Agent 历史 | 已交付至 Cloud 的 session |
| 账号 | 不需要 | 需要 |
| 调度 | | 服务端周期执行 |
| 输出 | localhost:8020 dashboard + JSON 缓存 | dashboard 中形成 finding → issue |
failproofai audit--help-h--status--schedule [days]--no-schedule--email=--scheduled--since--cli--json--portfailproofai auditbash
timeout 180 failproofai audit >/dev/null 2>&1 || true # exits 124; cache is written
cat ~/.failproofai/audit/dashboard.json # layout 4 path将 finding 转化为强制执行是 的职责——它会读取同一份缓存。请将任务交给它,而不要在这里手动编写 Policy。
failproofai-policy-authorRead sessions and traces
阅读 session 和 trace
A trace is the ordered, nested view of one session. The documented investigation order:
- Confirm the goal and the environment the run actually had.
- Find the first divergence, not the last error — the last error is usually a symptom.
- Inspect the model context and the tool input immediately before it.
- Check retries, latency, human interventions and policy decisions around that point.
Most of this surface is the dashboard. The queryable slice is the cloud CLI — hand off to
for anything beyond a one-shot setup verification.
has the event kinds and what is CLI-reachable versus dashboard-only.
fp-cloud-clireferences/sessions.mdtrace 是单个 session 的有序嵌套视图。推荐的排查顺序如下:
- 确认该次运行实际具有的目标和环境。
- 找出首次偏离点,而不是最后一个错误——最后一个错误通常只是症状。
- 检查紧邻该位置之前的模型上下文和工具输入。
- 检查该位置附近的 retry、延迟、人工干预和 Policy decision。
此操作入口主要位于 dashboard。可查询的部分由 Cloud CLI 提供——除一次性安装验证外,其余任务应移交给 。 介绍了 event 类型,以及哪些内容可通过 CLI 获取、哪些只能在 dashboard 中查看。
fp-cloud-clireferences/sessions.mdPrevent: observe → enforce → roll back
预防:观察 → 执行 → 回滚
The rollout the product actually supports, and every step of it is CLI-drivable — no
dashboard required:
| Step | Command |
|---|---|
| 1. Prove the policy decides correctly, offline | |
| 2. Publish an immutable version | |
| 3. Deploy it pinned, in observe, to one machine | |
| 4. Run a real session, then read what it would have done | |
| 5. Promote that one machine to enforce, then expand | |
| 6. Roll back | |
Three things that bite before you get through it:
- deploys nothing. It mints a new version, never edits one in place, and that version sits unused until a
fp policies publishnames it. Publishing and shipping are separate acts.fleet deploy - A bare on a new policy enforces it.
--addis not the default — omitting the effect is how a first deploy goes straight to enforcement on a live machine. Always write the effect. Effects are exactly:observeandenforce.observe - Every /
policies/fleetsubcommand exceptguardrailsexits 2 under an API key. This rollout is a human-session operation; CI cannot drive it.policies test
Step 1 needs no server, no auth, no fleet and nothing installed in the working directory —
the CLI shims the module itself. It wants only on PATH:
failproofainodebash
fp policies test ./rule.mjs --command "git push --force origin main"以下是产品实际支持的 rollout 流程,每一步均可通过 CLI 完成,不需要 dashboard:
| 步骤 | 命令 |
|---|---|
| 1. 离线证明 Policy 能正确作出 decision | |
| 2. 发布不可变版本 | |
| 3. 将其固定版本部署到一台机器,并设为 observe 模式 | |
| 4. 运行一次真实 session,然后读取其原本会执行的操作 | |
| 5. 将该机器提升为 enforce,然后再扩大范围 | |
| 6. 回滚 | |
有三个问题会在完成流程前造成阻碍:
- 不会部署任何内容。 它只生成新版本,绝不会原地修改已有版本;除非
fp policies publish明确引用该版本,否则它会一直闲置。发布和交付是两个独立操作。fleet deploy - 对新 Policy 直接使用 会立即执行它。
--add并不是默认值——省略 effect 会导致首次部署直接对运行中的机器执行强制措施。务必明确写出 effect。effect 只能是:observe和enforce。observe - 除 外,所有
policies test/policies/fleet子命令在 API key 下都会以 2 退出。 此 rollout 必须由人类会话操作;CI 无法驱动。guardrails
步骤 1 不需要 server、认证、fleet,也不需要在工作目录中安装任何内容——CLI 会对 module 本身进行 shim。它只要求 PATH 中存在 :
failproofainodebash
fp policies test ./rule.mjs --command "git push --force origin main"{"ok":true,"decision":"deny","policies":[{"name":"no-force-push","decision":"deny",…}]}
{"ok":true,"decision":"deny","policies":[{"name":"no-force-push","decision":"deny",…}]}
State its limit honestly: that proves the policy parses, registers and decides for the input
you handed it. It cannot prove the daemon feeds it the same context on a real machine. Only
step 4 shows that.
`fp-cloud-cli` owns this in depth — the `id@v:effect` ref grammar, `--set` versus
`--add`, the concurrency guard, and why `disable` stops enforcement while `delete` does not.
应如实说明其局限:这只能证明 Policy 能够解析、注册,并针对传入输入作出 decision。它无法证明真实机器上的 daemon 会提供完全相同的上下文。只有步骤 4 能够证明这一点。
`fp-cloud-cli` 会深入处理相关内容——包括 `id@v:effect` 引用语法、`--set` 与 `--add` 的区别、并发保护,以及为什么 `disable` 会停止强制执行而 `delete` 不会。Operate the fleet and the organization
运维 fleet 和组织
Admin → enforcement shows assigned versus reported deployment plus last check-in, and
/ show the same split from the terminal. The two
diverging is the signal: a machine that never pulled, or stopped reporting.
fp fleet listfp fleet diff <machine-id>Permissions are flat tokens (, , ).
Presets / / seed grants. Two rules worth carrying:
resource:actionevents:addpolicies:pullaudits:writeread-onlystandardadmin- and
keys:updateare human-only and must never sit on an API key — an "admin" key is deliberately weaker than an admin user.orgs:admin - The server widens grants at auth time (also carries
alerts:read), but the dashboard and CLI display the stored grant. Stored ≠ effective.issues:read
Depth is in ; live key/user/org operations belong to .
references/cloud.mdfp-cloud-cliAdmin → enforcement 会显示 assigned 部署与 reported 部署的差异,以及最后一次 check-in; / 也会在终端中显示同样的区分。两者不一致就是信号:某台机器可能从未拉取配置,或已停止上报。
fp fleet listfp fleet diff <machine-id>权限采用扁平的 token(、、)。预设 / / 用于初始化授权。有两条规则值得记住:
resource:actionevents:addpolicies:pullaudits:writeread-onlystandardadmin- 和
keys:update仅限人类使用,绝不能放在 API key 上——这里的“admin” key 被有意限定为弱于 admin user。orgs:admin - 服务端在认证时会扩大授权范围(同时包含
alerts:read),但 dashboard 和 CLI 显示的是已存储的授权。已存储 ≠ 实际生效。issues:read
深度内容位于 ;涉及实时 key、用户和 org 的操作应交给 。
references/cloud.mdfp-cloud-cliTroubleshoot by symptom
按症状排查故障
| Symptom | First check | Usual cause |
|---|---|---|
| Nothing in the cloud dashboard | | no daemon (ran |
| Machine not receiving policies | | key lacks |
| Every tool call denied, on every CLI | | daemon unreachable or version-skewed → fail-closed |
| Custom policy does nothing | filename | must end |
| Sessions stop at a date | | cursor advanced before there was anywhere to send |
| ran it too soon after | the daemon tick had not run |
Fail-closed is deliberate. Once daemon configuration is recorded there is no silent
in-process fallback: an unreachable or protocol-skewed daemon denies everything, including
, so the user cannot even ask their agent what happened. Fix the daemon
(, or restart the unit); as a last resort set to
false in . Running any CLI command self-heals three provable
cases automatically.
UserPromptSubmitfailproofai updatedaemon.configured~/.failproofai/config.jsonWindows is unsupported for everything cloud- or capture-related — the daemon is
Linux/macOS only. refuses outright, but still stores credentials,
so a Windows machine can look connected and never ship anything.
flushconfig --connect| 症状 | 首先检查 | 常见原因 |
|---|---|---|
| Cloud dashboard 中没有任何内容 | | 没有 daemon(仅运行了 |
| 机器未收到 Policy | | key 缺少 |
| 所有 CLI 上的每次工具调用都被拒绝 | | daemon 无法访问或版本不一致 → fail closed |
| 自定义 Policy 无任何作用 | 文件名 | 必须以 |
| session 截止到某个日期后停止 | | cursor 在数据有可用去向之前就已推进 |
| 在 | daemon tick 尚未运行 |
Fail closed 是有意设计的。 一旦记录了 daemon 配置,就不会再静默回退到进程内处理:daemon 无法访问或协议版本不一致时,会拒绝所有操作,包括 ,因此用户甚至无法询问 Agent 发生了什么。请修复 daemon(执行 ,或重启 unit);作为最后手段,可将 中的 设置为 false。运行任何 CLI 命令都会自动修复三种可证明的情况。
UserPromptSubmitfailproofai update~/.failproofai/config.jsondaemon.configured所有与 Cloud 或采集相关的能力均不支持 Windows——daemon 仅支持 Linux/macOS。 会直接拒绝执行,但 仍会存储凭据,因此 Windows 机器可能显示已连接,却永远不会发送任何数据。
flushconfig --connectUpgrade, relocate, remove
升级、迁移位置和卸载
There is a version triad — npm CLI, daemon binary, layout — and they
move independently.
~/.failproofaibash
npm install -g failproofai@latest # replaces the CLI and NOTHING else
failproofai update # migrations + matching daemon binary + restartnpm i -g failproofai@latestfailproofai updatefailproofai migrate --dry-runbash
failproofai uninstall # hook entries from every CLI + the daemon service
failproofai uninstall --purge # also deletes ~/.failproofaiRun before — npm runs no uninstall script, so
removing the package alone leaves the hooks and the root-owned service behind.
removes the service without asking.
uninstallnpm rm -g failproofai--yes系统存在一个版本三元组——npm CLI、daemon binary、 布局——三者的版本会独立变化。
~/.failproofaibash
npm install -g failproofai@latest # replaces the CLI and NOTHING else
failproofai update # migrations + matching daemon binary + restart在带 daemon 的机器上,单独执行 永远不够:旧 daemon binary 和旧布局会保留下来,机器会因版本不一致而进入 fail closed。始终应在之后执行 。使用 可单独查看布局迁移步骤。
npm i -g failproofai@latestfailproofai updatefailproofai migrate --dry-runbash
failproofai uninstall # hook entries from every CLI + the daemon service
failproofai uninstall --purge # also deletes ~/.failproofai必须在 之前运行 ——npm 不会运行 uninstall script,因此仅删除包会遗留 hook 和以 root 身份运行的服务。 会跳过确认并移除服务。
npm rm -g failproofaiuninstall--yesRunning these tools as an agent
以 Agent 身份运行这些工具
Collected here because getting one wrong wastes a turn or hangs the session:
- No . Every parser is hand-rolled and rejects the equals form. Across both binaries there are exactly four exceptions —
--flag=value,--cli=,--effect=and--out=. Everything else takes a space,--email=andpack --onlyincluded.--category - globals go before the command.
fpworks;fp --json sessionsis a usage error and exits 2. A command's own options come after it:fp sessions --json. The globals arefp --json keys create ci-bot.--json --base-url --org --token --api-key --insecure/--secure --timeout --quiet --no-color - Commands that never exit: (serves until Ctrl+C) and the bare
failproofai auditdashboard. Usefailproofai, or ask the user to run them.timeout - Commands that need a TTY: the wizard, and
failproofai configwith no policy names. Off a TTY the latter silently narrows to the 11 defaults.policies --install - Exit codes that lie: reports only the policy half;
config --connectexits 0 on an empty spool whether or not delivery works. Read stdout.flush --wait - Nothing here needs sudo except the daemon, and only the wizard and ask for it.
update - Never run ,
--connect,--disconnect, a user-scope install oruninstallon your own initiative. They change what the user's machines do everywhere — enrollment sends data off the machine, and a deploy can start denying tool calls on someone else's box. Propose the command; let them run it.fp fleet deploy
将相关事项集中放在这里,是因为其中任何一项处理错误都会浪费一次操作或导致 session 卡住:
- 不支持 。 每个 parser 都是手写的,并拒绝等号形式。两个 binary 一共只有四个例外——
--flag=value、--cli=、--effect=和--out=。其他所有 flag 都使用空格分隔,包括--email=和pack --only。--category - 的全局参数必须放在命令之前。
fp可以;fp --json sessions是用法错误,并以 2 退出。命令自身的选项应放在命令之后:fp sessions --json。全局参数为fp --json keys create ci-bot。--json --base-url --org --token --api-key --insecure/--secure --timeout --quiet --no-color - 永不退出的命令:(持续提供服务直到 Ctrl+C)和不带子命令的
failproofai auditdashboard。请使用failproofai,或让用户自行运行。timeout - 需要 TTY 的命令:wizard,以及不指定 Policy 名称的
failproofai config。在非 TTY 环境中,后者会静默缩减为 11 个默认项。policies --install - 会误导人的退出码:只报告 Policy 部分;
config --connect无论交付是否成功,只要 spool 为空就会以 0 退出。请读取 stdout。flush --wait - 除 daemon 外,这里没有任何操作需要 sudo,而且只有 wizard 和 会请求 sudo。
update - 绝不要擅自运行 、
--connect、--disconnect、user scope 安装或uninstall。这些操作会改变用户机器在所有位置的行为——注册会将数据发送出机器,而部署可能会开始拒绝其他机器上的工具调用。应提出命令建议,让用户自行执行。fp fleet deploy
References
参考资料
| Load when | File |
|---|---|
| "what is a finding / trace / deployment" — the nouns and the loop | |
| Installing, the wizard's six steps, connecting, provisioning without a TTY | |
| Backfill, flush, capture paths, re-enrolling, upgrade, uninstall | |
| The daemon: what it is, how it runs, how it fails, how to fix it | |
| Builtins, packs, local config files and merge order, scopes | |
| Which of the 12 harnesses enforces what, and where each config lives | |
| Local vs cloud audit, findings, issues, alerts, agent contracts | |
| Sessions, events, traces, queries, dashboards, the Assistant | |
| FailproofAI Cloud: CLI surface, HTTP API, keys and permissions, orgs, self-hosting | |
Every | |
| Symptom → check → cause → fix, in depth | |
| End-to-end setup across the local and Cloud halves | |
| Complete command catalog for both binaries | |
| Observe, enforce, evaluate, audit, and manage as product workflows | |
| Environment variables and configuration locations | |
| Legacy literals that must not be renamed | |
| Product terminology | |
| Every sibling skill, ownership boundary, and documentation map | |
| 需要加载的内容 | 文件 |
|---|---|
| “finding / trace / deployment 是什么”——相关名词及其闭环 | |
| 安装、wizard 的六个步骤、连接、无需 TTY 的配置方式 | |
| 回填、刷新、采集路径、重新注册、升级、卸载 | |
| daemon:它是什么、如何运行、如何失败、如何修复 | |
| 内置项、pack、本地配置文件、合并顺序和 scope | |
| 12 个 harness 中分别强制执行什么,以及配置位于何处 | |
| 本地与 Cloud 审计、finding、issue、告警、Agent 契约 | |
| session、event、trace、查询、dashboard、Assistant | |
| FailproofAI Cloud:CLI 接口、HTTP API、key 与权限、org、自托管 | |
所有 | |
| 深入理解“症状 → 检查 → 原因 → 修复” | |
| 本地与 Cloud 两部分的端到端配置 | |
| 两个 binary 的完整命令目录 | |
| 观察、执行、评估、审计,以及作为产品工作流进行管理 | |
| 环境变量和配置位置 | |
| 绝不能重命名的旧版字面量 | |
| 产品术语 | |
| 所有 sibling skill、职责边界和文档地图 | |