Explore generative AI risks through the lens of cognitive biases. Generate detailed risk scenarios powered by OpenAI.
The Cognitive Threat Matrix is an interactive web tool that maps cognitive biases to generative AI risks, helping organizations identify and mitigate threats before they escalate. Users can explore four threat categories, select from 20 pre-built scenarios, or write custom prompts to generate detailed AI-powered risk analyses.
- Four Threat Categories — Hallucination, Skewed Data, Verification Failure, and Ethical Blindspot
- 20 Sample Scenarios — Pre-built questions across all threat categories for quick exploration
- AI-Powered Analysis — Generates structured risk reports using OpenAI GPT-4o-mini
- Dark/Light Theme — Toggle between dark and light modes with persistent preference
- Zero Dependencies — Single HTML file with no build tools or frameworks required
- Responsive Design — Works on desktop and mobile devices
| Category | Technology |
|---|---|
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| AI/LLM | OpenAI GPT-4o-mini |
| Styling | CSS Custom Properties (Dark/Light theming) |
| Deployment | GitHub Pages + GitHub Actions |
┌─────────────────────────────────────────────┐
│ Browser │
│ │
│ ┌──────────┐ ┌──────────┐ ┌───────────┐ │
│ │ Theme │ │ Threat │ │ Sample │ │
│ │ Toggle │ │ Matrix │ │ Questions│ │
│ └──────────┘ └──────────┘ └───────────┘ │
│ │
│ ┌──────────────────────────────────────┐ │
│ │ Prompt Input Area │ │
│ └──────────────┬───────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ OpenAI API (fetch) │───┼──► api.openai.com
│ └──────────────┬───────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ Formatted Risk Analysis Output │ │
│ └──────────────────────────────────────┘ │
└─────────────────────────────────────────────┘
genaiethics/
├── index.html # Main application (HTML + CSS + JS)
├── screenshot.png # Auto-captured site screenshot
├── README.md # Project documentation
└── .github/
└── workflows/
└── deploy-pages.yml # GitHub Pages deployment workflow
- A modern web browser (Chrome, Firefox, Safari, Edge)
- An OpenAI API key
-
Clone the repository
git clone https://github.com/alfredang/genaiethics.git cd genaiethics -
Open in browser
open index.html
Or simply double-click
index.htmlin your file manager. -
Enter your OpenAI API key and start exploring AI risk scenarios.
- Enter your OpenAI API key in the input field
- Click one of the four threat category cards
- Select a sample scenario or type your own question
- Click Generate to receive a structured risk analysis
- Toggle dark/light theme using the button in the top-right corner
This project is deployed automatically to GitHub Pages via GitHub Actions. Every push to main triggers a new deployment.
To deploy your own instance:
- Fork this repository
- Enable GitHub Pages in your repo settings (Source: GitHub Actions)
- Push to
main— the workflow handles the rest
| Cognitive Bias | AI Threat | Description |
|---|---|---|
| Automation Bias | The Hallucination Threat | Blindly trusting AI outputs, accepting fabricated information as factual |
| Confirmation Bias | The Skewed Data Threat | Training models on narrow data that reinforces preconceived hypotheses |
| Overconfidence | The Verification Failure | Assuming past AI accuracy guarantees future correctness |
| Groupthink | The Ethical Blindspot | Rushing AI adoption without sufficient debate or ethical review |
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Join the discussion in Issues.
