Warden - AI Code Guardian for comprehensive code validation
Project description
Warden Core - The AI Code Guardian
"AI writes the code. Warden guards the production."
Warden is an AI-native security and quality gate designed to validate code generated by LLMs (Claude, GPT-4, etc.) before it enters your codebase. It acts as a strict, impartial judge that enforcing architectural rules, preventing security vulnerabilities, and maintaining code hygiene.
🤖 Why Warden?
AI coding assistants are powerful but prone to:
- Hallucinations: Inventing non-existent APIs or libraries.
- Subtle Bugs: Introducing edge cases that human reviewers miss.
- Security Flaws: Hardcoding secrets or using unsafe patterns.
- Drift: Deviating from established project architecture.
Warden provides the "Verify-Loop" mechanism to ensure every AI-generated change is validated against a rigorous set of rules.
🚀 Core Features
1. 🧠 AI-Native Integration (MCP & Hooks)
Warden is built to integrate directly with your AI Agent:
- Context Loading: Automatically injects
.warden/AI_RULES.mdinto every session via ClaudeSessionStarthooks. - Protocol Enforcement: Instructs AI agents to follow the Plan -> Execute -> Verify loop.
- Feedback Loop: Provides JSON/SARIF reports that AI agents can read to self-correct.
2. 🛡️ The 6-Frame Validation Pipeline
Warden runs your code through 6 specialized "Frames":
- SecurityFrame (Critical): Detects SQLi, XSS, and hardcoded secrets.
- ChaosEngineeringFrame (High): Validates error handling and resilience patterns.
- FuzzTestingFrame (High): Checks for type safety and edge case handling.
- PropertyTestingFrame (Medium): Verifies idempotency and invariants.
- ArchitecturalConsistencyFrame (Medium): Enforces SOLID principles and file limits.
- StressTestingFrame (Low): Identifies performance bottlenecks (N+1 queries).
3. 🚦 False Positive Management
Warden gives you granular control over what to check:
- Inline Suppression: Use
# warden-ignore: rule-idto suppress specific issues. - Global Config: Define suppressions in
.warden/suppressions.yaml. - File Exclusion: Respects
.gitignoreand supports.warden/ignore.yaml.
🏁 Quick Start
Installation
pip install warden-core
Initialization (The Critical Step)
To setup Warden for your project and configure your AI Agent:
warden init --agent
This command:
- Analyzes your project structure.
- Creates
.warden/AI_RULES.md. - Configures Claude Code hooks (
.claude/settings.json) to auto-load rules. - Sets up MCP configuration.
- Creates
.envand.env.examplefor your API keys.
The "Verify-Loop" Protocol
AI Agents working in a Warden project follow this strict protocol:
- PLAN: Design the change (Task or Phase).
- EXECUTE: Implement the code.
- VERIFY: Run
warden scanat the end of the task/phase.- IF PASS: Display Quality Score (X/10) 🚀
- IF FAIL: Fix issues and Repeat.
🛠️ Command Reference
| Command | Description |
|---|---|
warden scan |
Runs the full validation pipeline on the project. |
warden validate <file> |
Scans a single file for immediate feedback. |
warden serve |
Starts the MCP Server for AI integration. |
warden doctor |
Checks project health and configuration status. |
warden install |
Installs/Updates validation frames. |
warden search <query> |
Searches Warden Hub or local codebase. |
📂 Project Structure
.
├── .warden/
│ ├── AI_RULES.md # Protocol for AI Agents
│ ├── config.yaml # Pipeline configuration
│ ├── ignore.yaml # File exclusions
│ ├── suppressions.yaml # False positive rules
│ └── reports/ # Scan results (JSON, SARIF)
├── .claude/
│ └── settings.json # Hooks for auto-loading context
└── src/ # Your source code
🧩 Architecture
Warden is designed with modular "Frames" and extends easily:
- Pipes & Filters: Sequential execution pipeline.
- Priority Groups: Critical security checks run first (Fail-Fast).
- LSP Synergy: Uses Language Server Protocol for deep code understanding.
- Vector Search: Semantic search for context-aware fixes.
📄 License
[License Info]
Project details
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 warden_core-1.8.4.tar.gz.
File metadata
- Download URL: warden_core-1.8.4.tar.gz
- Upload date:
- Size: 864.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d3776b76960b2cb7b9074e11acf1da034e13492827cb03b6d2137ac2ad6b47a
|
|
| MD5 |
e193689836b4151e17921df122afd84d
|
|
| BLAKE2b-256 |
c7ab52c8609132e8e344cefd0083f5adb73e96309ca1383b140cb4ea2e178ca0
|
Provenance
The following attestation bundles were made for warden_core-1.8.4.tar.gz:
Publisher:
release.yml on alperduzgun/warden-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
warden_core-1.8.4.tar.gz -
Subject digest:
7d3776b76960b2cb7b9074e11acf1da034e13492827cb03b6d2137ac2ad6b47a - Sigstore transparency entry: 808900953
- Sigstore integration time:
-
Permalink:
alperduzgun/warden-core@b1f8da3826a82a45b9667fe02f1ff617e4080dd0 -
Branch / Tag:
refs/tags/v1.8.4 - Owner: https://github.com/alperduzgun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1f8da3826a82a45b9667fe02f1ff617e4080dd0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file warden_core-1.8.4-py3-none-any.whl.
File metadata
- Download URL: warden_core-1.8.4-py3-none-any.whl
- Upload date:
- Size: 661.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6202f6856593954ab9965e3909b6c9770a28fb0ba8bd241fa07abbbac9e9759c
|
|
| MD5 |
bcf770148b54a03bf0c3c2375b5c5b2f
|
|
| BLAKE2b-256 |
4ced47dcfd23873189cea7859ea1f63320f73bb830852e1043eea28886dfb7fa
|
Provenance
The following attestation bundles were made for warden_core-1.8.4-py3-none-any.whl:
Publisher:
release.yml on alperduzgun/warden-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
warden_core-1.8.4-py3-none-any.whl -
Subject digest:
6202f6856593954ab9965e3909b6c9770a28fb0ba8bd241fa07abbbac9e9759c - Sigstore transparency entry: 808900957
- Sigstore integration time:
-
Permalink:
alperduzgun/warden-core@b1f8da3826a82a45b9667fe02f1ff617e4080dd0 -
Branch / Tag:
refs/tags/v1.8.4 - Owner: https://github.com/alperduzgun
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b1f8da3826a82a45b9667fe02f1ff617e4080dd0 -
Trigger Event:
push
-
Statement type: