failproofai 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +13 -13
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/audit/invite/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/run/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/audit/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-request/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/login-verify/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/audit/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +14 -14
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__048f1wnr8pysf._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1oclamblhzhrf._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0tovk6q0miud6._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0trp3ycqv17cl._.js +1 -1
- package/.next/standalone/.next/server/chunks/_1vslkoe35wok6._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_01r25oigsgz07._.js +1 -1
- package/.next/standalone/.next/server/chunks/node_modules_posthog-node_dist_entrypoints_index_node_mjs_09z9-p77cu37y._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_1nxcc4vkpxxu7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__1xwr4hi-on27i._.js → [root-of-the-server]__05-glpesefmmi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08ch3staq3ejw._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bigvy9xmv2ka._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ezoipo-r7_5k._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h86bl2qf0k_o._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pia5h3p8re4c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1-ey9fgesfbc0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__15usvs-ms-0hf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__16gb3_92zvk5x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1avi2kypusyb_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1r7drlqli-ado._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1vxwetblyf8vp._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0eoura3_9gjb-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0p1cb69sml__f._.js → _0ge1hz9485xpp._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0pedwblqdoh58._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1_ozgifqv1ssi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1djqs9i27e4kg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_1v4_ul3sj2lq_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_next-internal_server_app_policies_page_actions_1sp2-yo5_vm5f.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_actions_get-scheduled-audit_ts_0ei9snixb5fd-._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_audit__components_audit-dashboard_tsx_0p9ud47q0xq5w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_1kp6l3x33jqb6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_19dqvpcz0uxur._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_settings_02tf1h47jmhhd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_html-to-image_es_index_0r9i9nq3-ei-l.js → node_modules_html-to-image_es_index_0e3yg5gbcfsai.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_0bz67659f5z-3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_next_dist_1khq67j4vo9y4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules_posthog-node_dist_entrypoints_index_node_mjs_11bnuznb72p7z._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/package_json_[json]_cjs_013tntikdft59._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +13 -13
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +23 -23
- package/.next/standalone/.next/static/chunks/{3hk5y4kny2ktd.js → 05g1pu2r8o5q3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2zlfhyqvlvf7o.js → 098vx6twrn-vk.js} +1 -1
- package/.next/standalone/.next/static/chunks/0oxlfb02aqo3e.js +1 -0
- package/.next/standalone/.next/static/chunks/{110hwwc6agsr8.js → 0p14j2e6dnj1x.js} +1 -1
- package/.next/standalone/.next/static/chunks/12ys9uaq6i1h2.js +6 -0
- package/.next/standalone/.next/static/chunks/{435eshlryosz1.js → 1osrmi14e2jub.js} +1 -1
- package/.next/standalone/.next/static/chunks/2o8j51ujh1ox4.js +1 -0
- package/.next/standalone/.next/static/chunks/2zwsbp8xyfv__.js +1 -0
- package/.next/standalone/.next/static/chunks/{2wye36b3mbzpa.js → 34rjkinfk6d4p.js} +1 -1
- package/.next/standalone/.next/static/chunks/{2wh64znsc_mo2.js → 38lnk75xvqiug.js} +1 -1
- package/.next/standalone/.next/static/chunks/3d6_vjbvr0c2n.js +1 -0
- package/.next/standalone/assets/logos/failproof-dark.png +0 -0
- package/.next/standalone/assets/logos/failproof-light.png +0 -0
- package/.next/standalone/fp-cloud-cli/CHANGELOG.md +24 -3
- package/.next/standalone/fp-cloud-cli/fp_cli/_version.py +1 -1
- package/.next/standalone/fp-cloud-cli/uv.lock +6 -6
- package/.next/standalone/hermes-plugin/plugin.yaml +1 -1
- package/.next/standalone/node_modules/@next/env/package.json +1 -1
- package/.next/standalone/node_modules/next/dist/build/swc/index.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +1 -1
- package/.next/standalone/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
- package/.next/standalone/node_modules/next/dist/server/app-render/async-local-storage.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/base-http/node.js +7 -2
- package/.next/standalone/node_modules/next/dist/server/config.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
- package/.next/standalone/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/app-info-log.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/router-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/start-server.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/lib/trace/tracer.js +1 -1
- package/.next/standalone/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
- package/.next/standalone/node_modules/next/dist/telemetry/events/version.js +2 -2
- package/.next/standalone/node_modules/next/package.json +10 -10
- package/.next/standalone/package.json +10 -10
- package/.next/standalone/sdk/python/uv.lock +18 -18
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package-lock.json +40 -40
- package/.next/standalone/sdk/typescript/integration/fixtures/nextjs/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/README.md +174 -83
- package/dist/cli.mjs +11 -11
- package/dist/worker.mjs +1 -1
- package/hermes-plugin/plugin.yaml +1 -1
- package/openclaw-plugin/daemon-client.js +95 -26
- package/openclaw-plugin/hooks.js +4 -1
- package/package.json +10 -10
- package/.next/standalone/.next/static/chunks/107jrtkeylnrv.js +0 -6
- package/.next/standalone/.next/static/chunks/19e9khxgv8fb8.js +0 -1
- package/.next/standalone/.next/static/chunks/2codb6nb412m9.js +0 -1
- package/.next/standalone/.next/static/chunks/2maurwweshrsj.js +0 -1
- package/.next/standalone/.next/static/chunks/3v49ogp389dun.js +0 -1
- /package/.next/standalone/.next/static/{-iBiSmrLiylRKLAg77zlQ → -AugwIGiiIYcahO4J7mdM}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{-iBiSmrLiylRKLAg77zlQ → -AugwIGiiIYcahO4J7mdM}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{-iBiSmrLiylRKLAg77zlQ → -AugwIGiiIYcahO4J7mdM}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/logos/failproof-dark.png" />
|
|
5
|
+
<img src="assets/logos/failproof-light.png" alt="failproof ai" width="320" />
|
|
6
|
+
</picture>
|
|
4
7
|
|
|
5
8
|
<a href="https://trendshift.io/repositories/69722?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-69722" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/69722/daily?language=TypeScript" alt="FailproofAI%2Ffailproofai | Trendshift" width="250" height="55"/></a>
|
|
6
9
|
<a href="https://trendshift.io/repositories/69722?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-69722" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/69722/daily" alt="FailproofAI%2Ffailproofai | Trendshift" width="250" height="55"/></a>
|
|
@@ -15,11 +18,24 @@
|
|
|
15
18
|
|
|
16
19
|
**Translations:** [简体中文](./docs/i18n/README.zh.md) · [日本語](./docs/i18n/README.ja.md) · [한국어](./docs/i18n/README.ko.md) · [Español](./docs/i18n/README.es.md) · [Português](./docs/i18n/README.pt-br.md) · [Deutsch](./docs/i18n/README.de.md) · [Français](./docs/i18n/README.fr.md) · [Русский](./docs/i18n/README.ru.md) · [हिन्दी](./docs/i18n/README.hi.md) · [Türkçe](./docs/i18n/README.tr.md) · [Tiếng Việt](./docs/i18n/README.vi.md) · [Italiano](./docs/i18n/README.it.md) · [العربية](./docs/i18n/README.ar.md) · [עברית](./docs/i18n/README.he.md)
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
## Ship agents that never fail.
|
|
22
|
+
|
|
23
|
+
Your agent ran `rm -rf` on the wrong directory. It read `.env` into its context. It spent
|
|
24
|
+
forty minutes retrying the same broken call, then told you the task was done.
|
|
25
|
+
**Failproof lives in your agent's runtime and hears every hook event it fires**: the
|
|
26
|
+
session starting, every prompt, every tool call and its result, sub-agents spinning up,
|
|
27
|
+
context about to be compacted, the moment it tries to stop. **It can act on any of
|
|
28
|
+
them**: block the bad action before it executes, steer the agent mid-run, or send it
|
|
29
|
+
back to work when it quits too early. Then it learns from every failure, so your
|
|
30
|
+
agent's harness gets better with every run.
|
|
31
|
+
|
|
32
|
+
**37% → 69%** task success on failures a policy recognised. Same model, no fine-tuning
|
|
33
|
+
([FIRE study](https://befailproof.ai/research/runtime-policies/))<br />
|
|
34
|
+
**~0.7 ms** p50 per policy check, from a Rust daemon in the hot path<br />
|
|
35
|
+
**12 agent harnesses**, one policy API: Claude Code, Codex, Cursor, Hermes, OpenClaw and more
|
|
36
|
+
|
|
37
|
+
Open source and free to start. Install the CLI, connect Failproof Cloud, and your first
|
|
38
|
+
audit runs on your agents' real history.
|
|
23
39
|
|
|
24
40
|
</div>
|
|
25
41
|
|
|
@@ -31,16 +47,14 @@ tool calls before they execute. 40 built-in policies. Zero latency. Runs locally
|
|
|
31
47
|
|
|
32
48
|
## Supported harnesses
|
|
33
49
|
|
|
34
|
-
Twelve harnesses in two classes
|
|
35
|
-
gateways (Hermes, OpenClaw).
|
|
36
|
-
of them. What a policy can *block* is per-harness: stopping a tool call before
|
|
37
|
-
it runs is verified on all twelve, turn-end gates on eight. The
|
|
38
|
-
[per-harness matrix](https://docs.befailproof.ai/reference/harnesses#enforcement-capability)
|
|
39
|
-
lists the events each one honours.
|
|
50
|
+
Twelve harnesses in two classes: ten coding CLIs, and two chat and assistant
|
|
51
|
+
gateways (Hermes, OpenClaw).
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
Building your own agent, on any framework or none? Report its runs through the
|
|
54
|
+
[Python SDK](https://docs.befailproof.ai/reference/custom-agents) or the
|
|
55
|
+
[TypeScript SDK](https://docs.befailproof.ai/reference/custom-agents-typescript),
|
|
56
|
+
which give you tracing, sessions, evaluations and audits. Enforcement there needs a hook in
|
|
57
|
+
your own runtime. [Talk to us](mailto:support@befailproof.ai) and we'll map it.
|
|
44
58
|
|
|
45
59
|
<!-- A 6-column table instead of inline <img> runs: table columns never re-wrap,
|
|
46
60
|
so the grid stays 2×6 at any window width (scrolling on very narrow screens
|
|
@@ -136,55 +150,98 @@ your own runtime — [talk to us](mailto:support@befailproof.ai) and we'll map i
|
|
|
136
150
|
</tr>
|
|
137
151
|
</table>
|
|
138
152
|
|
|
139
|
-
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Get started: find where your agents fail, then stop it
|
|
140
156
|
|
|
141
157
|
```sh
|
|
142
158
|
npm install -g failproofai
|
|
143
|
-
failproofai config
|
|
144
|
-
failproofai
|
|
145
|
-
failproofai # dashboard on localhost:8020
|
|
159
|
+
failproofai config # hook your agents, connect to Failproof Cloud (free)
|
|
160
|
+
failproofai backfill --since 7d # bring in the last week of runs already on disk
|
|
146
161
|
```
|
|
147
162
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
with
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
1. **Connect.** `failproofai config` finds every agent on this machine, hooks into each
|
|
164
|
+
one, starts the background daemon, and signs you in to Failproof Cloud in your
|
|
165
|
+
browser. No account yet? Make one right there, on the free plan.
|
|
166
|
+
2. **Backfill.** Your agents have been running for weeks, and that history is already on
|
|
167
|
+
this machine. `failproofai backfill --since 7d` sends the last seven days
|
|
168
|
+
([for supported harnesses](https://docs.befailproof.ai/reference/failproof-cli#backfill-per-harness)),
|
|
169
|
+
so you start with real evidence instead of an empty dashboard.
|
|
170
|
+
3. **Audit.** The moment runs land, Cloud starts your first audit on its own. It reads
|
|
171
|
+
your sessions, clusters what went wrong into named failure modes, and turns each one
|
|
172
|
+
into an **insight**, with the sessions that prove it. The free plan includes audits
|
|
173
|
+
every month.
|
|
174
|
+
4. **Plug in policies built for your agents.** Open an insight and hit **prevent this →**.
|
|
175
|
+
Failproof drafts a policy for that exact failure and tests it against your agents' own
|
|
176
|
+
past tool calls. You then roll it out to every machine, watching first or enforcing
|
|
177
|
+
straight away.
|
|
178
|
+
|
|
179
|
+
Setting up CI, a container, or letting an agent run the install? `failproofai config`
|
|
180
|
+
notices there's no one to ask and applies the defaults without prompting.
|
|
159
181
|
|
|
160
182
|
---
|
|
161
183
|
|
|
162
|
-
##
|
|
184
|
+
## One policy, every harness
|
|
163
185
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
| `block-rm-rf` | Recursive file deletion |
|
|
172
|
-
| `block-force-push` / `block-push-master` | `git push --force`, direct pushes to `main` |
|
|
173
|
-
|
|
174
|
-
Every one of these gates the call *before* it runs, so they hold on all twelve
|
|
175
|
-
harnesses. The first four apply to any agent that can call a tool; the last
|
|
176
|
-
three are the developer favourites — coding CLIs are the harness class we cover
|
|
177
|
-
deepest. The `sanitize-*` family is separate: it runs after a tool returns, so
|
|
178
|
-
it reports a secret in tool output rather than keeping it out of the context.
|
|
179
|
-
|
|
180
|
-
→ [All 40 built-in policies](https://docs.befailproof.ai/policies/packs)
|
|
186
|
+
Every harness speaks its own dialect:
|
|
187
|
+
- Claude Code reads a JSON verdict, while Factory's droid only stops on exit code 2.
|
|
188
|
+
- Cursor forces another turn with a `followup_message`.
|
|
189
|
+
- OpenCode and OpenClaw have no shell hooks at all, only in-process plugins, and Hermes
|
|
190
|
+
loads a native Python plugin.
|
|
191
|
+
- Even the shell tool has six names: `Bash`, `terminal`, `Execute`, `shell`,
|
|
192
|
+
`run_command`, `exec`.
|
|
181
193
|
|
|
182
|
-
|
|
194
|
+
Failproof translates all of it:
|
|
195
|
+
- Every event maps onto one canonical set of 29 (`SessionStart`, `UserPromptSubmit`,
|
|
196
|
+
`PreToolUse`, `PostToolUse`, `SubagentStop`, `PreCompact`, `Stop`, …).
|
|
197
|
+
- Every tool name and argument maps onto one canonical form.
|
|
198
|
+
- Every verdict is translated back into the exact shape that harness obeys.
|
|
199
|
+
|
|
200
|
+
So a policy written once against `Bash` blocks the same command in Claude Code, Codex,
|
|
201
|
+
Hermes and Goose. A "run the tests before you stop" gate sends the agent back to work on
|
|
202
|
+
every harness that has a turn-end hook.
|
|
183
203
|
|
|
184
|
-
|
|
204
|
+
Each contract is verified against that CLI and pinned, with what it was verified on, in
|
|
205
|
+
a capability matrix the test suite checks every claim against. Blocking before a tool runs is verified on all twelve harnesses; turn-end gates
|
|
206
|
+
on eight. The [per-harness matrix](https://docs.befailproof.ai/reference/harnesses#enforcement-capability)
|
|
207
|
+
shows exactly which events each one honours.
|
|
208
|
+
|
|
209
|
+
---
|
|
185
210
|
|
|
186
|
-
|
|
187
|
-
|
|
211
|
+
## Policies, written for your agents
|
|
212
|
+
|
|
213
|
+
A policy can listen to any of those events. Before a tool call, it can block the command
|
|
214
|
+
outright. When a prompt arrives, it can add context. When the agent tries to stop, it
|
|
215
|
+
can send it back to finish the job. Whatever it decides, the agent is told why. There
|
|
216
|
+
are two kinds of policy, and you can mix them:
|
|
217
|
+
|
|
218
|
+
- **Code.** Plain JavaScript, for anything you can check exactly: paths, commands,
|
|
219
|
+
arguments, limits. It's just code, so it can call your own model too.
|
|
220
|
+
- **Decision model.** Plain-English yes/no questions that Jev, our fast classifier,
|
|
221
|
+
answers about each call against what the user actually asked for. The `rm -rf build/`
|
|
222
|
+
you asked for goes through; the `rm -rf ~` that slipped into a plan doesn't. Use it
|
|
223
|
+
for the judgment calls no regex can make.
|
|
224
|
+
|
|
225
|
+
**You don't have to write either.** Failproof authors them for you. Open an insight in
|
|
226
|
+
Cloud and hit **prevent this →**, or describe the rule in a sentence. Failproof drafts
|
|
227
|
+
the policy, tests it against your agents' own past tool calls, and rolls it out to every
|
|
228
|
+
machine, observing first or enforcing straight away.
|
|
229
|
+
|
|
230
|
+
A few examples of what a policy can catch, and what it does about it:
|
|
231
|
+
|
|
232
|
+
| Example | What it catches | Does |
|
|
233
|
+
|---|---|---|
|
|
234
|
+
| `block-env-files` | Reads of `.env` and other secret files | **Blocks** |
|
|
235
|
+
| `block-kubectl` | Unreviewed changes to live infrastructure | **Blocks** |
|
|
236
|
+
| `warn-destructive-sql` | `DROP`, `TRUNCATE`, an unbounded `DELETE` | **Warns** the agent and lets it decide |
|
|
237
|
+
| `warn-repeated-tool-calls` | The agent looping on the same failing call | **Warns** the agent to change approach |
|
|
238
|
+
| `no-refunds-over-limit` *(yours)* | A support agent approving a refund it isn't allowed to | Whatever you decide |
|
|
239
|
+
| `no-production-writes` *(yours)* | File writes and edits to production paths (the code below; shell commands aren't checked) | **Blocks** |
|
|
240
|
+
|
|
241
|
+
Prefer to write one yourself? Save it in `.failproofai/policies/` as, say,
|
|
242
|
+
`no-production-writes-policies.mjs` and it loads automatically
|
|
243
|
+
([naming rules](https://docs.befailproof.ai/reference/policy-sdk#convention-files)). Commit
|
|
244
|
+
it, and every teammate whose agents run Failproof gets it on their next pull.
|
|
188
245
|
|
|
189
246
|
```js
|
|
190
247
|
import { customPolicies, deny, allow } from "failproofai";
|
|
@@ -193,6 +250,7 @@ customPolicies.add({
|
|
|
193
250
|
name: "no-production-writes",
|
|
194
251
|
match: { events: ["PreToolUse"] },
|
|
195
252
|
fn: async (ctx) => {
|
|
253
|
+
if (!["Write", "Edit"].includes(ctx.toolName ?? "")) return allow();
|
|
196
254
|
if (ctx.toolInput?.file_path?.includes("production"))
|
|
197
255
|
return deny("Writes to production paths are blocked.");
|
|
198
256
|
return allow();
|
|
@@ -200,44 +258,76 @@ customPolicies.add({
|
|
|
200
258
|
});
|
|
201
259
|
```
|
|
202
260
|
|
|
203
|
-
|
|
261
|
+
Every policy returns one of three decisions: `allow()`, `deny(message)`, or
|
|
262
|
+
`instruct(message)`. The last is the quiet superpower. Instead of crashing the agent
|
|
263
|
+
into a wall, it steers it ("run the tests before you stop", "use the staging database")
|
|
264
|
+
and the agent corrects course on its own.
|
|
204
265
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
| `deny(message)` | Block it — message goes back to the agent |
|
|
209
|
-
| `instruct(message)` | Let it through, but add context to the agent's next prompt |
|
|
210
|
-
|
|
211
|
-
→ [Write a policy](https://docs.befailproof.ai/policies/editor)
|
|
266
|
+
→ [Write a policy](https://docs.befailproof.ai/policies/editor) ·
|
|
267
|
+
[Decision-model policies](https://docs.befailproof.ai/policies/jev) ·
|
|
268
|
+
[More examples](https://docs.befailproof.ai/policies/packs)
|
|
212
269
|
|
|
213
270
|
---
|
|
214
271
|
|
|
215
|
-
##
|
|
272
|
+
## Built for agents that run on their own
|
|
216
273
|
|
|
217
|
-
|
|
274
|
+
A check that costs nothing can run on every event, all the time. That's what lets you
|
|
275
|
+
hand an agent more autonomy, not less:
|
|
218
276
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
277
|
+
- **Sub-millisecond, on every event.** `failproofaid` is a Rust daemon with a pre-warmed
|
|
278
|
+
policy worker behind an owner-only Unix socket. A check that used to cost ~700 ms now
|
|
279
|
+
takes ~0.7 ms at p50, so policies can watch every event of every session and the agent
|
|
280
|
+
never feels it. [How we got there →](https://befailproof.ai/blog/sub-millisecond-agent-enforcement/)
|
|
281
|
+
- **Always on, even when you're not.** It runs as a system service from boot, with no
|
|
282
|
+
login needed. Overnight jobs, cron runs and detached sessions get the same protection
|
|
283
|
+
as the one in your terminal.
|
|
284
|
+
- **One daemon, always in sync.** The same process ships every run to Cloud and keeps
|
|
285
|
+
your policies current, so a policy you approve reaches every machine without a
|
|
286
|
+
redeploy.
|
|
225
287
|
|
|
226
|
-
|
|
227
|
-
[Read a trace](https://docs.befailproof.ai/sessions/read-a-trace) ·
|
|
228
|
-
[Local audit](https://docs.befailproof.ai/audits/local-audit)
|
|
288
|
+
---
|
|
229
289
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
290
|
+
## Failproof Cloud: a harness that improves itself
|
|
291
|
+
|
|
292
|
+
Generic guardrails are written for everyone's agent. Failproof Cloud is built for
|
|
293
|
+
**yours**, from **your agent's own traces**, whether you run one agent or a hundred.
|
|
294
|
+
|
|
295
|
+
Every run feeds a loop that makes the harness around your agent better:
|
|
296
|
+
|
|
297
|
+
1. **Trace.** Every prompt, model call, tool call and result, live and replayable, with
|
|
298
|
+
parallel sub-agents on their own lanes, latency, cost and context windows, and SQL
|
|
299
|
+
over all of it.
|
|
300
|
+
2. **Audit.** Audits read your sessions on a schedule and cluster what went wrong into
|
|
301
|
+
named failure modes: the loops, wrong tools and quiet give-ups that are specific to
|
|
302
|
+
your agent. Each one becomes an **insight**, backed by the sessions that prove it.
|
|
303
|
+
3. **Check.** Turn an insight into an eval and every new session is scored for it, by
|
|
304
|
+
code, the decision model, an LLM judge or an agent. When the failure comes back,
|
|
305
|
+
alerts reach you on Slack, email or a signed webhook.
|
|
306
|
+
4. **Fix.** Hit **prevent this →** and Failproof writes the policy for that exact
|
|
307
|
+
failure. It tests the policy against your agent's past tool calls, then rolls it out,
|
|
308
|
+
observing first or enforcing right away.
|
|
309
|
+
5. **Repeat.** The next audit runs on traces where that failure can't happen any more,
|
|
310
|
+
and finds the next one.
|
|
311
|
+
|
|
312
|
+
The model never changes. The harness around it learns from every failure. It's the idea
|
|
313
|
+
behind our [FIRE study](https://befailproof.ai/research/runtime-policies/), where
|
|
314
|
+
policies derived from an agent's failures took task success from **37% to 69%** on the
|
|
315
|
+
failures they recognised. Same model, no fine-tuning.
|
|
316
|
+
|
|
317
|
+
> "The audits are the part that changed how we operate. We now have fewer incidents,
|
|
318
|
+
> less compute waste, and faster shipping."
|
|
319
|
+
> — Pratheep Velicherla, CTO, Testsigma
|
|
320
|
+
|
|
321
|
+
Ask the **failproof agent** anything about your agent in plain English, or pull the same
|
|
322
|
+
data into your own tools through the [MCP server](https://docs.befailproof.ai/reference/mcp),
|
|
323
|
+
[Slack](https://docs.befailproof.ai/reference/slack) and the `fp` CLI.
|
|
324
|
+
|
|
325
|
+
Start with one agent on the free plan: 5,000 runs a month, no card. Self-hosting in your
|
|
237
326
|
own cluster is available on the Enterprise plan.
|
|
238
327
|
|
|
239
|
-
→ [
|
|
240
|
-
[
|
|
328
|
+
→ [Start free](https://app.befailproof.ai) ·
|
|
329
|
+
[Pricing](https://befailproof.ai/pricing) ·
|
|
330
|
+
[Quickstart](https://docs.befailproof.ai/start/quickstart) ·
|
|
241
331
|
[Book a demo](https://befailproof.ai/get-a-demo)
|
|
242
332
|
|
|
243
333
|
---
|
|
@@ -255,17 +345,18 @@ own cluster is available on the Enterprise plan.
|
|
|
255
345
|
| [Sessions](https://docs.befailproof.ai/sessions/overview) | Follow a run: models, tools, errors, latency |
|
|
256
346
|
| [Read a trace](https://docs.befailproof.ai/sessions/read-a-trace) | What the execution graph is telling you |
|
|
257
347
|
| [Audits](https://docs.befailproof.ai/audits/overview) | Find failure patterns across many sessions |
|
|
258
|
-
| [
|
|
348
|
+
| [Evaluations](https://docs.befailproof.ai/evaluations/overview) | Score every session with code, the decision model or an LLM judge |
|
|
259
349
|
|
|
260
350
|
| Enforce | |
|
|
261
351
|
|---|---|
|
|
262
|
-
| [
|
|
263
|
-
| [
|
|
352
|
+
| [Write a policy](https://docs.befailproof.ai/policies/editor) | From an insight, from a sentence, or in code |
|
|
353
|
+
| [Decision-model policies](https://docs.befailproof.ai/policies/jev) | Jev judges calls against what the user asked |
|
|
264
354
|
| [Configuration](https://docs.befailproof.ai/policies/local-configuration) | Config scopes, merge rules and policy parameters |
|
|
265
355
|
|
|
266
356
|
| Instrument your own agent | |
|
|
267
357
|
|---|---|
|
|
268
358
|
| [Python SDK](https://docs.befailproof.ai/reference/custom-agents) | Report runs from an agent with no harness |
|
|
359
|
+
| [TypeScript SDK](https://docs.befailproof.ai/reference/custom-agents-typescript) | The same events from a Node agent |
|
|
269
360
|
| [Policy SDK](https://docs.befailproof.ai/reference/policy-sdk) | `allow` / `deny` / `instruct` reference |
|
|
270
361
|
|
|
271
362
|
---
|
package/dist/cli.mjs
CHANGED
|
@@ -29,12 +29,12 @@ var __esm = (fn, res, err) => () => {
|
|
|
29
29
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
30
30
|
|
|
31
31
|
// package.json
|
|
32
|
-
var version2 = "1.0.
|
|
32
|
+
var version2 = "1.0.15", package_default;
|
|
33
33
|
var init_package = __esm(() => {
|
|
34
34
|
package_default = {
|
|
35
35
|
name: "failproofai",
|
|
36
36
|
version: version2,
|
|
37
|
-
description: "
|
|
37
|
+
description: "The reliability layer for AI agents: see every failure, stop it in realtime. Policies hooked into 12 agent harnesses — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — block the tool call before it runs. Local dashboard included, no account needed.",
|
|
38
38
|
bin: {
|
|
39
39
|
failproofai: "./dist/cli.mjs",
|
|
40
40
|
failproofaid: "./bin/failproofaid-shim.mjs"
|
|
@@ -160,16 +160,16 @@ var init_package = __esm(() => {
|
|
|
160
160
|
minimatch: "11.0.3"
|
|
161
161
|
},
|
|
162
162
|
optionalDependencies: {
|
|
163
|
-
"@failproofai/failproofaid-linux-x64": "1.0.
|
|
164
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.
|
|
165
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.
|
|
166
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.
|
|
163
|
+
"@failproofai/failproofaid-linux-x64": "1.0.15",
|
|
164
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.15",
|
|
165
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.15",
|
|
166
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.15"
|
|
167
167
|
},
|
|
168
168
|
failproofaidBinaries: {
|
|
169
|
-
"linux-x64": "
|
|
170
|
-
"linux-arm64": "
|
|
171
|
-
"darwin-x64": "
|
|
172
|
-
"darwin-arm64": "
|
|
169
|
+
"linux-x64": "e5c7543ab9aeb5366e804d4cf5aef8ee35ef340f145c1c15f683b76761426fe6",
|
|
170
|
+
"linux-arm64": "06d27497490f7a1cec34f03808a3bf6a5644830fdf7db9133642b464f5affcde",
|
|
171
|
+
"darwin-x64": "763e6a6790d8c247765a83c92f9de65875807c96fee098c15748ac098ff99513",
|
|
172
|
+
"darwin-arm64": "a422303761f70023ad9a8d3a9b0b0e8689adc4669bddd90f72722b3df6b33ab4"
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
});
|
|
@@ -53273,7 +53273,7 @@ import { realpathSync as realpathSync9 } from "fs";
|
|
|
53273
53273
|
import { dirname as dirname36, resolve as resolve47 } from "path";
|
|
53274
53274
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
53275
53275
|
// package.json
|
|
53276
|
-
var version = "1.0.
|
|
53276
|
+
var version = "1.0.15";
|
|
53277
53277
|
|
|
53278
53278
|
// bin/failproofai.mjs
|
|
53279
53279
|
if (!process.env.FAILPROOFAI_PACKAGE_ROOT) {
|
package/dist/worker.mjs
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* outside this directory — because the capture copies nothing else.
|
|
17
17
|
*/
|
|
18
18
|
import { createConnection } from "node:net";
|
|
19
|
+
import { performance } from "node:perf_hooks";
|
|
19
20
|
import { homedir } from "node:os";
|
|
20
21
|
import { resolve } from "node:path";
|
|
21
22
|
|
|
@@ -28,12 +29,25 @@ const MAX_FRAME_BYTES = 16 * 1024 * 1024;
|
|
|
28
29
|
// applies to the envelope.
|
|
29
30
|
export const MAX_PAYLOAD_BYTES = 1_048_576;
|
|
30
31
|
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
|
|
32
|
+
// One budget for the whole request, matching the daemon's own read timeout on
|
|
33
|
+
// its worker (worker.rs).
|
|
34
|
+
//
|
|
35
|
+
// There is deliberately NO separate connect timeout. This client runs on the
|
|
36
|
+
// OpenClaw gateway's event loop, shared with every agent on the gateway. A
|
|
37
|
+
// Unix-socket connect to a live daemon completes in the kernel at once, but
|
|
38
|
+
// the gateway only learns of it on a later loop pass; while the gateway is
|
|
39
|
+
// busy (a cron burst, a large transcript, GC) a timer that is already overdue
|
|
40
|
+
// runs before that connect event. The 250 ms connect timer this replaced
|
|
41
|
+
// therefore measured gateway load, and reported a healthy daemon as
|
|
42
|
+
// unreachable (#1024). A daemon that is not there needs no timer: the connect
|
|
43
|
+
// fails at once with ENOENT or ECONNREFUSED. One that accepts and then hangs is
|
|
44
|
+
// caught by this budget.
|
|
36
45
|
export const RESPONSE_TIMEOUT_MS = 30_000;
|
|
46
|
+
// A connect that fails outright is retried once after this pause before the
|
|
47
|
+
// call fails closed: long enough to ride out a daemon restart re-binding its
|
|
48
|
+
// socket, short enough that a daemon that is really gone costs one tool call
|
|
49
|
+
// 100 ms.
|
|
50
|
+
export const UNREACHABLE_RETRY_DELAY_MS = 100;
|
|
37
51
|
|
|
38
52
|
const PROTOCOL_MISMATCH_MESSAGE =
|
|
39
53
|
"failproofaid is running a different protocol version than this plugin, so it cannot " +
|
|
@@ -144,16 +158,67 @@ function isVerdict(verdict) {
|
|
|
144
158
|
* CLI discards an oversized stdin and evaluates an empty payload;
|
|
145
159
|
* `oversized: true` lets the caller say so instead of discarding it silently.
|
|
146
160
|
*/
|
|
147
|
-
export function requestHookVerdict({
|
|
161
|
+
export function requestHookVerdict(request) {
|
|
162
|
+
return requestWithRetry(request);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* One request, asked a second time if the first never reached the daemon.
|
|
167
|
+
* Only `unreachable` is retried: nothing was sent, so asking again cannot
|
|
168
|
+
* evaluate a call twice. Every other failure came from a daemon that saw the
|
|
169
|
+
* request, and is returned as it is.
|
|
170
|
+
*
|
|
171
|
+
* Both attempts share ONE deadline of `responseTimeoutMs`, set before the
|
|
172
|
+
* first and passed to each attempt as an absolute time: an attempt arms its
|
|
173
|
+
* timer with what is left of it just before connecting (so encoding time
|
|
174
|
+
* counts too), and the retry is skipped when the pause before it would use the
|
|
175
|
+
* rest. A fresh budget per attempt let a call wait twice as long, past the
|
|
176
|
+
* gateway's own hook timeout. Time is read from `performance.now()`, a
|
|
177
|
+
* monotonic clock, so a wall-clock change cannot stretch or shrink the budget.
|
|
178
|
+
*
|
|
179
|
+
* A failed retry keeps its own failure and agent-facing message; its `detail`
|
|
180
|
+
* (gateway log only) names both attempts, so the first attempt's cause is
|
|
181
|
+
* never lost behind the second's.
|
|
182
|
+
*/
|
|
183
|
+
async function requestWithRetry(request) {
|
|
184
|
+
const startedAt = performance.now();
|
|
185
|
+
const budgetMs = request.responseTimeoutMs ?? RESPONSE_TIMEOUT_MS;
|
|
186
|
+
const deadline = startedAt + budgetMs;
|
|
187
|
+
const noTimeToRetry = (first) =>
|
|
188
|
+
({ ...first, detail: `${first.detail}; no time left in the ${budgetMs} ms budget to retry` });
|
|
189
|
+
|
|
190
|
+
const first = await requestOnce({ ...request, deadline, budgetMs });
|
|
191
|
+
if (first.ok || first.failure !== "unreachable") return first;
|
|
192
|
+
|
|
193
|
+
const delayMs = request.retryDelayMs ?? UNREACHABLE_RETRY_DELAY_MS;
|
|
194
|
+
if (deadline - performance.now() - delayMs <= 0) return noTimeToRetry(first);
|
|
195
|
+
await new Promise((resume) => setTimeout(resume, delayMs));
|
|
196
|
+
if (deadline - performance.now() <= 0) return noTimeToRetry(first);
|
|
197
|
+
|
|
198
|
+
const second = await requestOnce({ ...request, deadline, budgetMs });
|
|
199
|
+
if (second.ok) return second;
|
|
200
|
+
return {
|
|
201
|
+
...second,
|
|
202
|
+
detail:
|
|
203
|
+
`attempt 1: ${first.detail}; attempt 2: ${second.detail ?? second.message}; ` +
|
|
204
|
+
`2 attempts, ${Math.round(performance.now() - startedAt)} ms total`,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function requestOnce({
|
|
148
209
|
event,
|
|
149
210
|
payload,
|
|
150
211
|
cwd = "",
|
|
151
212
|
agentSettingsPath = "",
|
|
152
213
|
socketPath = daemonSocketPath(),
|
|
153
|
-
|
|
154
|
-
|
|
214
|
+
// The whole request's budget (for messages) and its absolute end on the
|
|
215
|
+
// performance.now() clock, shared with any retry.
|
|
216
|
+
budgetMs = RESPONSE_TIMEOUT_MS,
|
|
217
|
+
deadline = performance.now() + budgetMs,
|
|
155
218
|
}) {
|
|
156
219
|
return new Promise((done) => {
|
|
220
|
+
// Started before encoding, so the elapsed time in `detail` includes it.
|
|
221
|
+
const startedAt = performance.now();
|
|
157
222
|
let body;
|
|
158
223
|
let oversized = false;
|
|
159
224
|
try {
|
|
@@ -197,22 +262,32 @@ export function requestHookVerdict({
|
|
|
197
262
|
try { socket?.destroy(); } catch { /* already closed */ }
|
|
198
263
|
done(result);
|
|
199
264
|
};
|
|
265
|
+
// The agent-facing message stays the same; `detail` says what actually
|
|
266
|
+
// happened, for the gateway log (hooks.js), so the next field report can
|
|
267
|
+
// tell a missing socket from a refused one from a timeout.
|
|
268
|
+
const unreachable = (cause) =>
|
|
269
|
+
finish({ ...failed("unreachable", UNREACHABLE_MESSAGE), detail: `${cause} after ${Math.round(performance.now() - startedAt)} ms` });
|
|
200
270
|
|
|
271
|
+
// Measured after encoding, so a large payload's encoding time is charged
|
|
272
|
+
// to the same budget.
|
|
273
|
+
const remainingMs = deadline - performance.now();
|
|
274
|
+
if (remainingMs <= 0) {
|
|
275
|
+
unreachable("no time left in the request budget");
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
201
278
|
try {
|
|
202
279
|
socket = createConnection(socketPath);
|
|
203
|
-
} catch {
|
|
204
|
-
|
|
280
|
+
} catch (err) {
|
|
281
|
+
unreachable(err?.code ?? err?.message ?? String(err));
|
|
205
282
|
return;
|
|
206
283
|
}
|
|
207
|
-
timer = setTimeout(() =>
|
|
284
|
+
timer = setTimeout(() => {
|
|
285
|
+
if (connected) finish(failed("timeout", `failproofaid did not answer within ${budgetMs} ms`));
|
|
286
|
+
else unreachable("no connection within the request budget");
|
|
287
|
+
}, remainingMs);
|
|
208
288
|
|
|
209
289
|
socket.on("connect", () => {
|
|
210
290
|
connected = true;
|
|
211
|
-
clearTimeout(timer);
|
|
212
|
-
timer = setTimeout(
|
|
213
|
-
() => finish(failed("timeout", `failproofaid did not answer within ${responseTimeoutMs} ms`)),
|
|
214
|
-
responseTimeoutMs,
|
|
215
|
-
);
|
|
216
291
|
const header = Buffer.alloc(4);
|
|
217
292
|
header.writeUInt32BE(body.length, 0);
|
|
218
293
|
socket.write(Buffer.concat([header, body]));
|
|
@@ -237,18 +312,12 @@ export function requestHookVerdict({
|
|
|
237
312
|
finish(result.ok && oversized ? { ...result, oversized: true } : result);
|
|
238
313
|
});
|
|
239
314
|
socket.on("error", (err) => {
|
|
240
|
-
finish(
|
|
241
|
-
|
|
242
|
-
? failed("evaluation", `failproofaid connection failed: ${err?.message ?? String(err)}`)
|
|
243
|
-
: failed("unreachable", UNREACHABLE_MESSAGE),
|
|
244
|
-
);
|
|
315
|
+
if (connected) finish(failed("evaluation", `failproofaid connection failed: ${err?.message ?? String(err)}`));
|
|
316
|
+
else unreachable(err?.code ?? err?.message ?? String(err));
|
|
245
317
|
});
|
|
246
318
|
socket.on("close", () => {
|
|
247
|
-
finish(
|
|
248
|
-
|
|
249
|
-
? failed("evaluation", "failproofaid closed the connection before returning a verdict")
|
|
250
|
-
: failed("unreachable", UNREACHABLE_MESSAGE),
|
|
251
|
-
);
|
|
319
|
+
if (connected) finish(failed("evaluation", "failproofaid closed the connection before returning a verdict"));
|
|
320
|
+
else unreachable("closed before connecting");
|
|
252
321
|
});
|
|
253
322
|
});
|
|
254
323
|
}
|
package/openclaw-plugin/hooks.js
CHANGED
|
@@ -92,7 +92,10 @@ export function registerFailproofaiHooks(api, {
|
|
|
92
92
|
} catch (err) {
|
|
93
93
|
result = { ok: false, message: `the failproofai plugin failed: ${err?.message ?? String(err)}` };
|
|
94
94
|
}
|
|
95
|
-
if (!result?.ok)
|
|
95
|
+
if (!result?.ok) {
|
|
96
|
+
const message = result?.message ?? "no verdict";
|
|
97
|
+
logFailure(api, event, result?.detail ? `${message} (${result.detail})` : message);
|
|
98
|
+
}
|
|
96
99
|
// Same outcome as the CLI's oversized stdin (warn, evaluate an empty
|
|
97
100
|
// payload), and said out loud for the same reason it is there.
|
|
98
101
|
else if (result.oversized) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "failproofai",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.15",
|
|
4
|
+
"description": "The reliability layer for AI agents: see every failure, stop it in realtime. Policies hooked into 12 agent harnesses — Claude Code, Codex, Cursor, Hermes, OpenClaw and more — block the tool call before it runs. Local dashboard included, no account needed.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"failproofai": "./dist/cli.mjs",
|
|
7
7
|
"failproofaid": "./bin/failproofaid-shim.mjs"
|
|
@@ -127,15 +127,15 @@
|
|
|
127
127
|
"minimatch": "11.0.3"
|
|
128
128
|
},
|
|
129
129
|
"optionalDependencies": {
|
|
130
|
-
"@failproofai/failproofaid-linux-x64": "1.0.
|
|
131
|
-
"@failproofai/failproofaid-linux-arm64": "1.0.
|
|
132
|
-
"@failproofai/failproofaid-darwin-x64": "1.0.
|
|
133
|
-
"@failproofai/failproofaid-darwin-arm64": "1.0.
|
|
130
|
+
"@failproofai/failproofaid-linux-x64": "1.0.15",
|
|
131
|
+
"@failproofai/failproofaid-linux-arm64": "1.0.15",
|
|
132
|
+
"@failproofai/failproofaid-darwin-x64": "1.0.15",
|
|
133
|
+
"@failproofai/failproofaid-darwin-arm64": "1.0.15"
|
|
134
134
|
},
|
|
135
135
|
"failproofaidBinaries": {
|
|
136
|
-
"linux-x64": "
|
|
137
|
-
"linux-arm64": "
|
|
138
|
-
"darwin-x64": "
|
|
139
|
-
"darwin-arm64": "
|
|
136
|
+
"linux-x64": "e5c7543ab9aeb5366e804d4cf5aef8ee35ef340f145c1c15f683b76761426fe6",
|
|
137
|
+
"linux-arm64": "06d27497490f7a1cec34f03808a3bf6a5644830fdf7db9133642b464f5affcde",
|
|
138
|
+
"darwin-x64": "763e6a6790d8c247765a83c92f9de65875807c96fee098c15748ac098ff99513",
|
|
139
|
+
"darwin-arm64": "a422303761f70023ad9a8d3a9b0b0e8689adc4669bddd90f72722b3df6b33ab4"
|
|
140
140
|
}
|
|
141
141
|
}
|