Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
886ca0e
[hooks] Guard failproofai's installed code and refuse future-dated pa…
NiveditJain Nov 24, 2026
de65e59
[hooks] Block agent edits to its own hook settings (#1794)
NiveditJain Nov 24, 2026
8cd29d1
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 24, 2026
18328b0
[hooks] Address review: kernel-order symlink walk, pnpm store, $NVM_B…
NiveditJain Nov 24, 2026
8956fde
[hooks] CHANGELOG: cite #1050
NiveditJain Nov 24, 2026
ed5eb18
[hooks] Address hermes review: walk through missing directories; fail…
NiveditJain Nov 24, 2026
a57c623
Merge remote-tracking branch 'origin/main' into claude/sec-1796-dist-…
NiveditJain Nov 24, 2026
bda88fd
[hooks] CHANGELOG: move #1050's lines to 1.0.17-beta.0
NiveditJain Nov 24, 2026
770d7c4
[hooks] Close the review's shell bypasses and false positives (#1794)
NiveditJain Nov 24, 2026
95d2434
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 24, 2026
c386dbb
Move the #1794 changelog entry under 1.0.17-beta.0
NiveditJain Nov 24, 2026
cb51b5d
Name the PR in the #1794 changelog entry
NiveditJain Nov 24, 2026
314623a
[hooks] Read commands with one shell lexer; close the re-review's hol…
NiveditJain Nov 24, 2026
26571cc
[hooks] Close the third review pass's holes and super-linear inputs (…
NiveditJain Nov 24, 2026
bedf1a4
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 24, 2026
efccfea
[hooks] Close the last review pass: echo-to-script bodies, piped CLI,…
NiveditJain Nov 24, 2026
f4d5eab
Merge FailproofAI/failproofai#1050 (bda88fde) to build #1795 on its i…
NiveditJain Nov 24, 2026
41ef679
[hooks] Test: the always-on guard must protect the entry a project-sc…
NiveditJain Nov 24, 2026
5347275
[hooks] Guard node_modules/.bin/failproofai, the entry project-scope …
NiveditJain Nov 24, 2026
65e9f10
Merge remote-tracking branch 'origin/main' into claude/sec-1796-dist-…
NiveditJain Nov 24, 2026
248036e
[hooks] Address review: redirects, -t spellings, cd, globs and .bin s…
NiveditJain Nov 24, 2026
87045a6
[hooks] CHANGELOG: move #1050's lines to 1.0.18-beta.0 (1.0.17 shipped)
NiveditJain Nov 24, 2026
d3f19e5
[hooks] Close hermes round 1: links, .. after a link, quoted hooks-of…
NiveditJain Nov 24, 2026
2baab1c
[hooks] Address second review: quoted words, cd cost, false positives…
NiveditJain Nov 24, 2026
9b7113b
Merge FailproofAI/failproofai#1050 (87045a6c): its CHANGELOG lines mo…
NiveditJain Nov 24, 2026
c50991c
[hooks] Read a copy's destination past its redirects; open 1.0.18-bet…
NiveditJain Nov 24, 2026
f57b5ae
[hooks] CHANGELOG: #1795's guard fix under 1.0.18-beta.0 (#1058)
NiveditJain Nov 24, 2026
697fac9
[hooks] Address CodeRabbit: dotted pnpm-store glob; state the one-min…
NiveditJain Nov 24, 2026
d7f776c
Merge FailproofAI/failproofai#1050 (697fac99): dotted pnpm-store glob
NiveditJain Nov 24, 2026
9b3f34a
[hooks] Fix CI (unused commandWords); follow popd on an empty stack a…
NiveditJain Nov 24, 2026
49cdb01
Merge origin/main (95fb3c77) into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
6258224
Merge remote-tracking branch 'origin/main' into claude/sec-1796-dist-…
NiveditJain Nov 24, 2026
b962880
[hooks] Keep a line of heredocs linear; null means no managed setting…
NiveditJain Nov 24, 2026
6f645ea
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 24, 2026
658c5dd
[hooks] Address third review: quote-aware words, cd as bash runs it, …
NiveditJain Nov 24, 2026
486ca28
Merge origin/main into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
5910a41
Merge origin/main into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
e91e18f
Merge remote-tracking branch 'origin/main' into claude/sec-1796-dist-…
NiveditJain Nov 24, 2026
a1e52a6
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 24, 2026
6d31038
[hooks] Close CodeRabbit's later reviews: quoted redirect targets, ~/…
NiveditJain Nov 24, 2026
876e086
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 24, 2026
ff15069
Merge origin/main into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
603bb46
Merge remote-tracking branch 'origin/main' into claude/sec-1796-dist-…
NiveditJain Nov 24, 2026
13b27d4
[hooks] Read through filters that write no file of their own (#1794)
NiveditJain Nov 24, 2026
4795940
Close the walk gaps CodeRabbit found in the npx entry guard
NiveditJain Nov 24, 2026
70f0e1b
[hooks] Match node_modules and .pnpm only as whole path components
NiveditJain Nov 24, 2026
6a163ae
Keep 64 segments of the shell's whole path, and cut the tail without …
NiveditJain Nov 24, 2026
7ac5740
[hooks] Let a path component start right after a short-option cluster
NiveditJain Nov 24, 2026
4a7e40e
Refuse downloads and remote copies that write the npx entry
NiveditJain Nov 24, 2026
2377174
Resolve shell writes as the kernel does, and never forget where a cd …
NiveditJain Nov 24, 2026
d2f4f28
[hooks] Fix quadratic installed-code match: check the component start…
NiveditJain Nov 24, 2026
1bc07b4
Keep the guard linear on padded commands
NiveditJain Nov 24, 2026
dfdbe78
Leave the glued-option cluster before .bin unbounded
NiveditJain Nov 24, 2026
02b4258
Merge #1050's head (d2f4f287) into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
43bd947
[hooks] Start a path component only after a separator or a shell word…
NiveditJain Nov 24, 2026
684ac2d
Merge #1050's head (43bd9475) into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
e8577a7
[hooks] Close hermes round 2: link names, plugin trees, -t, git -C, c…
NiveditJain Nov 24, 2026
1388f38
[hooks] Address hermes: daemon-store globs and case-insensitive glob …
NiveditJain Nov 24, 2026
57f817a
[hooks] Close hermes round 3: parameter defaults, pushd -n, OLDPWD, g…
NiveditJain Nov 24, 2026
b6ff221
[hooks] Match globs case-insensitively, as macOS resolves paths (#1794)
NiveditJain Nov 24, 2026
8494c99
Merge #1050's head (1388f38c) into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 24, 2026
a0c7b1e
[hooks] Test upper-case .bin globs against the case-insensitive glob …
NiveditJain Nov 24, 2026
fc5caeb
[hooks] Close hermes round 4: variable values, stack rotation, git -C…
NiveditJain Nov 24, 2026
b003e0f
[hooks] Close hermes round 5: expansion-built CLI words, assigned lin…
NiveditJain Nov 24, 2026
34c2eb8
[hooks] Close hermes's four findings: native patches, glued outputs, …
NiveditJain Nov 24, 2026
87c4207
[hooks] Close hermes round 6: linear name matching, cp --parents, mor…
NiveditJain Nov 24, 2026
d011ea9
[hooks] Close hermes's second round: Codex workdir, cd -P, linked glo…
NiveditJain Nov 24, 2026
43c7a9e
[hooks] Close hermes round 7: dangling settings links, overflow, chai…
NiveditJain Nov 24, 2026
ebbac14
[hooks] Test: the always-on guard must protect the entry a project-sc…
NiveditJain Nov 24, 2026
b6f5272
[hooks] Guard node_modules/.bin/failproofai, the entry project-scope …
NiveditJain Nov 24, 2026
525acaf
[hooks] Address review: redirects, -t spellings, cd, globs and .bin s…
NiveditJain Nov 24, 2026
59a9cf8
[hooks] Address second review: quoted words, cd cost, false positives…
NiveditJain Nov 24, 2026
49b688a
[hooks] CHANGELOG: #1795's guard fix under 1.0.18-beta.0 (#1058)
NiveditJain Nov 24, 2026
d96730a
[hooks] Fix CI (unused commandWords); follow popd on an empty stack a…
NiveditJain Nov 24, 2026
f7b3e2d
[hooks] Address third review: quote-aware words, cd as bash runs it, …
NiveditJain Nov 24, 2026
cefee6b
Close the walk gaps CodeRabbit found in the npx entry guard
NiveditJain Nov 24, 2026
a97fb8a
Keep 64 segments of the shell's whole path, and cut the tail without …
NiveditJain Nov 24, 2026
79fb8e8
Refuse downloads and remote copies that write the npx entry
NiveditJain Nov 24, 2026
5e673ae
Resolve shell writes as the kernel does, and never forget where a cd …
NiveditJain Nov 24, 2026
2421afb
Keep the guard linear on padded commands
NiveditJain Nov 24, 2026
570dca2
Leave the glued-option cluster before .bin unbounded
NiveditJain Nov 24, 2026
85b52c1
[hooks] Test upper-case .bin globs against the case-insensitive glob …
NiveditJain Nov 24, 2026
afc7c42
[hooks] Close hermes's four findings: native patches, glued outputs, …
NiveditJain Nov 24, 2026
358bacd
[hooks] Close hermes's second round: Codex workdir, cd -P, linked glo…
NiveditJain Nov 24, 2026
35317e6
[hooks] Preserve reviewed .bin boundaries when rebasing #1058
hermes-exosphere Nov 25, 2026
4e00bf6
Merge remote-tracking branch 'origin/main' into claude/sec-1794-setti…
NiveditJain Nov 25, 2026
428826b
[hooks] Resolve #1058 conflicts while preserving branch history
hermes-exosphere Nov 25, 2026
27cc830
Merge main (#1050 squash 39d1afb3, #1061, #1060) into claude/sec-1795…
NiveditJain Nov 25, 2026
a5aa3f3
[hooks] Resolve variable chains of any length and protect relocated s…
NiveditJain Nov 25, 2026
e9574a2
[hooks] Close hermes's third round: disk globs, curl --output-dir, Co…
NiveditJain Nov 25, 2026
3296d8b
Merge hermes's push (428826bf) into claude/sec-1795-npx-local-bin-a18bab
NiveditJain Nov 25, 2026
3f0205f
[hooks] Read the files a sed script writes as writes
NiveditJain Nov 25, 2026
afbf193
[hooks] Close hermes's fifth round: linked glob matches, curl transfe…
NiveditJain Nov 25, 2026
ae95198
[hooks] Bound variable resolution and protect a worktree's main-check…
NiveditJain Nov 25, 2026
b93822d
[hooks] Read a sed write after an address, and keep quoted separators…
NiveditJain Nov 25, 2026
a33d8d1
[hooks] Judge destinations built by parameter expansion and globs tha…
NiveditJain Nov 25, 2026
7d7ebdd
[hooks] Close hermes's three P1s: quoted interpreters, unexamined bra…
NiveditJain Nov 25, 2026
79f9a9f
[hooks] Follow values assigned by for, read, printf -v, namerefs and …
NiveditJain Nov 25, 2026
c76a845
[hooks] Guard OpenClaw's apply_patch, which reaches policies by its o…
NiveditJain Nov 25, 2026
6fcdfdd
[hooks] Guard OpenClaw's native apply_patch, which reaches policies u…
NiveditJain Nov 25, 2026
8ac9b10
[hooks] Check every path a glob expands to, follow cd to a variable, …
NiveditJain Nov 25, 2026
52c478d
[hooks] Close hermes's seventh round: oversized globs, values through…
NiveditJain Nov 25, 2026
487450d
[collect] Self Reports: MCP server, settings file and self_report events
chhhee10 Nov 25, 2026
bb0e716
[daemon] Self Reports: desired-state field, settings writer, sync and…
chhhee10 Nov 25, 2026
65caf1c
[hooks] Self Reports: allow and record the report tool, stdio MCP ser…
chhhee10 Nov 25, 2026
ddcdf77
[ts-sdk] Self Reports: self_report event, report tool helpers and fra…
chhhee10 Nov 25, 2026
20bdfbd
[ts-sdk] Self Reports: integration scenarios, README and changelog
chhhee10 Nov 25, 2026
fe6ac22
[self-reports] Register the failproofai MCP server in every hooked agent
chhhee10 Nov 25, 2026
c52b557
Merge branch 'feat/self-reports-hook' into feat/self-reports
chhhee10 Nov 25, 2026
5bfcf7d
Merge branch 'feat/self-reports-install' into feat/self-reports
chhhee10 Nov 25, 2026
6644970
Merge branch 'feat/self-reports-tssdk' into feat/self-reports
chhhee10 Nov 25, 2026
ce7f644
[self-reports] Integrate the parts: shared settings reader, in-proces…
chhhee10 Nov 25, 2026
995f199
feat(failproofai-sdk): Self Reports — self_report event, report tool …
chhhee10 Nov 25, 2026
46424ea
Merge branch 'feat/self-reports-pysdk' into feat/self-reports
chhhee10 Nov 25, 2026
b5984b1
[self-reports] Docs, changelog, and the Python SDK in the shared gold…
chhhee10 Nov 25, 2026
b5b4a70
[hooks] Read shell globs as zsh expands them too (#1795)
chhhee10 Nov 25, 2026
547ce19
[hooks] Give a glob after ** the directories it walked (#1795)
chhhee10 Nov 25, 2026
3a341d8
[hooks] Harden option parsing for curl and tar, and two shell expansi…
chhhee10 Nov 25, 2026
6a68b96
[hooks] Match parameter-operator patterns as bash does, not as paths …
chhhee10 Nov 25, 2026
336194e
[hooks] Address review round 11: globs, assigned values, git -C and t…
chhhee10 Nov 26, 2026
e0d88d8
[hooks] Harden Codex and Copilot tool input handling
chhhee10 Nov 26, 2026
6f595a9
[self-reports] Live transport check, startup sync, status health, MCP…
chhhee10 Nov 26, 2026
3f4e8dd
[self-reports] Name the report arguments, accept aliased ones, quiete…
chhhee10 Nov 26, 2026
cc064fd
[self-reports] Fix the harness and SDK test-round bugs
chhhee10 Nov 26, 2026
fb102d1
[self-reports] Address review: daemon identity, HTTP gating, attribut…
chhhee10 Nov 26, 2026
f6efba8
[self-reports] Address second review round
chhhee10 Nov 27, 2026
bfbbbe3
[release] 1.0.18-beta.1 for the Self Reports beta
chhhee10 Nov 27, 2026
556a5b1
[hooks] Compute printf conversions as bash does and read every tar -C…
chhhee10 Nov 27, 2026
3dbf325
[hooks] Refuse typed shell input that continues into a later write
chhhee10 Nov 27, 2026
db41109
[hooks] Refuse a Codex command that opens an interactive shell or REPL
chhhee10 Nov 27, 2026
cf8fdf0
[self-reports] On by default; apply selfReport only from an accepted …
chhhee10 Nov 27, 2026
cfa875b
[self-reports] Project-scope installs leave user-wide MCP configs alo…
chhhee10 Nov 27, 2026
32ca69c
[self-reports] Apply machineLogs/logRequest only from an accepted des…
chhhee10 Nov 27, 2026
10e709d
[release] 1.0.18-beta.2
chhhee10 Nov 27, 2026
1046646
[self-reports] Name the local MCP server failproofai_local; enrolment…
chhhee10 Nov 27, 2026
93cc7f4
[self-reports] Fix the end-to-end run's findings; 1.0.18-beta.3
chhhee10 Nov 27, 2026
0ea26f6
[self-reports] Lean output, MCP events in the daemon log, sync fix pr…
chhhee10 Nov 27, 2026
60c5309
[self-reports] Test fake daemon ignores one-way selfReportLog frames …
chhhee10 Nov 27, 2026
e518765
[self-reports] Visible report tool in every harness, failure hint, re…
chhhee10 Nov 29, 2026
9b84b24
[self-reports] Record a Devin report once: skip the Claude path when …
chhhee10 Nov 29, 2026
2b3dc85
Merge #1058 (and its Codex/Copilot input hardening) into #1053
chhhee10 Nov 29, 2026
36fa1f2
[hooks] Address hermes's latest rounds on #1053 and #1058
chhhee10 Nov 29, 2026
b975b92
[self-reports] Lead instructions and description with how to call rep…
chhhee10 Nov 29, 2026
43073a2
[self-reports] Upgrade removes legacy Hermes/OpenClaw MCP entries bef…
chhhee10 Nov 29, 2026
5fb2899
[self-reports] Cut log previews on character boundaries, ASCII ellipsis
chhhee10 Nov 29, 2026
a7fc467
[self-reports] Failure hint only for clearly-blocking failures (auth,…
chhhee10 Nov 29, 2026
65d01ab
[self-reports] Quiet update/config output: routine gateway and Self R…
chhhee10 Nov 29, 2026
99d2d53
[self-reports] Docs: no Cloud Self Reports page; reports live on the …
chhhee10 Nov 29, 2026
749b7ba
[self-reports] One status command: drop --verbose; plain status shows…
chhhee10 Nov 29, 2026
a497cb6
[hooks] Bound two slow paths in the state walk
chhhee10 Nov 29, 2026
0f53de9
fix(audit): read Codex code-mode transcripts
chhhee10 Nov 29, 2026
79af748
[self-reports] File every report under a listed category
chhhee10 Nov 29, 2026
2091339
[self-reports] No gateway restart advice where Hermes or OpenClaw is …
chhhee10 Nov 29, 2026
faf8a30
[self-reports] Always-on instructions for Codex, Antigravity and Open…
chhhee10 Nov 29, 2026
6c1b719
Self Reports: task_failure also covers any other blocker no category …
chhhee10 Nov 30, 2026
c333634
Merge remote-tracking branch 'origin/main' into feat/self-reports
chhhee10 Nov 30, 2026
86adc25
Self Reports: grant the report tool's early allow only to our own reg…
chhhee10 Nov 30, 2026
4edfeb2
Hooks: exempt quoted grep/jq arguments only for the standard tool
chhhee10 Nov 30, 2026
bf73847
Self Reports: match a hook row only to a call from its own agent process
chhhee10 Nov 30, 2026
17ef5eb
Self Reports: register Hermes' report tool even while reporting is off
chhhee10 Nov 30, 2026
a32ff85
Self Reports: let Pi pick up the report tool after it started
chhhee10 Nov 30, 2026
66d3cff
Self Reports: scrub before cutting, and never log a raw category verb…
chhhee10 Nov 30, 2026
85d231d
Hooks: a bare grep/rg/jq is the real tool only where PATH finds it in…
chhhee10 Nov 30, 2026
1edd6d9
Merge remote-tracking branch 'origin/main' into feat/self-reports
chhhee10 Nov 30, 2026
f1aa4d8
Self Reports: strict ownership for the report exemption; skip HOME's …
chhhee10 Nov 30, 2026
4d760e3
Hooks: judge a bare grep by the agent's PATH, carried from the hook c…
chhhee10 Nov 30, 2026
e940852
Self Reports: match rows and sessions to the exact agent process
chhhee10 Nov 30, 2026
a2e6509
Self Reports: scrub the log preview from the detail as sent
chhhee10 Nov 30, 2026
490d2a4
Merge remote-tracking branch 'origin/main' into feat/self-reports
chhhee10 Nov 30, 2026
a31a6f5
Self Reports docs: Pi has MCP from 0.99; keep the extension's report …
chhhee10 Nov 30, 2026
bd93edd
Self Reports: keep the stdio log lines on macOS
chhhee10 Nov 30, 2026
f77881c
Self Reports: wait for the daemon to close before dropping a log conn…
chhhee10 Nov 30, 2026
d1f0bc9
Merge remote-tracking branch 'origin/main' into feat/self-reports
chhhee10 Nov 30, 2026
0db0f85
Self Reports: keep the process alive while a log event is in flight
chhhee10 Nov 30, 2026
6047d73
Self Reports: no exemption for an entry that can change what runs; sy…
chhhee10 Nov 30, 2026
d76ce83
Self Reports: dedup across builds while an upgrade is half done
chhhee10 Nov 30, 2026
f256a53
Self Reports: never keep part of a token at a detail cut
chhhee10 Nov 30, 2026
3ea77aa
Merge remote-tracking branch 'origin/feat/self-reports' into release/…
chhhee10 Nov 30, 2026
c09c19d
Release 1.0.18: Self Reports (#1062) and the agent settings guard (#1…
chhhee10 Nov 30, 2026
3eaa7b3
Release 1.0.18: pass the policy context into judgeFailproofaiCommand
chhhee10 Nov 30, 2026
de41c5c
Merge remote-tracking branch 'origin/main' into release/1.0.18
chhhee10 Nov 30, 2026
4963399
Release 1.0.18 CHANGELOG: Self Reports and the settings guard in the …
chhhee10 Nov 30, 2026
c8db69e
Hooks: read a Codex shell write to settings from where it may run
chhhee10 Nov 30, 2026
2d28213
Self Reports: exempt only the calling agent's own spelling of the rep…
chhhee10 Nov 30, 2026
225449a
Hooks: close three gaps in the Codex interactive-session guard
chhhee10 Nov 30, 2026
ab1f48b
Setup: warn again when Codex hasn't trusted the hooks
chhhee10 Nov 30, 2026
292649d
Self Reports: answer a request whose handler throws with a JSON-RPC e…
chhhee10 Nov 30, 2026
0e2c08d
Self Reports: clean up the hint cache
chhhee10 Nov 30, 2026
074a6f1
Hooks: guard OpenCode's project opencode.json and VS Code's settings.…
chhhee10 Nov 30, 2026
d813186
Self Reports: look up the agent pid only while Self Reports is on
chhhee10 Nov 30, 2026
f7cc2d9
Merge branch 'fix/1105-guard' into release/1.0.18
chhhee10 Nov 30, 2026
66c86d9
Merge branch 'fix/1105-sr' into release/1.0.18
chhhee10 Nov 30, 2026
39787d4
Hooks: narrow Codex's unknown start to Codex's own config directory
chhhee10 Nov 30, 2026
d836ccf
Self Reports: judge the report exemption by the calling agent's confi…
chhhee10 Nov 30, 2026
a594372
Hooks: keep a heredoc's delimiter when its body is taken out as inert
chhhee10 Nov 30, 2026
af9042f
Hooks: exempt a settings reader only as the real tool
chhhee10 Nov 30, 2026
917bc9c
Merge branch 'fix/1105-sr' into release/1.0.18
chhhee10 Nov 30, 2026
3c73637
Hooks: look up each command head's tool once; CHANGELOG for the revie…
chhhee10 Nov 30, 2026
dfd2224
Hooks tests: the editor exemption depends on a system `code`, as the …
chhhee10 Nov 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 100 additions & 3 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ sdk/python/ The telemetry SDK (Python, uv, pytest). PyPI dist
dependency we declare is a constraint they inherit.
`sdk/` is a directory because more languages go beside
`python/`, not inside it.
failproofai_sdk/_events.py The 15 public event methods, and the `_pending` map that
failproofai_sdk/_events.py The 16 public event methods, and the `_pending` map that
auto-computes duration_ms by pairing start/end events
failproofai_sdk/_schema.py One dataclass per event type; `to_dict()` IS the wire
format. Frozen byte-for-byte by tests/test_wire_format.py
Expand All @@ -1385,7 +1385,7 @@ sdk/python/ The telemetry SDK (Python, uv, pytest). PyPI dist
on either side. tests/test_spool_contract.py checks the
Rust and the TypeScript directly and never skips
sdk/typescript/ The telemetry SDK (TypeScript, npm, vitest). npm package
`@failproofai/sdk`. The same 15 events, wire format,
`@failproofai/sdk`. The same 16 events, wire format,
spool directory and Evaluator v2 protocol as
sdk/python — a fleet running both writes into one
pipe. Zero runtime dependencies for the same reason,
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "3"
members = ["crates/*"]

[workspace.package]
version = "1.0.17"
version = "1.0.18"
edition = "2024"
license-file = "LICENSE"
repository = "https://github.com/FailproofAI/failproofai"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ hand an agent more autonomy, not less:
- **One daemon, always in sync.** The same process ships every run to Cloud and keeps
your policies current, so a policy you approve reaches every machine without a
redeploy.
- **Agents that say when they're stuck.** [Self Reports](https://docs.befailproof.ai/self-reports)
gives every agent a `report` tool for looping, a broken credential, missing context or a
request it cannot do. No policy can block the call, and each report lands on its
session, so you see where agents get stuck without reading every transcript. It is on
by default; `failproofai self-report disable` (or the Cloud switch) turns it off.

---

Expand Down
31 changes: 31 additions & 0 deletions __tests__/audit/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createHash } from "node:crypto";
import {
CACHE_SCHEMA_VERSION,
CACHE_TTL_MS,
TRANSCRIPT_PARSER_VERSIONS,
readCachedTranscriptResult,
writeCachedTranscriptResult,
} from "../../src/audit/cache";
Expand Down Expand Up @@ -163,4 +164,34 @@ describe("per-transcript audit cache", () => {
const intervalMs = DEFAULT_AUDIT_INTERVAL_DAYS * 24 * 60 * 60_000;
expect(CACHE_TTL_MS).toBeGreaterThan(intervalMs * 2);
});

// A parser that starts reading records it used to skip changes neither the
// transcript's mtime/size nor the builtins' hash, so without a parser
// version a Codex session cached as "0 tool calls" would be served for 30
// days after the fix shipped.
it("re-scans a Codex entry written before its parser version existed", () => {
const codex: TranscriptAuditResult = { ...FAKE_RESULT, cli: "codex", eventsScanned: 0 };
writeCachedTranscriptResult(TRANSCRIPT_PATH, MTIME, SIZE, codex);
const path = cachePathFor(TRANSCRIPT_PATH);
const entry = JSON.parse(readFileSync(path, "utf-8"));
expect(entry.parserVersion).toBe(TRANSCRIPT_PARSER_VERSIONS.codex);
expect(readCachedTranscriptResult(TRANSCRIPT_PATH, MTIME, SIZE)?.cli).toBe("codex");

delete entry.parserVersion; // what every pre-upgrade entry looks like
writeFileSync(path, JSON.stringify(entry));
expect(readCachedTranscriptResult(TRANSCRIPT_PATH, MTIME, SIZE)).toBeNull();

writeFileSync(path, JSON.stringify({ ...entry, parserVersion: 1 }));
expect(readCachedTranscriptResult(TRANSCRIPT_PATH, MTIME, SIZE)).toBeNull();
});

it("keeps serving a cached entry for a CLI whose parser has no version", () => {
expect(TRANSCRIPT_PARSER_VERSIONS.claude).toBeUndefined();
writeCachedTranscriptResult(TRANSCRIPT_PATH, MTIME, SIZE, FAKE_RESULT);
const path = cachePathFor(TRANSCRIPT_PATH);
const entry = JSON.parse(readFileSync(path, "utf-8"));
expect(entry.parserVersion).toBeUndefined();
writeFileSync(path, JSON.stringify(entry));
expect(readCachedTranscriptResult(TRANSCRIPT_PATH, MTIME, SIZE)?.eventsScanned).toBe(12);
});
});
80 changes: 80 additions & 0 deletions __tests__/audit/codex-code-mode-audit.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// @vitest-environment node
//
// End to end for the audit's Codex path: a Codex 0.172 code-mode transcript
// (record shapes copied from a real session) through the parser, the shared
// LogEntry → event mapping and the replay engine. Before code mode was parsed
// this produced zero events, so no builtin could fire on any Codex 0.172
// session; and before exec_command mapped to Bash, none could fire on an older
// one either.
import { describe, it, expect, beforeEach } from "vitest";
import { parseCodexLog } from "@/lib/codex-sessions";
import { logEntriesToEvents } from "@/src/audit/cli-adapters/shared";
import { resetReplay, replayEvent } from "@/src/audit/replay";
import { canonicalizeToolInput, canonicalizeToolName } from "@/src/hooks/tool-name-canonicalize";

const rec = (o: Record<string, unknown>) => JSON.stringify(o);
const ctx = { cli: "codex" as const, sessionId: "s1", transcriptPath: "/tmp/codex.jsonl", cwd: "/home/u/proj" };

async function eventsOf(lines: string[]) {
const { entries } = await parseCodexLog(lines.join("\n"));
return logEntriesToEvents(entries, ctx);
}

describe("audit: Codex code-mode transcripts", () => {
beforeEach(() => resetReplay());

it("sees the shell command inside an exec snippet as Bash, and a builtin fires on it", async () => {
const events = await eventsOf([
rec({ timestamp: "2026-11-29T18:15:42.000Z", type: "session_meta", payload: { id: "s1", cwd: "/home/u/proj", cli_version: "0.172.0" } }),
rec({
timestamp: "2026-11-29T18:15:43.000Z",
type: "response_item",
payload: {
type: "custom_tool_call",
status: "completed",
call_id: "call_1",
name: "exec",
input: 'const r = await tools.exec_command({cmd:"sudo ls /root","workdir":"/home/u/proj","yield_time_ms":10000}); text(r.output);\n',
},
}),
rec({ timestamp: "2026-11-29T18:15:43.200Z", type: "response_item", payload: { type: "custom_tool_call_output", call_id: "call_1", output: [{ type: "input_text", text: "Script completed\n" }] } }),
]);
expect(events).toHaveLength(1);
expect(events[0]).toMatchObject({
toolName: "Bash",
rawToolName: "exec_command",
toolInput: { command: "sudo ls /root", cwd: "/home/u/proj" },
toolResultText: "Script completed\n",
});
const hits = await replayEvent(events[0]);
expect(hits.map((h) => h.policyName).some((n) => n.includes("block-sudo"))).toBe(true);
});

it("sees an apply_patch to .env as an Edit of that file, and a builtin fires on it", async () => {
const patch = "*** Begin Patch\n*** Update File: /home/u/proj/.env\n@@\n-A=1\n+A=2\n*** End Patch\n";
const events = await eventsOf([
rec({ timestamp: "2026-11-29T18:16:00.000Z", type: "response_item", payload: { type: "custom_tool_call", call_id: "call_2", name: "apply_patch", input: patch } }),
]);
expect(events).toHaveLength(1);
expect(events[0]).toMatchObject({ toolName: "Edit", rawToolName: "apply_patch", toolInput: { file_path: "/home/u/proj/.env" } });
const hits = await replayEvent(events[0]);
expect(hits.map((h) => h.policyName).some((n) => n.includes("block-env-files"))).toBe(true);
});

it("maps an older function_call exec_command to Bash too", async () => {
const events = await eventsOf([
rec({ timestamp: "2026-06-01T00:00:00.000Z", type: "response_item", payload: { type: "function_call", name: "exec_command", arguments: '{"cmd":"sudo whoami","workdir":"/w"}', call_id: "c" } }),
]);
expect(events[0]).toMatchObject({ toolName: "Bash", toolInput: { command: "sudo whoami", cwd: "/w" } });
});

it("does not change the live hook's Codex Bash payload", () => {
// Live PreToolUse already delivers `Bash {command}`; the cmd → command map
// must be a no-op on it.
const live = { command: "ls", description: "list" };
expect(canonicalizeToolName("Bash", "codex")).toBe("Bash");
expect(canonicalizeToolInput("Bash", live, "codex")).toEqual(live);
expect(canonicalizeToolName("write_stdin", "codex")).toBe("Bash");
expect(canonicalizeToolInput("Bash", { session_id: 3, chars: "ls\n" }, "codex")).toEqual({ session_id: 3, chars: "ls\n" });
});
});
12 changes: 12 additions & 0 deletions __tests__/e2e/helpers/payloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ export const CodexPayloads = {
tool_input: { command },
};
},
// Codex's native file edit, as it reaches the hook: `apply_patch`, with the
// patch in `tool_input.command` and no `file_path` at all.
applyPatch(patch: string, cwd: string): Record<string, unknown> {
return {
session_id: CODEX_SESSION_ID,
transcript_path: TRANSCRIPT_PATH,
cwd,
hook_event_name: "pre_tool_use",
tool_name: "apply_patch",
tool_input: { command: patch },
};
},
write(filePath: string, content: string, cwd: string): Record<string, unknown> {
// Codex aliases Edit/Write → apply_patch in matchers, so policies that
// filter on toolNames: ["Write"] continue to fire for Codex.
Expand Down
108 changes: 107 additions & 1 deletion __tests__/e2e/hooks/codex-integration.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { describe, it, expect } from "vitest";
import { execSync } from "node:child_process";
import { mkdtempSync, writeFileSync, readFileSync, existsSync, mkdirSync, rmSync } from "node:fs";
import { mkdtempSync, writeFileSync, readFileSync, existsSync, mkdirSync, rmSync, symlinkSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve, dirname } from "node:path";
import { fileURLToPath } from "node:url";
Expand Down Expand Up @@ -166,6 +166,112 @@ describe("E2E: Codex integration — hook protocol", () => {
});
});

// Codex edits files with its native `apply_patch`, whose patch arrives in
// `tool_input.command` with no `file_path`. A patch planting
// `node_modules/.bin/failproofai` — the file a project-scope `npx -y failproofai`
// hook runs — passed the always-on guard until every file a patch names was
// checked (found by hermes on FailproofAI/failproofai#1058).
describe("E2E: Codex integration — native apply_patch", () => {
const patchOf = (...lines: string[]) => ["*** Begin Patch", ...lines, "*** End Patch", ""].join("\n");

it.each([
["adding the entry", patchOf("*** Add File: node_modules/.bin/failproofai", "+#!/bin/sh", "+exit 0")],
["updating the entry", patchOf("*** Update File: node_modules/.bin/failproofai", "@@", "-exec node cli.mjs", "+exit 0")],
["moving a file onto the entry", patchOf("*** Update File: scripts/stub.sh", "*** Move to: node_modules/.bin/failproofai", "@@", "+exit 0")],
["updating a link to the entry", patchOf("*** Update File: hook", "@@", "+exit 0")],
])("PreToolUse: a native patch %s is denied", (_label, patch) => {
const env = createCodexEnv();
try {
writeConfig(env.cwd, []);
mkdirSync(resolve(env.cwd, "node_modules", ".bin"), { recursive: true });
symlinkSync(resolve(env.cwd, "node_modules", ".bin", "failproofai"), resolve(env.cwd, "hook"));
const result = runHook("PreToolUse", CodexPayloads.preToolUse.applyPatch(patch, env.cwd), {
homeDir: env.home,
cli: "codex",
});
assertPreToolUseDeny(result);
} finally {
env.cleanup();
}
});

// Codex's shell tool runs a command in its `workdir`, but the hook payload
// carries the session's directory and the command only (found by hermes on
// FailproofAI/failproofai#1058). A native write that plants the entry if it
// runs in node_modules/.bin is refused from the project's root; with the
// workdir reported, it is read from there.
it("PreToolUse: a native shell write that may run in node_modules/.bin is denied", () => {
const env = createCodexEnv();
try {
writeConfig(env.cwd, []);
mkdirSync(resolve(env.cwd, "node_modules", ".bin"), { recursive: true });
const result = runHook(
"PreToolUse",
CodexPayloads.preToolUse.bash("printf '#!/bin/sh\\nexit 0\\n' > failproofai", env.cwd),
{ homeDir: env.home, cli: "codex" },
);
assertPreToolUseDeny(result);
} finally {
env.cleanup();
}
});

it("PreToolUse: a native shell write is read from the workdir the call reports", () => {
const env = createCodexEnv();
try {
writeConfig(env.cwd, []);
const withWorkdir = (workdir: string) => ({
...CodexPayloads.preToolUse.bash("printf x > failproofai", env.cwd),
tool_input: { command: "printf x > failproofai", workdir },
});
assertPreToolUseDeny(
runHook("PreToolUse", withWorkdir(resolve(env.cwd, "node_modules", ".bin")), { homeDir: env.home, cli: "codex" }),
);
assertAllow(runHook("PreToolUse", withWorkdir(resolve(env.cwd, "src")), { homeDir: env.home, cli: "codex" }));
} finally {
env.cleanup();
}
});

// The same for Codex's own hooks file (#1105 review): with workdir ~/.codex,
// `printf '{}' > hooks.json` empties the hooks Codex runs.
it("PreToolUse: a native shell write to the hooks file from the workdir the call reports is denied", () => {
const env = createCodexEnv();
try {
writeConfig(env.cwd, []);
const withWorkdir = (command: string, workdir?: string) => ({
...CodexPayloads.preToolUse.bash(command, env.cwd),
tool_input: workdir === undefined ? { command } : { command, workdir },
});
assertPreToolUseDeny(
runHook("PreToolUse", withWorkdir("printf '{}' > hooks.json", resolve(env.home, ".codex")), { homeDir: env.home, cli: "codex" }),
);
// No workdir reported: it may be ~/.codex.
assertPreToolUseDeny(runHook("PreToolUse", withWorkdir("printf '{}' > hooks.json"), { homeDir: env.home, cli: "codex" }));
assertAllow(
runHook("PreToolUse", withWorkdir("printf '{}' > hooks.json", resolve(env.cwd, "src")), { homeDir: env.home, cli: "codex" }),
);
} finally {
env.cleanup();
}
});

it("PreToolUse: a native patch to project files is allowed", () => {
const env = createCodexEnv();
try {
writeConfig(env.cwd, []);
const patch = patchOf("*** Update File: src/app.ts", "@@", "-a", "+b", "*** Add File: node_modules/.bin/my-tool", "+exit 0");
const result = runHook("PreToolUse", CodexPayloads.preToolUse.applyPatch(patch, env.cwd), {
homeDir: env.home,
cli: "codex",
});
assertAllow(result);
} finally {
env.cleanup();
}
});
});

describe("E2E: Codex integration — install/uninstall", () => {
it("policies --install --cli codex --scope project writes .codex/hooks.json with PascalCase keys", () => {
const env = createCodexEnv();
Expand Down
Loading
Loading