Design, plan, and harden production-grade agentic AI systems
Project description
CLean-agents
Design, plan, and harden production-grade agentic AI systems.
CLean-agents is a Python CLI + SDK for designing multi-agent architectures with evidence-backed recommendations, security analysis, cost optimization, and code scaffolding — from single agents to enterprise-scale swarms.
Clean (well-designed, no unnecessary complexity) + Lean (efficient, no over-engineering) = CLean-agents
Quick Start
pip install clean-agents
# Interactive architecture design session
clean-agents design
# With AI-enhanced mode (multi-turn with Claude)
export ANTHROPIC_API_KEY=sk-ant-...
clean-agents design --ai
# Non-interactive
clean-agents design --desc "Multi-agent customer support system with HIPAA compliance" --no-interactive
What It Does
Describe the system you want to build in plain language. CLean-agents will:
- Classify your system (single agent → pipeline → multi-agent → complex)
- Recommend an architecture pattern backed by benchmarks and research
- Generate a full blueprint: agents, models, guardrails, infrastructure, compliance
- Iterate via multi-turn AI conversations (with
--aiflag) - Export as YAML, JSON, or interactive HTML report
CLI Commands
clean-agents init Initialize project directory
clean-agents design Interactive architecture session
clean-agents blueprint View/export the current blueprint
clean-agents shield Security hardening analysis (7 attack categories)
clean-agents cost Cost simulator with monthly projections
clean-agents eval Generate evaluation suite per agent
clean-agents observe Observability blueprint (metrics, traces, alerts)
clean-agents models Benchmark-based model selection
clean-agents prompts Generate optimized prompt templates
clean-agents migrate Migration advisor between frameworks
clean-agents comply Regulation-to-component compliance mapping
clean-agents load Load testing scenarios and configs
clean-agents scaffold Generate starter code (LangGraph, CrewAI, Claude SDK, OpenAI SDK)
clean-agents plugin list List installed plugins
clean-agents plugin run Run a specific plugin
clean-agents plugin init Scaffold a new plugin
clean-agents serve Start API server (REST or MCP)
AI-Enhanced Mode
With ANTHROPIC_API_KEY set, commands gain AI superpowers:
design --ai— Multi-turn design iteration with Claude. Refine your architecture conversationally.shield --ai— Deep security analysis: attack scenarios, vulnerability discovery, hardening checklists.prompts --ai— Production-quality system prompts generated by Claude instead of templates.
CLean-shield: Security Analysis
7 attack categories analyzed against your blueprint:
| ID | Category | Checks |
|---|---|---|
| ATK-1 | Prompt Injection | System prompt isolation, input sanitization, instruction hierarchy |
| ATK-2 | Jailbreaking | Role boundaries, output monitoring, multi-turn tracking |
| ATK-3 | Data Extraction | Output filtering, system prompt protection, RAG access control |
| ATK-4 | Agent Manipulation | Inter-agent auth, message validation, privilege boundaries |
| ATK-5 | Tool Abuse | Permission model, parameter validation, execution sandboxing |
| ATK-6 | Denial of Service | Rate limiting, token budgets, recursion depth limits |
| ATK-7 | Privacy Violation | PII detection, output sanitization, context isolation |
Plugin System
Extend CLean-agents with custom analysis, transformations, or scaffolding:
from clean_agents.modules.base import AnalysisPlugin, PluginManifest, PluginResult, PluginType
class MyPlugin(AnalysisPlugin):
def manifest(self):
return PluginManifest(name="my-plugin", version="1.0", description="Custom analysis", plugin_type=PluginType.ANALYSIS)
def analyze(self, blueprint, config=None):
findings = []
for agent in blueprint.agents:
if agent.token_budget > 10000:
findings.append({"agent": agent.name, "severity": "warning", "message": "High token budget"})
return PluginResult("my-plugin", success=True, findings=findings, summary=f"{len(findings)} findings")
Three plugin types: AnalysisPlugin (read-only inspection), TransformPlugin (modify blueprints), ScaffoldPlugin (generate files).
Discovery sources: Python entry points (clean_agents.plugins), ~/.config/clean-agents/plugins/, .clean-agents/plugins/.
Python SDK
from clean_agents import Blueprint, Recommender, Config
# Generate a blueprint programmatically
recommender = Recommender()
blueprint = recommender.recommend("Multi-agent RAG system for legal document analysis with GDPR compliance")
# Inspect the result
print(blueprint.name)
print(blueprint.to_yaml())
print(f"Cost per request: ${blueprint.estimated_cost_per_request():.4f}")
# Access agents
for agent in blueprint.agents:
print(f"{agent.name}: {agent.role} ({agent.model.primary})")
# Save and load
blueprint.save("my-blueprint.yaml")
loaded = Blueprint.load("my-blueprint.yaml")
API Server
# REST API
clean-agents serve --port 8000
# MCP server (for IDE integration)
clean-agents serve --mode mcp
REST endpoints: POST /api/design, GET /api/blueprint, POST /api/shield, POST /api/cost, POST /api/scaffold, GET /api/health.
Architecture Decision Engine
4-layer recommendation pipeline:
- System Classification — Signals from description → single / pipeline / multi-agent / complex
- Pattern Selection — Supervisor hierarchical / blackboard-swarm / hybrid / pipeline
- Framework Selection — LangGraph / CrewAI / Claude Agent SDK / OpenAI Agents SDK / custom
- Transversal Components — Memory, reasoning patterns, guardrails, observability, compliance
Every recommendation comes with design decisions explaining the rationale.
Installation Options
# Core (CLI + SDK)
pip install clean-agents
# With API server
pip install "clean-agents[api]"
# With all optional integrations
pip install "clean-agents[all]"
# Development
pip install "clean-agents[dev]"
Built-in Plugins
- Token Budget Auditor — flags agents with oversized or undersized token budgets
- Redundancy Detector — identifies potentially redundant agent pairs
- Cost Optimizer — auto-downgrades models where premium isn't needed (saves ~14%)
License
MIT — see LICENSE.
Built by @leansroasas
Project details
Release history Release notifications | RSS feed
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 clean_agents-0.1.0.tar.gz.
File metadata
- Download URL: clean_agents-0.1.0.tar.gz
- Upload date:
- Size: 187.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e26fdeb00f9ad6ca1e461cd04542b34f4cffb06340913901b2be3bf50ed84217
|
|
| MD5 |
6fd82cc029c051c0d3a3c4437ed331d2
|
|
| BLAKE2b-256 |
7893481dadd58be5256c5e77a57cda200746d09bb1fb72746467fdaf629c9c40
|
File details
Details for the file clean_agents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: clean_agents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 72.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a0cffb32223b60cd692625536735f20f2f1d019cfee14e2da1e87a24308b158
|
|
| MD5 |
be91d27cd3f5862c908a74aae947aa83
|
|
| BLAKE2b-256 |
6d16c7742697ade251c8194b6c6d9b71a5b142ead927fd6f5727ceb352d5cc4e
|