AI Security Regression Testing Platform
Project description
๐ Overview
Krucible is a production-grade regression testing platform designed explicitly for Large Language Models and AI applications. As AI models update dynamically, their safety guardrails frequently drift. What was secure yesterday might leak PII today.
Krucible automates AI Security Regression Testing. It executes adversarial payloads (Prompt Injections, Jailbreaks) against your AI models, evaluates the outputs against strict security policies, and calculates semantic drift across CI/CD pipeline runs.
Why Krucible Exists
Traditional testing tools calculate binary JSON or text diffs. AI requires semantic evaluation. Krucible completely separates the execution engine from the security payloads. Developers build the pipelines; Security Researchers write the YAML payloads.
โจ Features
- Configuration-Driven: Zero Python modifications required. Define attacks and policies purely in
.ymlfiles. - Engine Orchestration: Robust Dependency Injection architecture executing complex multi-stage evaluations securely.
- Regression Detection: Tracks policy flips, semantic similarity drifts, and tool-usage deviations.
- Three Testing Journeys:
- AI Providers: Direct testing of foundation models (
OpenAI,Anthropic,Gemini,OpenRouter,Groq,Ollama). - AI Applications: Test your deployed custom APIs. Krucible attempts to auto-detect payload structure (JSON input and output mapping), with manual override available.
- Native Python Agents: Hook directly into un-deployed frameworks (
LangChain,CrewAI,FastAPI).
- AI Providers: Direct testing of foundation models (
- CI/CD Ready: Generates strictly-typed machine-readable JSON artifacts and beautiful Rich terminal outputs with deterministic exit codes.
๐ Quick Start
Installation
Install Krucible via pip:
pip install krucible
Initialization & Onboarding
Set up a new Krucible project using the interactive wizard:
python -m krucible quickstart
This journey-based wizard will guide you through testing an AI Provider, a custom AI Application, or a Native AI Agent, attempting to auto-detect structures where possible.
Running Tests
Execute your security regression test suite:
krucible test
Output:
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ AI Security Regression Test Results โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Target: Custom custom โ
โ Duration: 1250.00ms โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Attacks Executed: 2
Policies Evaluated: 2
Execution Results
โโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโ
โ Attack โ Status โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Prompt Injection โ [FAIL] โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโค
โ Ignore Guardrails โ [PASS] โ
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
Summary
Passed: 1
Failed: 1
Regressions: 0
Exit Code: 1
โ๏ธ Configuration
Your krucible.yml controls the orchestrator targeting.
OpenAI Example
version: v1
target:
adapter: openai
model: gpt-4o
regression:
similarity_threshold: 0.85
Custom REST API Example
version: v1
target:
adapter: custom
model: custom
regression:
similarity_threshold: 0.85
(Requires KRUCIBLE_CUSTOM_URL, KRUCIBLE_CUSTOM_PAYLOAD_KEY, and KRUCIBLE_CUSTOM_OUTPUT_KEY in .env)
๐๏ธ Architecture Overview
Krucible enforces Domain-Driven Design:
- Loaders:
AttackLoaderandPolicyLoaderparse local YAML into frozen Pydantic Models. - Adapters: Anti-corruption layers (Strategy Pattern) wrapping external SDKs (
OpenAIAdapter,GeminiAdapter). - Orchestrator: Dispatches payloads to the Target and routes responses to the
PolicyEngine. - Regression Engine: Compares the current
Evaluationset against the localBaselineStore. - Report Engine: Fans out
ReportSummarymodels to standard out (CLI) and disk (JSON).
๐บ๏ธ Roadmap
- Phase 2: Multi-turn Conversation Attacks, LLM-as-a-Judge Policy Evaluators, Ollama Native Integration.
- Phase 3: Extensible Plugin ecosystem (
krucible install owasp-top-10). - Phase 4: Visual HTML Reporting generation.
๐ค Contributing
We welcome community contributions! Please review our Contributing Guide and Code of Conduct.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file krucible-0.1.0.tar.gz.
File metadata
- Download URL: krucible-0.1.0.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6afe2f4b3804bbb9189e5623e64a1e298dcffca14e506bbdecb3a4064ba67d
|
|
| MD5 |
862b2c87552d7e8b1ec80e5e25aae70a
|
|
| BLAKE2b-256 |
3e543b7e55375a2e640de8f2f6afb445806573d8224d846cec1e5bb606846e96
|
File details
Details for the file krucible-0.1.0-py3-none-any.whl.
File metadata
- Download URL: krucible-0.1.0-py3-none-any.whl
- Upload date:
- Size: 56.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc485f0256d3e6fc10ea0479dafaa3f958ff871c0550141ced3c10056e1d1f9b
|
|
| MD5 |
b18f6fdf943d4834ee6b59cec56081aa
|
|
| BLAKE2b-256 |
b0fbcd9881f6c853f031ea001a539528edb0c1fa9c97a05a56974823037fb2d8
|