chore(security): externalise confidentiality term list

Moves the list of private organisation / pilot / codename
strings the security gate blocks OUT of the repo entirely.

Before: tools/security/check-staged.sh + the Today AI prompt
+ docs/today-pipeline.md held the strings in plaintext. The
whole point of the gate is to keep certain strings out of
committed artefacts, so holding them in a committed
artefact was self-defeating — anyone with read access to
the repo trivially recovered the very list we tried to
protect.

After:

- The gate reads a runtime file
  `${FAI_BANNED_TERMS_FILE:-~/.fai-security/banned-terms.txt}`
  at scan time. One regex per line, `#`-prefixed comments,
  matched case-insensitively against staged diffs and
  commit messages. Repos contain no copy.
- Pre-commit / commit-msg modes log a warning + skip the
  confidential-terms scan if the file is missing (fresh
  checkouts shouldn't trip until the operator bootstraps
  the list).
- CI mode (`check-staged.sh ci`) FAILS when the file is
  missing — runners are expected to be bootstrapped by
  their deploy step.
- The unit-test harness uses a synthetic placeholder term
  (`SYNTHETIC_BANNED_TERM_XYZZY`) injected via a temp
  banned-terms file, so the test never references real
  customer names.
- docs/today-pipeline.md + tools/today/prompt.template.md
  point at the runtime file instead of enumerating terms.

Operator bootstrap (one-time, per machine):

  mkdir -p ~/.fai-security && chmod 700 ~/.fai-security
  printf '\\b%s\\b\\n' TERM_A TERM_B > ~/.fai-security/banned-terms.txt
  chmod 600 ~/.fai-security/banned-terms.txt

Gate self-tests: 18 passed, 0 failed.

Signed-off-by: flemming-it <sf@flemming.it>
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-25 21:06:17 +02:00
parent 21c2a0f411
commit efa9871a75
4 changed files with 84 additions and 20 deletions

View file

@ -83,9 +83,12 @@ The prompt template (`tools/today/prompt.template.md`) hard-encodes:
`feedback_no_marketing_speak.md` is included in the prompt: ban
"viral", "killer", "powerful", "just works", "revolutionary",
"game-changing".
4. **No private references.** Generic terms only; no
ITDZ / Kammergericht / HTW / J∆I per
`feedback_confidentiality.md`.
4. **No private references.** Generic terms only — no pilot
customer names, internal codenames, or specific
institutions. The operator's banned-terms list lives at
`~/.fai-security/banned-terms.txt` (outside the repo on
purpose; gated by the pre-commit hook in
`tools/security/check-staged.sh`).
5. **Concrete CTA.** Every story names exactly one action the operator
can take in Studio (which page, which button).
6. **Body fits in ~3 sentences.** Hero card height is fixed; longer