███████████ ███████████ █████████ █████
░░███░░░░░░█░░███░░░░░███ ███░░░░░███ ░░███
░███ █ ░ ░███ ░███ ░███ ░███ ░███
░███████ ░██████████ ░███████████ ░███
░███░░░█ ░███░░░░░███ ░███░░░░░███ ░███
░███ ░ ░███ ░███ ░███ ░███ ░███
█████ █████ █████ █████ █████ █████
░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░
The compliance check that lives in your CI. Is your product legal about telling people AI is involved? FRAI blocks the build until you can prove it.
The sharpest example today is EU AI Act Article 50, enforceable since 2 August 2026: people must be told when they talk to an AI system or see AI-generated content. It is not the only rule FRAI asks about. The gate covers seven responsible-AI checks, from risk tier to monitoring.
FRAI is open source. It does three things:
frai gateputs a spec in your repo and fails CI until the responsible-AI questions are answered.frai scanfinds AI libraries and AI function calls in your code.frai generatewrites a checklist, model card, and risk file from a short questionnaire.
Works in any repo and any language. You need Node 18 or newer to run it.
npx frai-gate init --ciThis writes two files:
FRAI-SPEC.md: a spec template with the FRAI Gate section built in..github/workflows/rai-gate.yml: a GitHub Action that runs the gate on every pull request and every push tomain.
Commit both. The build now fails until the spec is answered. Fill in the gate, then check it locally:
npx frai-gate check FRAI-SPEC.mdThe check is deterministic. It needs no API key and no LLM.
- Risk tier (prohibited, high, limited, minimal). High risk needs a named human sign-off.
- Data and privacy
- Human oversight
- Evaluation plan (needs numbers)
- Bias and fairness
- Monitoring and rollback (needs numbers)
- Transparency and incidents (this is where AI disclosure goes)
Verdicts: PASS and WARN exit 0. BLOCK exits 1. Usage errors exit 2.
What the check does not do: it does not read your product or give legal advice. It checks that your spec answers each question with real content. Pair it with --smart or a human review to judge whether the answers are good.
Two commands use a read-only agent built on the Claude Agent SDK. They need Claude Code authentication or ANTHROPIC_API_KEY.
npx frai-gate draft # reads your code and drafts the gate section
# with file:line citations (writes rai-gate-draft.md)
npx frai-gate check FRAI-SPEC.md --smart # adds an AI review of vague or contradicted answersOther flags: init --out <file>, check --json, draft --out <file>, draft --print. Set FRAI_GATE_MODEL to change the model.
npx skills add sebuzdugan/frai-skillsThis installs the responsible-ai-spec skill. Specs your agent writes include the gate, and the agent may not self-approve high-risk features.
Worked example: examples/support-triage-demo/. Design notes: docs/rai-gate-design.md.
npm install -g fraifrai bundles the gate, so frai gate init --ci, frai gate check FRAI-SPEC.md, and frai gate draft work the same as the npx frai-gate commands above.
| Command | What it does |
|---|---|
frai gate init [--ci] |
Write FRAI-SPEC.md. With --ci, also write the GitHub Action. |
frai gate check <spec> [--smart] [--json] |
Validate the gate section. Exits 1 on BLOCK. |
frai gate draft |
Draft gate answers from your code (Claude Agent SDK). |
frai scan [--ci] [--json] |
Regex scan for ML library imports and common AI function names. |
frai / frai generate |
Questionnaire that writes checklist.md, model_card.md, risk_file.md. |
frai docs list / clean / export |
List, delete, or export the generated docs to PDF. |
frai setup [--key <key>] [--global] |
Store an OpenAI API key (optional, see below). |
frai config |
Show where an API key is configured. |
frai update |
Check npm for a newer frai release. |
Pattern matching, not semantic analysis. It uses regexes to find imports of known ML libraries (for example tensorflow, torch, sklearn, transformers) and calls to common function names (for example fit, predict, generate) in .py, .ipynb, .js, .ts, .jsx, .tsx, .r, .java, and .scala files. The library list does not yet include LLM API SDKs such as openai. Generic names like fit or transform can match non-AI code. Use it as a quick inventory, not as proof. --json prints raw results.
Run frai or frai generate. It asks about your AI feature and writes three markdown files to the current directory: checklist.md, model_card.md, and risk_file.md.
--scanrunsfrai scanfirst.--export-pdfexports the docs to PDF withmarkdown-pdf(fetched throughnpx).frai docs exportdoes the same later.- No API key is needed. If an OpenAI key is set with
frai setuporOPENAI_API_KEY, FRAI adds AI-written tips to the docs. Without one, the tips are skipped.
- Web scanner: frai.cc. Paste a URL and get a disclosure snapshot of that site.
- Done-for-you audit: The AI Disclosure Teardown.
| Package | Version | What it is |
|---|---|---|
frai |
1.1.5 | The CLI. |
frai-gate |
0.0.1 | The gate. Runs as npx frai-gate, or import validateSpec from it. |
frai-core |
0.0.2 | The SDK behind the CLI: Questionnaire, Documents, Scanners, Config, Providers. |
frai-agent |
not published | LangChain experiment in this monorepo. Not supported. |
Using the gate from code:
import fs from 'node:fs/promises';
import { validateSpec } from 'frai-gate';
const result = validateSpec(await fs.readFile('FRAI-SPEC.md', 'utf8'));| Project | Status | What it is |
|---|---|---|
| frai-skills | Active | Agent skill for the FRAI Gate spec workflow. |
| frai-benchmark | Frozen, maintained as reference | Safety and compliance benchmark with a leaderboard. |
| frai-chat | Frozen, maintained as reference | Browser-based responsible-AI assistant. Demo. |
pnpm install
pnpm --filter frai-gate build
pnpm --filter frai build
node packages/frai-cli/dist/index.js --help- Bump versions in
packages/frai-gate,packages/frai-core, andpackages/frai-cli. - Set dependency ranges to the versions you are about to publish, for example
"frai-gate": "^0.0.1"and"frai-core": "^0.0.2". Never publish withworkspace:*. - Build:
pnpm --filter frai-gate build pnpm --filter frai-core build pnpm --filter frai build
- Publish in dependency order:
frai-gate, thenfrai-core, thenfrai.cd packages/frai-gate && npm publish cd ../frai-core && npm publish cd ../frai-cli && npm publish
- Verify with
npm view frai version,npm view frai-core version,npm view frai-gate version.
These commands exist but are not ready for real use.
frai rag index: builds a JSON index whose "embeddings" are 8-number character-code checksums. Not semantic search.frai eval: its toxicity metric is a six-word wordlist.frai finetune template/validate: lints a fine-tuning governance plan JSON. It trains nothing.
MIT licensed. Website: frai.cc.

