PromptForge is a browser-based AI red teaming workbench for testing LLM and agent behavior against realistic prompt-injection, tool-abuse, and excessive-agency scenarios. It gives you a structured place to run attack templates, compare providers, inspect prompts, and generate defensive analysis reports.
The project is built with React, TypeScript, and Vite. It runs locally and calls provider APIs directly from your browser.
- OWASP-style LLM attack templates for prompt injection, insecure output handling, sensitive-data disclosure, excessive agency, insecure plugin design, model theft, and related agent risks.
- Multi-provider testing with Gemini, OpenAI, Claude/Anthropic, and local Ollama models.
- In-app API key entry for Gemini, OpenAI, and Claude. Keys are saved only in browser localStorage.
- Adversarial Mode, where a Gemini-powered red-team assistant suggests the next attack prompt for templates that define a goal.
- Defense Analysis, where a Gemini-powered AISecOps analyst summarizes conversation risk and recommends mitigations.
- Prompt debugger with injection keyword highlighting.
- Custom attack template manager saved in browser storage.
- Simulated agent tools for testing tool-use behavior and agency boundaries.
- Response caching for repeatable experiments.
- React 19
- TypeScript
- Vite
- Google Generative AI SDK
- Direct browser
fetchintegrations for OpenAI, Anthropic, and Ollama
- Node.js 18 or newer
- npm
- At least one provider key if you want to test hosted models:
- Gemini API key from Google AI Studio
- OpenAI API key
- Anthropic API key
- Optional: Ollama installed locally for local model testing
npm install
npm run devOpen the local URL printed by Vite, usually:
http://localhost:3000
PromptForge expects API keys to be entered in the app.
Use the left-side Configuration panel:
- Select a provider: Gemini, OpenAI, Claude, or Ollama.
- Paste the API key or base URL in the API Credentials box.
- Wait for the validation indicator.
- Choose a model and start testing.
These values are stored in your browser localStorage under this app's origin. They are not written to project files.
The dropdown includes current text/chat model IDs for:
- Gemini:
gemini-3.5-flash,gemini-3.1-pro-preview,gemini-3-flash-preview, and stable Gemini 2.5 models. - OpenAI: GPT-5.5, GPT-5.4, GPT-5, GPT-4.1, and GPT-4o family models.
- Claude: Claude Opus 4.7, Sonnet 4.6, Haiku 4.5, and recent 4.x/3.x fallbacks.
- Ollama: common local model names such as
qwen3.5,glm-5.1,mistral-medium-3.5,llama4,qwen3,gemma3,deepseek-r1, and others.
Model availability can depend on your provider account, region, access tier, and local Ollama pulls. If a model returns a provider error, choose another model from the same provider or confirm access in the provider dashboard.
Install Ollama from:
https://ollama.com/
Pull the models you want to use. Example:
ollama pull qwen3
ollama pull gemma3
ollama pull deepseek-r1Set the Ollama Base URL in PromptForge:
http://localhost:11434
If the browser cannot connect, configure Ollama CORS.
Set a system environment variable:
OLLAMA_ORIGINS=*
Restart Ollama, or restart your computer.
launchctl setenv OLLAMA_ORIGINS "*"Then restart Ollama.
sudo systemctl edit ollama.serviceAdd:
[Service]
Environment="OLLAMA_ORIGINS=*"Then run:
sudo systemctl daemon-reload
sudo systemctl restart ollamanpm run devStarts the Vite development server.
npm run buildBuilds the production bundle into dist/.
npm run previewServes the production build locally.
npm run lintRuns TypeScript checks with tsc --noEmit.
.
├── App.tsx
├── constants.ts
├── index.html
├── index.tsx
├── types.ts
├── vite.config.ts
├── components/
├── services/
│ └── llmService.ts
├── package.json
└── README.md
- This is a client-side research tool. API calls are made from the browser.
- Browser-stored keys are convenient for local use, but they are not appropriate for a shared or public deployment.
- Do not deploy this app publicly with direct user-supplied provider keys unless you understand the security and billing risks.
- Never commit real API keys, logs containing keys, or exported browser storage.
- Red-team templates can intentionally produce unsafe prompts or outputs. Use the tool only in authorized testing environments.
Before pushing:
npm install
npm run lint
npm run buildCheck that these generated or local-only folders are not committed:
node_modules/dist/- local logs
The selected model may not be available for your API version, account, or region. Try gemini-3.5-flash or gemini-3-flash-preview.
Those features require a Gemini key. Select Gemini in the Configuration panel and paste your Gemini API key in the API Credentials box.
Some models require account access or have provider-specific parameter restrictions. Try a smaller or older model from the dropdown.
Confirm Ollama is running, the model is pulled, the base URL is correct, and OLLAMA_ORIGINS=* is configured if your browser blocks the request.
Pull requests are welcome. Keep changes focused, run the checks above, and avoid committing generated files or secrets.