Prompt Nutrition

AI prompt safety reviewer: scores risks, suggests fixes, and generates safe red-team tests.

Prompt Nutrition

Created At

Open Agents

Project Description

Prompt Nutrition Facts is a project I built to make AI prompt security easy to review. You paste a system prompt, and it produces a structured safety analysis with a risk score, category-level guardrail checks, vulnerability explanations, concrete fixes, an improved prompt draft, and safe red-team test scenarios. It helps teams catch prompt weaknesses before deploying AI agents.

How it's Made

Built as a full-stack web app with:

Frontend: Next.js + React + TypeScript + Tailwind CSS for the prompt input flow and safety review UI. Backend API: a server route at app/api/analyze/route.ts that receives the prompt and runs structured safety analysis. AI analysis engine: OpenAI Responses API with a strict JSON schema, plus a deterministic local/demo fallback analyzer so reviews still work if API access fails. Scoring logic: category-based safety checks (injection resistance, privacy boundaries, tool-use safety, refusal clarity, etc.), vulnerability generation, recommendations, and improved prompt drafting. Persistence: lightweight local audit history utilities to keep previous analyses accessible in the UI. Blockchain component (hackathon exploration): Hardhat + ethers smart-contract flow for privacy-preserving audit proof registration (the current UI is focused on prompt review).

background image mobile

Join the mailing list

Get the latest news and updates

Prompt Nutrition | ETHGlobal