frai
v1.2.1
Published
FRAI - Framework of Responsible Artificial Intelligence
Maintainers
Readme
frai
Does your product tell people it uses AI? One command checks your code, your live site and your spec, and tells you the one thing to fix.
npx fraiNo key, no signup, no flags. Node 18 or newer.
FRAI review: support-app
Code AI found 3 files using openai
Site https://support.example.com/ needs a notice
Chat tool found. No AI disclosure found. · found: Intercom
Spec FRAI-SPEC.md BLOCK
Human oversight · Escalation path needs your answer: …
Next answer the 4 open fields in FRAI-SPEC.md, then: npx frai gate check FRAI-SPEC.mdCommands
| Command | What it does |
|---|---|
| frai | Review this project: code, live site, spec, next step. |
| frai check <site> | Check any site, no repo needed. --email [email protected] sends the full page-by-page report; add --watch to re-check it monthly. |
| frai init | Add FRAI-SPEC.md and the GitHub Action that runs the gate on every pull request. |
| frai draft | Fill the spec from your code, then write it into FRAI-SPEC.md. |
| frai gate check FRAI-SPEC.md | Run the gate. Exits 1 on BLOCK. |
Flags on frai: --ci (exit 1 when something needs fixing), --json, --offline (skip the site check), --url <site> (override the detected site).
What it does for you
- Finds your site. From
homepageinpackage.json, thenNEXT_PUBLIC_SITE_URL,SITE_URLorAPP_URLin.env*, then the first real link in your README. - Finds your AI. Model calls in your code, and AI SDKs in
package.json,requirements.txt,pyproject.tomlorPipfile. It skips hidden folders,node_modulesand build output. - Checks the live site through frai.cc: your homepage and policy pages, with the homepage loaded in a real browser so JavaScript chat widgets are found. It respects robots.txt (how it reads sites).
- Drafts honestly.
frai draftuses your local Claude (Claude Code login orANTHROPIC_API_KEY), so nothing leaves your machine. Without one, frai.cc drafts it after listing the files it would send and asking. Anything your code doesn't show becomesNEEDS HUMAN INPUT: <question>, and the gate blocks until a person answers.
In CI
- run: npx frai --ciFails when the live site is missing a notice, the gate blocks, or AI code has no spec. If frai.cc can't be reached, the site check is skipped rather than failing your build.
Older tools
frai scan lists AI libraries and calls in your code. frai generate asks about your AI feature and writes checklist.md, model_card.md and risk_file.md (an OpenAI key adds AI-written tips). frai rag, frai eval and frai finetune are experiments.
