Skip to content

Repository files navigation

claw8s

claw8s

PoC of an Autonomous Kubernetes monitoring and remediation agent powered by LLMs (Claude, GPT, Gemini, Ollama).

Detects K8s incidents → diagnoses root cause → acts (with your approval) → notifies you via Telegram.


Architecture

Claw8s uses a hybrid intelligence model that combines deterministic Skills with an open-ended agentic Soul and historical memory.

graph TD
    Watcher[K8s Watcher + Stale Scanner] -->|Incident| Queue[Asyncio Queue]
    Queue -->|Process| Manager[Main Loop]
    Manager -->|Incident| Skills[Skill Runner - YAML]
    Skills -->|Inconclusive| Soul[The Soul - Agentic Loop]
    Soul -->|Historical Context| Audit[(Audit Log - SQLite)]
    Soul -->|Remediation| Tools[Kubectl Tools]
    Tools -->|Verification Loop| Manager
    Manager -->|Alert/Approval| Telegram[Telegram Bot]
    Telegram -->|Smart Reconfirm| Tools
Loading

🛡️ Resilience & Verification

  • Smart Reconfirm: Every approval request includes a Reconfirm button that triggers a live Kubernetes health probe to verify if manual intervention has already fixed the issue.
  • Wait for Rollout: Mandatory verification policy—incidents are only marked "Resolved" after new pods are confirmed Ready and Available.
  • Grouped Debouncing: Prevents alert flooding by grouping pod incidents at the Deployment level.
  • Proactive Scanning: Sweeps for Scheduler-level failures every 30s.

📲 Telegram Command Center

Claw8s provides a powerful mobile interface for cluster management:

  • /status & /refresh: Get a namespace-aware breakdown of cluster health with live timestamps.
  • /history: View the last 10 incidents and their resolution paths.
  • /fix <instruction>: Commander Overdrive. Issue natural language instructions directly to the agent.
    • Example: /fix scale web-app to 3 replicas
    • Example: /fix change liveness probe to /healthz
  • Interactive Approvals: Review reasoning and confidence scores before approving destructive actions.

🧠 Hybrid Intelligence: Soul + Skills

  1. Tier 1: Skills (Deterministic YAML)
    Claw8s first matches incidents against Skills in skills/. Skills are YAML-defined runbooks that execute fixed investigation steps. They are fast, cheap, and predictable.
  2. Tier 2: The Soul (Reasoning Loop)
    If no skill matches or is inconclusive, the Agentic Loop takes over. Guided by the Soul (prompts/soul.md), it uses open-ended tool calling and Historical Memory to resolve novel incidents.

🚀 Quick Start

1. Install Dependencies

uv pip install -e .

2. Set up Secrets

Edit .env with your ANTHROPIC_API_KEY and TELEGRAM_BOT_TOKEN.

3. Launch

python main.py --config config.yaml

Claw8s will start the watcher, the Telegram bot, and the Dashboard on http://localhost:9090.


📊 Configuration & Customization

Claw8s is designed to adapt to your specific cluster and operational needs.


📂 Project Structure

  • agent.py: The reasoning loop and historical context layer.
  • audit.py: Resilient SQLite audit log with WAL mode and high-concurrency timeouts.
  • watcher.py: Event watcher with controller-aware grouping and proactive scanning.
  • dashboard/: Integrated FastAPI dashboard and real-time analytics.
  • skills/: YAML-defined runbooks for common incident types.
  • tools/: Hardened K8s toolset with safety timeouts.

About

Scratch built orchestrator for k8s workloads

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages