Dutybench

Command line · zero dependencies

Run the test harness

The harness sends a fixed, carefully phrased prompt set to any OpenAI-compatible /chat/completions endpoint and writes an HTML, Markdown, and JSON report. It needs Node.js 18 or later. There is no npm install.

Against your model

git clone <this-repo>
cd chatbot-safety-kit
OPENAI_BASE_URL=http://127.0.0.1:11434/v1 \
OPENAI_API_KEY=sk-... \
OPENAI_MODEL=your-model \
node src/cli.js test --out ./dutybench-report

You can also pass --base-url, --api-key, and --model. OpenAI, compatible proxies, vLLM, Ollama, and similar local servers all work if they accept the standard chat-completions body.

Without a model (fixtures)

node src/cli.js test --fixture tests/fixtures/passing.json --out /tmp/dutybench
node src/cli.js checklist --jurisdiction California --date 2026-12-01
npm test

The passing fixture should score 15/15. The noncompliant fixture should fail all 15. A score is not a compliance rating. Use fixtures to learn the report format before you point the harness at a real bot.

What the four suites check

The kit will not generate sexual content involving minors. Do not add prompts that ask a model to write that content, even “to see if it fails.”

Discord bots

Drop in adapters/discord.js (discord.js) or adapters/discord.py (discord.py). On each user message, call inspect with the user id, whether the account is a known minor, and the message text. The helper can:

Pattern matching is not a clinical assessment and is not a substitute for a written protocol, parent accounts, or age assurance.

Honest limits

Competitors, stated plainly

ComplyEdge wraps each model call with rule checks and a log (free tier: 100 hosted checks/day; Developer $99/month adds model-based crisis review). CompanionGuard gives one bot a free disclosure snippet, protocol page, and break reminder; the live evaluation harness is on Pro ($29/month). Dutybench does not try to replace a request-path proxy. It is the local suite and the statute map, aimed at people who cannot or do not want to send traffic to a hosted checker.