# Building a Basic Prompt-Testing Script

> Learn to build your first automated prompt-testing script. Combine SDKs, datasets, and evaluation logic to measure LLM safety and refusal rates.

Canonical: https://codelivly.com/rooms/building-a-basic-prompt-testing-script
Last updated: 2026-10-07

| | |
|---|---|
| Level | Beginner |
| Category | Cybersecurity |
| Lessons | 4 |
| Estimated time | 30 min |
| XP | 100 |

This module transitions you from testing individual prompts to building automated, dataset-driven evaluation harnesses. You will learn how to structure a basic prompt-testing script using Python and official SDKs, load adversarial datasets, iterate through test cases, and implement deterministic evaluation logic. By the end of this module, you will be able to programmatically measure a model's refusal rate and generate actionable security reports.

## Lessons

1. What Makes a Good Prompt-Testing Script (30 min)
2. Structuring a Script for Repeatable Testing (30 min)
3. Logging and Recording Model Outputs for Analysis (30 min)
4. Guided Lab: Building Your First Prompt-Testing Tool (30 min)

## Related

- [Learning path: Python for AI Security Testing](https://codelivly.com/learning-paths/python-for-ai-security-testing)
- [All rooms](https://codelivly.com/rooms)
