A multi-agent system built on Kiro CLI that helps teams design, build, validate, and audit AWS infrastructure following the AWS Well-Architected Framework (WAF) — all from natural language.
Natural Language → Architecture Diagram → IaC Code → Code Validation → Live Resource Audit
↓ ↓ ↓ ↓
Auto-validated Auto-validated Fix suggestions Remediation CLI
One orchestrator agent (waf-ops) routes your requests to 5 specialist agents, each focused on a specific phase of the infrastructure lifecycle. Every generation step is automatically followed by a validation step.
| Phase | Agent | What It Does |
|---|---|---|
| Design | waf-arch-diagram-generator |
Creates draw.io architecture diagrams from text descriptions |
| Review | waf-arch-diagram-reviewer |
Reviews diagrams/architectures against all 6 WAF pillars |
| Build | waf-iac-writer |
Generates WAF-compliant Terraform/CDK/CloudFormation |
| Validate | waf-iac-validator |
Static analysis of IaC code against WAF best practices |
| Audit | waf-resource-validator |
Checks live AWS resources against WAF best practices |
All agents share 6 WAF pillar skill files as a single source of truth — update a checklist once, it applies everywhere.
┌──────────────────────────────────────────────────────────────────┐
│ waf-ops (Ctrl+Shift+W) — orchestrator │
│ MCP: AWS Docs | AWS API (read-only) │
│ │
│ ┌──────────────┬────────────┬────────────┬──────────┬─────────┐ │
│ │ waf-arch- │ waf-arch- │ waf-iac- │ waf-iac- │ waf- │ │
│ │ diagram- │ diagram- │ writer │ validator│ resource│ │
│ │ generator │ reviewer │ │ │ │ │
│ │ MCP: │ MCP: │ MCP: │ MCP: │ MCP: │ │
│ │ Draw.io │ Draw.io │ Terraform │Terraform │ AWS API │ │
│ │ Docs │ Docs │ Docs │ Docs │ Docs │ │
│ └──────────────┴────────────┴────────────┴──────────┴─────────┘ │
│ │
│ Shared: 6 WAF Skill Files (single source of truth) │
│ Automatic Validation Chain: Generate → Validate → Fix Loop │
└──────────────────────────────────────────────────────────────────┘
-
Kiro CLI installed and authenticated
kiro-cli --version
-
Node.js v18+ (for Draw.io MCP server)
node --version
-
Python 3.10+ with uv (for AWS Documentation and API MCP servers)
curl -LsSf https://astral.sh/uv/install.sh | sh uv --version -
Docker (for Terraform MCP server)
docker --version docker pull hashicorp/terraform-mcp-server:latest
-
AWS credentials configured (for resource validator)
aws sts get-caller-identity
kiro-cli settings chat.enableSubagent true
kiro-cli settings chat.enableTodoList true-
Clone or copy the
.kiro/folder into your project:cp -r kiro-waf-agent/.kiro /path/to/your/project/.kiro
Or use it standalone:
cd kiro-waf-agent kiro-cli chat -
Verify agents load:
/agent listYou should see:
waf-ops,waf-arch-diagram-generator,waf-arch-diagram-reviewer,waf-iac-writer,waf-iac-validator,waf-resource-validator
cd kiro-waf-agent
kiro-cli chatThen:
/agent swap waf-ops
That's it. Talk naturally — the orchestrator routes to the right specialist.
> Draw a serverless event-driven pipeline:
- S3 bucket receives files
- Lambda processes them
- Results go to DynamoDB
- Failures go to SQS dead letter queue
- CloudWatch alarms on errors
→ waf-arch-diagram-generator creates a .drawio file with official AWS icons
→ waf-arch-diagram-reviewer automatically validates the diagram against WAF pillars
The orchestrator shows validation results:
✅ Security — private subnets, encryption indicators present
✅ Reliability — DLQ configured, CloudWatch alarms
⚠️ Operational Excellence — no X-Ray tracing shown
⚠️ Cost — no lifecycle policy on S3
Should I fix the diagram? [yes/no]
> Now generate the Terraform for this architecture
→ waf-iac-writer produces modular .tf files with WAF best practices
→ waf-iac-validator automatically validates the generated code
❌ Security | main.tf:42 | S3 bucket missing Block Public Access
Fix: Add `aws_s3_bucket_public_access_block` resource
Should I fix the code? [yes/no]
> yes
→ waf-iac-writer corrects the issues and re-validates
> Check if the deployed Lambda and DynamoDB in us-east-1 match best practices
→ waf-resource-validator queries live AWS via API and reports findings with remediation commands
Run multiple specialists simultaneously:
> Draw the diagram AND generate the Terraform for a 3-tier web app
→ waf-arch-diagram-generator + waf-iac-writer run in parallel
> Validate my Terraform AND check the live resources
→ waf-iac-validator + waf-resource-validator run in parallel
If you want speed over safety:
> Draw a diagram, skip validation
Use keyboard shortcuts to go directly to a specialist:
| Shortcut | Agent |
|---|---|
Ctrl+Shift+W |
waf-ops (orchestrator) |
Ctrl+Shift+D |
waf-arch-diagram-generator |
Ctrl+Shift+A |
waf-arch-diagram-reviewer |
Ctrl+Shift+I |
waf-iac-writer |
Ctrl+Shift+V |
waf-iac-validator |
Ctrl+Shift+R |
waf-resource-validator |
The orchestrator handles documentation questions directly:
> What are the best practices for RDS encryption at rest?
> What S3 lifecycle policy options are available?
> How do I configure CloudFront with WAF?
kiro-waf-agent/
├── README.md
├── LICENSE # Apache 2.0
└── .kiro/
├── agents/
│ ├── waf-ops.json # Orchestrator (5 subagents)
│ ├── waf-arch-diagram-generator.json # Draw.io diagram creation
│ ├── waf-arch-diagram-reviewer.json # Diagram validation
│ ├── waf-iac-writer.json # IaC code generation
│ ├── waf-iac-validator.json # IaC static analysis
│ └── waf-resource-validator.json # Live resource audit
├── steering/
│ └── waf-review-format.md # Output format template (always loaded)
└── skills/
└── waf-review/
├── operational-excellence/SKILL.md # Pillar 1
├── security/SKILL.md # Pillar 2
├── reliability/SKILL.md # Pillar 3
├── performance/SKILL.md # Pillar 4
├── cost-optimization/SKILL.md # Pillar 5
└── sustainability/SKILL.md # Pillar 6
| MCP Server | Purpose | Required By |
|---|---|---|
| AWS Documentation | Search/read AWS docs | All agents |
| AWS API | Query live AWS resources (read-only) | waf-ops, waf-resource-validator |
| Draw.io | Generate/read architecture diagrams | waf-arch-diagram-generator, waf-arch-diagram-reviewer |
| Terraform | Provider docs, resource schemas | waf-iac-writer, waf-iac-validator |
Every generation step is followed by automatic validation:
Generate Diagram → Validate Diagram → Fix Loop (if critical gaps)
Generate IaC → Validate IaC → Fix Loop (if critical issues)
This ensures output quality without manual intervention. Say "skip validation" to bypass.
Edit any skill file in .kiro/skills/waf-review/*/SKILL.md. Changes apply to all agents automatically.
- Create
.kiro/skills/waf-review/my-custom-pillar/SKILL.md - Add YAML frontmatter:
--- name: my-custom-pillar description: When to load this skill ---
- Add the skill URI to each agent's
resourcesarray:"skill://.kiro/skills/waf-review/my-custom-pillar/SKILL.md"
Edit the AWS_REGION environment variable in waf-ops.json and waf-resource-validator.json:
"env": {
"AWS_REGION": "us-west-2"
}The AWS API MCP server is already set to read-only:
"READ_OPERATIONS_ONLY": "true"To further restrict, configure AWS IAM credentials with a scoped-down policy.
This project showcases these advanced Kiro CLI capabilities:
- Custom Agents — Specialized AI personas with distinct tools and prompts
- Steering Files — Always-loaded context for consistent output formatting
- Skills — On-demand knowledge loaded only when relevant
- MCP Servers — External tool integrations (AWS, Terraform, Draw.io)
- Subagents — Parallel execution of multiple specialists
- Keyboard Shortcuts — Quick agent switching
- Tool Trust — Auto-approved tools eliminate approval fatigue
# AWS Documentation/API
uvx awslabs.aws-documentation-mcp-server@latest --help
# Terraform
docker run --rm hashicorp/terraform-mcp-server:latest --help
# Draw.io
npx -y https://github.com/aws-samples/sample-drawio-mcp/releases/latest/download/drawio-mcp-server-latest.tgz --helpEnsure you're running kiro-cli chat from within the kiro-waf-agent/ directory (or a directory containing the .kiro/ folder).
If execution exceeds 5 minutes, check:
- Are all tools in
allowedTools? (prevents approval prompts) - Is Docker running? (Terraform MCP needs it)
- Is
uvinstalled? (AWS MCP servers need it)
The resource validator needs valid AWS credentials. Run:
aws sts get-caller-identityIf expired, re-authenticate via SSO or refresh your credentials.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Built with Kiro CLI using:
- AWS MCP Servers by AWS Labs
- Draw.io MCP Server by AWS Samples
- Terraform MCP Server by HashiCorp