Skip to main content

Warden - AI Code Guardian for comprehensive code validation

Project description

Warden Core - The AI Code Guardian

"AI writes the code. Warden guards the production."

Status Python AI Ready

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.md into every session via Claude SessionStart hooks.
  • 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":

  1. SecurityFrame (Critical): Detects SQLi, XSS, and hardcoded secrets.
  2. ChaosEngineeringFrame (High): Validates error handling and resilience patterns.
  3. FuzzTestingFrame (High): Checks for type safety and edge case handling.
  4. PropertyTestingFrame (Medium): Verifies idempotency and invariants.
  5. ArchitecturalConsistencyFrame (Medium): Enforces SOLID principles and file limits.
  6. 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-id to suppress specific issues.
  • Global Config: Define suppressions in .warden/suppressions.yaml.
  • File Exclusion: Respects .gitignore and 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:

  1. Analyzes your project structure.
  2. Creates .warden/AI_RULES.md.
  3. Configures Claude Code hooks (.claude/settings.json) to auto-load rules.
  4. Sets up MCP configuration.
  5. Creates .env and .env.example for your API keys.

The "Verify-Loop" Protocol

AI Agents working in a Warden project follow this strict protocol:

  1. PLAN: Design the change (Task or Phase).
  2. EXECUTE: Implement the code.
  3. VERIFY: Run warden scan at 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

warden_core-1.8.4.tar.gz (864.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

warden_core-1.8.4-py3-none-any.whl (661.5 kB view details)

Uploaded Python 3

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

Hashes for warden_core-1.8.4.tar.gz
Algorithm Hash digest
SHA256 7d3776b76960b2cb7b9074e11acf1da034e13492827cb03b6d2137ac2ad6b47a
MD5 e193689836b4151e17921df122afd84d
BLAKE2b-256 c7ab52c8609132e8e344cefd0083f5adb73e96309ca1383b140cb4ea2e178ca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for warden_core-1.8.4.tar.gz:

Publisher: release.yml on alperduzgun/warden-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for warden_core-1.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6202f6856593954ab9965e3909b6c9770a28fb0ba8bd241fa07abbbac9e9759c
MD5 bcf770148b54a03bf0c3c2375b5c5b2f
BLAKE2b-256 4ced47dcfd23873189cea7859ea1f63320f73bb830852e1043eea28886dfb7fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for warden_core-1.8.4-py3-none-any.whl:

Publisher: release.yml on alperduzgun/warden-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page