Day 4 KodeKloud's Free AI Learning Week: Subagents
Explore KodeKloud's Free AI Learning Week and automate DevOps tasks with Qwen Subagents: streamline Docker, Terraform security, and more

Cloud and DevOps professional with a passion for automation, containers, and cloud-native practices, committed to sharing lessons from the trenches while always seeking new challenges. Combining hands-on expertise with an open mind, I write to demystify the complexities of DevOps and grow alongside the tech community.
Thursday started with something rare in tech: quiet! No firefighting, just a handful of “someday” tasks finally getting some attention. One look at the backlog and two problems jumped out. There was the notorious Docker image that ballooned to 2 GB, hiking up ECR bills every month. Right next to it, a security audit overdue; Terraform code with known vulnerabilities, yet nobody had hours to spare for a proper review.
That’s when I noticed how this week’s Free AI Lab perfectly echoed real pain points. Instead of handling things the old way, we got to build an automated DevOps team using Qwen’s “subagents.” It felt surprisingly close to how you’d spin up a squad of specialists, each tackling their own area, but all working together.
What Are Qwen Subagents?
Think of subagents as having mini-devs living in your terminal. Each is focused and “skilled” in just one job — one’s the Docker optimizer, and another is the Terraform security pro. They’re simple markdown files, easy to set up, and do exactly what you’d want from an expert: analyze, suggest, and take action.
The coolest part is how these agents manage their own info and context. They’re not copying each other’s homework or getting their wires crossed. You just tell Qwen what needs fixing, and it picks the right specialist automatically.
Setting Up the Squad
By running a setup script, I installed both Docker and Terraform agents. Afterwards, it took just a single command in Qwen to see the team was live and ready:
docker-optimizer: trims Docker images, locks things down, and prepares for ECR
terraform-security: scans Terraform code, flags risky configs, and ensures encryption and compliance
The agents are now docked and connected to the Docker MCP server, which means they can review, build, test, and even measure image sizes before and after optimization.
Subagents in Action
Instead of manual Dockerfile audits or long-winded security reviews, I could ask Qwen in plain English:
“Optimize the Docker image for ECR”
“Check the Terraform code for security risks”
Qwen delegates work like a manager at a standup, picking the right subagent, letting them work independently, and then handing back a full report.
For Docker, the optimizer:
Switched the base image to a slim variant
Removed extra and unused packages
Created a non-root user for security
Improved build speed with layer caching and a .dockerignore file
Results: Image size dropped from 2GB to roughly 250MB, monthly ECR costs shrank from $150 to $30, and deploy times went from 10 minutes down to 2.
On the Terraform side, the security agent caught:
Critical: SSH open to the world (0.0.0.0/0)
High: S3 missing encryption
Medium: ECR repo without image scanning
Best of all, agents provided clear reports with line numbers, severity ratings, and practical suggestions.
Key Takeaways
A few things really stood out:
Subagents are niche specialists — one per job, no confusion.
They’re simple to build and keep isolated, so expertise stays sharp and reusable.
No more tribal knowledge: everyone benefits, and knowledge isn’t trapped in one teammate’s head.
Automated tasks are now consistent, repeatable, and cover best practices by default.
The Impact
By the end of Day 4, I’d:
Built a Docker optimizer and Terraform security specialist from scratch
Reduced a container image by over 60 percent
Flagged and mapped out real-world security risks
Saw what it feels like to have an AI-powered team quietly handling the heavy lifting in the background
It’s a different way of working, more like team-building than task-hacking. Looking ahead, I’m excited to keep adding new specialist agents and see how far this virtual squad can go. If you’ve ever wished you could clone yourself (but with better focus and less context switching), this is as close as it gets.



