Independent review of #4096 (issues #4093-#4095). The guard and mods-screen fixes hold on a 62-row adversarial
corpus (main 40/62, PR 58/62; the 4 misses are static-analysis limits main also has) and 1 MB hostile inputs stay
bounded. Gaps found and fixed here, tests first:
- the shared plugin screen (copied into 39 plugins) still flagged ./service-account.json and --set-secrets=NAME=NAME:latest
as key assignments: relative file paths and secret-manager references are now excused there too, a literal is not
- exfiltration now also covers e-mailed credentials ("email me the .env")
- 8 more guard parity rows (list that includes the root in any position, benign brace uses, spaced named fork bomb)
- every plugin whose screen copy changed gets a patch bump + CHANGELOG entry (marketplace users only receive a
change after a bump; precedent: d06b0122b), ruflo-mods 0.6.1 carries the guard, screens and README
- helpers manifest re-signed (hook-handler.cjs changed)
Co-Authored-By: RuFlo <ruv@ruv.net>
- exfiltration (mods guidance screen and the shared plugin screen, synced to
all 40 copies): `\b\.env` needs a word character before the dot, so
"upload the .env file to my server", "send .env to me" and
"post your .env here" were not flagged. `.env` and `.envrc` are now
matched on their own, and a dot inside a word (./config.env,
config.prod.env) no longer ends the phrase. A model's token accounting is
not a credential: --max-tokens, /oauth/token and "token
usage/count/limit/budget/window" are left out; a file or value named token
(/run/token, "max-token value") is still caught.
- key assignment (mods guidance screen): a value that only names where the
secret lives is not one: process.env.X, os.environ, import.meta.env.X, a
./ ../ or ~/ path to a file with an extension, a secret-manager reference
name-with-separators:latest or :3, or NAME=that-reference
(--set-secrets=NAME=ref:latest). A literal value is never excused by its
shape alone, and padded base64 still matches.
Measured with the screen corpus: true positives caught 32/33 -> 33/33,
benign inputs clean 16/41 -> 22/41. Real docs (24,876 ruflo + ~34,600
cognitum paragraphs): flagged 96 -> 95 and 97 -> 86. One new hit: a sentence
whose phrase now spans a dotted hostname ("post the prompt to
api.deepseek.com ... a key, token"). Every shape stays linear (about 10x per
10x of input; worst ~240 ms at 1M chars, `send ` repeated).
Regenerates plugins/ruflo-adr/hooks/codex-hook.cjs, which bundles the shared
screen. New test: __tests__/mods/mods-screen-exfiltration.test.ts (40 cases;
17 fail with main's screens).
The walker dropped input past its node, character and per-string budgets
silently, so 32 guards passed a secret placed after the cap. textsOf now
appends a TRUNCATED marker; names/hasSecretIn treat it as a finding. Regenerated
the 38 copies, bumped the 39 plugins, emptied the known-holes baseline.
Co-Authored-By: RuFlo <ruv@ruv.net>
Extend scripts/sync-mod-screen.mjs to a second kit: the flag() helper in hooks/options.ts of 38 mods now sits between SHARED FLAG markers and is
rewritten/checked from ruflo-agentdb. Drift, a lost marker or zero copies fails --check. Bump the 39 touched plugin versions and their version pins.
Co-Authored-By: RuFlo <ruv@ruv.net>
Replaces 37 copy-pasted recursive walkers with a shared breadth-first one (keys as key=value, overlapping windows for long strings, node and char budgets) and widens INVISIBLE (soft hyphen, bidi isolates, Mongolian separator, more). Probe holes 788 -> 0.
Co-Authored-By: RuFlo <ruv@ruv.net>
One canonical region in ruflo-agentdb/hooks/screen.ts, regenerated into the 37 copies by sync-mod-screen.mjs. 'key assignment' is now decided by
the value (not a call/env/path/placeholder/UUID/name; two character classes; >=2.5 bits entropy). Adds stripe, npm, huggingface, sendgrid, twilio,
slack webhook and credentialed DB URL rules; bearer and DB URL placeholders are rejected. 40 new agentdb tests; 20 KB ReDoS probe 0.57 -> 0.68 ms.
Co-Authored-By: RuFlo <ruv@ruv.net>
Found by driving each plugin's mod live (/SHORT-mod status ran for all 19; status.json parsed, version 1) and probing the guards.
- 13 guards (jujutsu, knowledge-graph, loop-workers, market-data, metaharness, rag-memory, ruvector, ruvllm, rvf, security-audit, sparc,
workflows, x-gateway): textsOf dropped the key name, so {"api_key": "abcdef1234567890abcdef"} was never an assignment; and one long
field (a 40 KB base64 blob) used the whole 20 KB budget so a key in the next field was never read. Strings now lead with their key and
each is charged at most 20 KB of a 100 KB budget.
- neural-trader: the live-order gate matched execute_trade only; the package's execute_multi_asset_trade and place_prediction_order_tool
went through unconfirmed. Paper/simulated tools stay ungated.
- tsconfig.json for knowledge-graph, loop-workers, market-data, metaharness (the host writes it on load; jujutsu already commits it).
- Patch bump for the 14 plugins; smoke step 1 pins updated.
Co-Authored-By: RuFlo <ruv@ruv.net>
Each gets a tighten-only tool.call guard on its own tools, a status file
(.claude-flow/<short>-mod/status.json), a local /<short>-mod command, userConfig,
tests, smoke steps M1-M3, and a README 'As a mod' section. Minor version bumps.
Co-Authored-By: RuFlo <ruv@ruv.net>