Skip to content

mdhaarishussain/chaos-kitten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

589 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Chaos Kitten Logo

Typing SVG

The adorable AI agent that knocks things off your API tables

License: MIT Python 3.10+ CNCF Stars

Quick Start โ€ข Features โ€ข How It Works โ€ข Installation โ€ข Contributing โ€ข Contributors


๐ŸŽฏ What is Chaos Kitten?

Chaos Kitten is an agentic AI security testing tool that acts like a mischievous catโ€”it explores your API, understands the business logic, and systematically tries to "break" things before malicious actors do.

Unlike traditional fuzzers (ZAP, Burp) that spray random payloads, Chaos Kitten reasons about your API structure and crafts intelligent attacks.

๏ฟฝ Agent thinks...
"This is a login endpoint.
I should test for:
- SQL injection in username
- User enumeration
- Brute force protection"

๐Ÿค” The Problem

AI-powered "vibe coding" tools (Claude, Cursor, Windsurf) generate backend APIs at incredible speed, but they often skip critical security measures:

โŒ

Missing Auth
No authentication on critical endpoints

โŒ

No Validation
Input fields accept anything

โŒ

SQL Injection
Queries built with string concatenation

โŒ

Logic Flaws
IDOR, privilege escalation

Real Story: While building Bondhu (Digital Twin for mental wellness), we discovered our AI vibe coded frontend had ZERO authentication on critical endpoints. Anyone could exploit this to access user data.

Chaos Kitten finds these issues before attackers do. ๐Ÿ”’


โœจ Features

๐Ÿง  The Brain (AI Orchestrator)

  • Parses OpenAPI/Swagger specs
  • Understands endpoint semantics
  • Plans intelligent multi-step attacks
  • Uses Chain-of-Thought reasoning

๏ฟฝ The Paws (Executor)

  • Async HTTP with httpx
  • Playwright browser automation
  • Rate limiting & politeness controls
  • Multiple auth methods

๐Ÿงถ The Toy Box (Attack Library)

  • SQL Injection profiles
  • XSS payloads (reflected, stored)
  • IDOR detection strategies
  • Naughty strings collection
  • Easy to contribute!

๐Ÿ“ฆ The Litterbox (Reporter)

  • Beautiful HTML reports
  • Markdown export
  • PoC curl commands
  • Remediation guidance

๏ฟฝ๐Ÿš€ Quick Start

# Install
pip install chaos-kitten

# Initialize config
chaos-kitten init

# Run against your API
chaos-kitten scan --config chaos-kitten.yaml

Example Output

๐Ÿฑ Chaos Kitten v1.0.0
๐Ÿ“‹ Parsing OpenAPI spec...
๐ŸŽฏ Found 12 endpoints
๐Ÿง  Planning attack strategies...

๐Ÿพ Testing /api/login
   โš ๏ธ  I knocked this vase over! (SQL Injection found)

๐Ÿพ Testing /api/users/{id}
   โš ๏ธ  I played with this string! (IDOR vulnerability)

๐Ÿ“Š Report saved to ./reports/chaos-kitten-2026-01-20.html

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        ๐Ÿฑ Chaos Kitten                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                  โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”‚
โ”‚   โ”‚   ๐Ÿง  Brain     โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚   ๐Ÿพ Paws      โ”‚               โ”‚
โ”‚   โ”‚  Orchestrator  โ”‚           โ”‚   Executor     โ”‚               โ”‚
โ”‚   โ”‚                โ”‚           โ”‚                โ”‚               โ”‚
โ”‚   โ”‚  โ€ข OpenAPI     โ”‚           โ”‚  โ€ข httpx       โ”‚               โ”‚
โ”‚   โ”‚  โ€ข LLM Agent   โ”‚           โ”‚  โ€ข Playwright  โ”‚               โ”‚
โ”‚   โ”‚  โ€ข Planner     โ”‚           โ”‚  โ€ข Async       โ”‚               โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
โ”‚           โ”‚                            โ”‚                         โ”‚
โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                         โ”‚
โ”‚                        โ”‚                                         โ”‚
โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                               โ”‚
โ”‚              โ”‚   ๐Ÿงถ Toy Box      โ”‚                               โ”‚
โ”‚              โ”‚  Attack Profiles  โ”‚                               โ”‚
โ”‚              โ”‚                   โ”‚                               โ”‚
โ”‚              โ”‚  โ€ข SQL Injection  โ”‚                               โ”‚
โ”‚              โ”‚  โ€ข XSS Payloads   โ”‚                               โ”‚
โ”‚              โ”‚  โ€ข IDOR Tests     โ”‚                               โ”‚
โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                               โ”‚
โ”‚                        โ”‚                                         โ”‚
โ”‚              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                               โ”‚
โ”‚              โ”‚   ๐Ÿ“ฆ Litterbox    โ”‚                               โ”‚
โ”‚              โ”‚    Reporter       โ”‚                               โ”‚
โ”‚              โ”‚                   โ”‚                               โ”‚
โ”‚              โ”‚  โ€ข HTML Reports   โ”‚                               โ”‚
โ”‚              โ”‚  โ€ข PoC Scripts    โ”‚                               โ”‚
โ”‚              โ”‚  โ€ข Remediation    โ”‚                               โ”‚
โ”‚              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                               โ”‚
โ”‚                                                                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฆ Installation

