Cloud Native 17 min read

Blade AI – Open‑Source AI Agent that Automates Full‑Cycle Chaos Engineering with Natural Language

Blade AI, the new open‑source intelligent layer for ChaosBlade, lets SREs describe fault scenarios in natural language and automatically handles target discovery, safety checks, execution, verification, and recovery, reducing a typical 20‑30 minute chaos experiment to a few seconds and enabling daily resilience testing.

Alibaba Middleware
Alibaba Middleware
Alibaba Middleware
Blade AI – Open‑Source AI Agent that Automates Full‑Cycle Chaos Engineering with Natural Language

Chaos engineering is valuable for improving system resilience, but most teams treat fault injection as an annual task because the workflow is fragmented and time‑consuming. A typical run requires locating the target, assembling a long command, confirming safety, validating the effect, and cleaning up, which can take 20‑30 minutes even for experienced engineers.

Blade AI addresses this problem by providing an AI‑driven agent that turns a one‑sentence description into a complete, safe, and auditable chaos experiment. Users simply write something like “inject 80% CPU pressure into the accounting service of the cms-demo namespace for 5 minutes”, and Blade AI automatically performs target discovery, skill selection, safety verification, execution, effect validation, baseline comparison, and recovery.

Core Architecture

The engine is built on LangGraph and consists of five independent ReAct loops: intent_clarification, agent_loop, safety_check, execute_loop, and verifier_loop. Each stage has its own prompt template, tool set, and loop limit, keeping the LLM context focused and predictable.

Architecture diagram
Architecture diagram

Key Features

Natural‑language driven workflow : the agent parses intent, asks clarification questions when needed, and maps the description to the correct ChaosBlade command with all parameters filled.

Multi‑layer safety : a rule‑based safety_check (no LLM) validates that the fault is allowed, preventing hallucinations.

Two‑layer verification : Layer 1 checks the command status (e.g., Running), Layer 2 runs metric queries (e.g., kubectl top pod) and compares against the pre‑fault baseline.

Automatic recovery : the same path used for injection is used for cleanup, supporting host‑blade, kubectl exec, and native kubectl paths.

FCAT (Fault Context Adaptation Table) : adaptive rules automatically adjust parameters (e.g., reduce CPU load if pod memory is low) and raise the confirmation level when similar experiments already exist.

Re‑planning and retry : for retryable errors (network glitches, temporary unavailability) the agent rolls back to the planning stage and generates a new plan; unrecoverable errors terminate immediately.

Rich failure taxonomy : 12 explicit failure reasons (e.g., PLANNING_TIMEOUT, SAFETY_REJECTED, RECOVERY_FAILED) are reported with diagnostic suggestions.

Plugin‑style skills : 19 built‑in fault scenarios covering 7 Kubernetes resource types; new scenarios can be added by dropping a SKILL.md file into skills/ and reloading.

Persistent state & audit : an async SQLite saver stores checkpoints, per‑task JSONL logs, and recordings ( ~/.blade‑ai/recordings/) that can be replayed for post‑mortems or training.

Interactive TUI : zero‑setup launch spawns a Python server, shows a five‑stage progress bar, context‑window pressure indicator, experiment cards, and supports commands like /plan, /run, /recover, /compact, and /replay.

Memory management : a PreReasoningHook compresses tool output, keeps the most recent 3 outputs (≈16 KB each), and performs token‑aware summarisation to stay within LLM limits.

Internationalisation & theming : auto‑detects language via BLADE_AI_LANG or locale variables, provides Chinese UI out‑of‑the‑box, and adapts colours to the terminal background (OSC 11).

Typical Commands

# Natural‑language injection via TUI
/blade create "给 cms-demo 命名空间的 accounting 服务注入 CPU 压力 80%,持续 5 分钟"

# Direct CLI usage (CI/CD integration)
blade-ai inject -i "对 cms-demo 命名空间中 accounting 服务注入 CPU 满载故障,负载 80%" \
    --kubeconfig ~/.kube/starops_test_config

# Dry‑run plan preview
/plan 如果对 Node 注入内存压力 90%,会影响哪些 Pod?

# Execute the plan after adjustment
/plan 改成 70%,只持续 1 分钟
/run

# Recover the latest experiment
/blade recover latest

Installation & First‑time Configuration

Blade AI is distributed as a single binary. Install with:

curl -fsSL https://chaosblade.io/install-agent.sh | bash

Running blade-ai launches an interactive wizard that collects the LLM API key, selects a model (e.g., qwen3.6‑max‑preview), scans ~/.kube/ for contexts, chooses a permission mode (confirm or auto), and performs environment self‑checks (blade binary, K8s connectivity, ChaosBlade operator).

Configuration can be edited later with /config wizard or /permission auto|confirm.

Quick‑start Example

After installation, the following TUI session demonstrates a full experiment:

TUI interaction
TUI interaction

The same workflow can be scripted in CI pipelines using the blade-ai inject command, which returns a JSON payload with task_id, status, and verification results for downstream automation.

Conclusion

Blade AI does not aim to replace SRE judgment; instead it offloads the repetitive steps of writing commands, consulting documentation, and validating effects, allowing engineers to focus on the strategic questions: Is the fault scenario meaningful? Does the system behave as expected? What should be tested next?

By reducing the cost of a chaos experiment to a single natural‑language sentence, Blade AI turns resilience testing from a yearly chore into a daily habit.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLIKubernetesChaos EngineeringOpen sourceResilience TestingAI AutomationLangGraphTUI
Alibaba Middleware
Written by

Alibaba Middleware

Aliware Alibaba Middleware Official Account

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.