# gandalf-llm-pentester

gandalf-llm-pentester automates security testing of prompt defenses across 7 challenge tiers on Lakera Gandalf. Useful when checking how language models resist injection attempts.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 252 installs · ★ 13 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/security-skills/tree/HEAD/skills/gandalf-llm-pentester/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/gandalf-llm-pentester

## What it does

This skill executes red-team routines against Lakera Gandalf challenge endpoints. It runs 64+ test prompts across 7 defense tiers. The prompts escalate quickly. An integrated `claude-3-5-sonnet-20241022` instance inspects model output to spot leaked secrets in plain text, NATO phonetics, or Base64 encoding.

The codebase organizes calls around a `BaseLLMAPI` interface. The `GandalfAPI` client applies a 0.3-second pause between HTTP requests via `requests` to respect rate limits. This throttle avoids server blocks. Local runs require Python alongside the `anthropic` and `jupyter` packages.

Without an `ANTHROPIC_API_KEY` set in your environment, validation halts completely. That key is mandatory. Tests execute through `notebooks/gandalf_llm_pentester_gm.ipynb` or inside a hosted Google Colab workspace.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill gandalf-llm-pentester -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/gandalf-llm-pentester/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/gandalf-llm-pentester/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill gandalf-llm-pentester -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/gandalf-llm-pentester/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill gandalf-llm-pentester -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/gandalf-llm-pentester/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/security-skills skills/gandalf-llm-pentester
```

2. **Manually: put the files in place**
- File: `.github/skills/gandalf-llm-pentester/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill gandalf-llm-pentester -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/security-skills --path skills/gandalf-llm-pentester
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/gandalf-llm-pentester/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/security-skills --skill gandalf-llm-pentester -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/security-skills/tree/HEAD/skills/gandalf-llm-pentester/SKILL.md

## When to use it
- stress-test prompt injection defenses across 7 Gandalf tiers
- automate execution of 64+ red-team prompt variations
- verify secret leakage concealed in Base64 or NATO phonetic strings
- generate vulnerability assessments verified by Claude API

## Example prompts
- Run gandalf pentester attacks against level 1 defenses
- Assess LLM defense mechanisms using gandalf-llm-pentester
- Validate prompt injection defenses across all Gandalf stages

## Similar
- [llm-risk-assess](https://affpapa.org/en/nevibecode/skills/llm-risk-assess.md) — skill · 186 installs
- [llm-ai-hunter](https://affpapa.org/en/nevibecode/skills/llm-ai-hunter.md) — skill · ★ 1298 repo stars
- [llm-redteam-specialist](https://affpapa.org/en/nevibecode/agents/llm-redteam-specialist.md) — subagent · 139 installs
- [16-ai-llm-security](https://affpapa.org/en/nevibecode/skills/16-ai-llm-security.md) — skill · ★ 71 repo stars
- [ai-system-testing](https://affpapa.org/en/nevibecode/skills/ai-system-testing.md) — skill · 1400 installs
- [ai-red-teaming](https://affpapa.org/en/nevibecode/skills/ai-red-teaming.md) — skill · 401 installs

From the same set: [reason-machines/security-skills](https://affpapa.org/en/nevibecode/by/reason-machines/security-skills.md) — 129 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