From PyPI (Recommended)

pip install chaos-kitten

From Source

git clone https://github.com/mdhaarishussain/chaos-kitten.git
cd chaos-kitten
pip install -e .

With Development Dependencies

pip install -e ".[dev]"

โš™๏ธ Configuration

Create a chaos-kitten.yaml file:

target:
  base_url: "http://localhost:3000"
  openapi_spec: "./openapi.json"
  auth:
    type: "bearer"
    token: "${API_TOKEN}"

agent:
  llm_provider: "anthropic"
  model: "claude-3-5-sonnet-20241022"
  temperature: 0.7

executor:
  concurrent_requests: 5
  timeout: 30
  rate_limit: 10
  retry:
    max_retries: 3           # Max attempts for rate-limited (429) requests
    base_backoff: 1.0        # Initial wait time in seconds
    max_backoff: 60.0        # Maximum wait time
    jitter: true             # Add randomization to backoff

safety:
  allowed_domains:
    - "localhost"
    - "*.test.com"
  destructive_mode: false

๐Ÿ“„ See chaos-kitten.yaml for all configuration options.


๐ŸŽฎ Usage

Basic Scan

chaos-kitten scan --target http://localhost:3000

With OpenAPI Spec

chaos-kitten scan --spec openapi.json --target http://localhost:3000

CI/CD Integration

# .github/workflows/security-test.yml
name: ๐Ÿฑ Chaos Kitten Security Scan

on: [pull_request]

jobs:
  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Chaos Kitten
        run: |
          pip install chaos-kitten
          chaos-kitten scan --fail-on-critical

๐ŸŽ Contributing

We love contributions! Chaos Kitten is designed to be beginner-friendly.

๐Ÿฃ First-Timers

No coding required!

  • Add payloads to toys/
  • Fix typos in docs
  • Add naughty strings

๐Ÿฅ Beginners

Basic Python

  • Write unit tests
  • Create YAML attack profiles
  • Add CLI features

๐Ÿ” Advanced

Core Features

  • New attack strategies
  • GraphQL support
  • LLM optimization

See CONTRIBUTING.md and docs/contributing_guide.md for details.


๐Ÿ”’ Safety & Ethics

โš–๏ธ LEGAL NOTICE

Chaos Kitten is intended for testing YOUR OWN applications or systems where you have explicit permission. Unauthorized access to computer systems is illegal. Users are responsible for compliance with applicable laws. The developers assume no liability for misuse.

Built-in Safeguards

Feature Description
โœ… Allowlist-Only Won't scan domains not in allowed_domains
โœ… Rate Limiting Respects server resources
โœ… Non-Destructive Prevents DROP/DELETE by default
โœ… Audit Logging All actions logged

๐Ÿ—บ๏ธ Roadmap

Phase 1 (MVP) โœ…

  • OpenAPI parsing
  • SQL injection detection
  • XSS & IDOR detection
  • HTML/Markdown reports
  • CLI tool

Phase 2 ๐Ÿ”„

  • GraphQL support
  • gRPC/Protobuf
  • WebSocket testing
  • GitHub Action

Phase 3 ๐Ÿš€

  • Kubernetes Operator
  • Service Mesh integration
  • Real-time dashboard
  • OPA integration

๐Ÿ† Built For

Aperture 3.0 by Resourcio Community


๐Ÿ“„ License

MIT License - see LICENSE for details.


๐Ÿค Contributors

Thanks to all the amazing people who have contributed to Chaos Kitten! ๐Ÿฑ

Contributors

Want to contribute? Check out our Contributing Guide and join the fun!


Chaos Kitten

Chaos Kitten
"Breaking your code before hackers do"

Made with ๐Ÿ’œ by the Chaos Kitten Team
A project under the Last Neuron Umbrella
(By the makers of Bondhu)

โญ Star us on GitHub

About

An agentic AI security testing tool that intelligently finds vulnerabilities in APIs. Built for the CNCF ecosystem.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages