vitorpaulo.dev
Back to posts

I didn’t build this Blog alone. My AI Squad did.

22 Sep 2026 · 18m · 366 views · 19 reactions

Vitor Paulo Vitor Paulo

AI

I have this ugly curious habit of trying to take advantage of opportunities to increase my knowledge, learn something new, or simply test ideas.

In the middle of a conversation, while I was trying to explain something about Angular, someone suggested that I should start publishing my ideas. Of course, I refused to simply make a blog or use WordPress.

So I started by building an Agent Squad to work from refinement all the way to delivery. The squad was split into two flows that complement each other: feature and security. Each one has its own purpose, and it ended up making this little battle a lot easier.

Before getting into the details, the overall flow looks roughly like this:

Feature flow

The main flow starts with an idea and goes through different agents until it comes back to me for the final validation.

Refinement

Everything starts with a simple idea:

"we need SEO on the blog"

The Refiner's job is to take that idea and turn it into something that can actually be developed.

It uses knowledge-rag to understand the project, the technologies being used, existing patterns, and the squad's rules. Then sequential-thinking comes in to raise questions, risks, dependencies, and possible ways to solve the task.

Once it has enough information, it presents the possible approaches for the user to choose from, organizes everything, and asks for approval. After approval, it creates the GitHub Issue, which becomes the input for the next agent.

Orchestration

From here, the Planner comes in. Despite the name, it does a little more than simply creating a plan. It needs to understand the issue, look at the current state of the project, and figure out what actually needs to change.

For that, it uses knowledge-rag again and reads the code it needs to understand the impact of the change. It then records the context and plan in .ai/TASK.yaml and delegates the implementation to the Engineer.

The idea is that the Engineer shouldn't have to figure out what it is supposed to do while already writing code.

Engineering

This is where someone finally gets their hands dirty.

The Engineer receives the context prepared by the Planner and starts implementing. It needs to follow .ai/TASK.yaml, respect the project's existing patterns, and try to touch only what actually needs to be changed.

During development, it uses Context7 to check library documentation and can also access the database when it needs to understand the current state of the data. At the end, besides the implementation, it delivers the tests and evidence needed to show what was done.

Review

After that comes the Reviewer.

Its job is basically to try to prove that the Engineer did something wrong.

It compares the implementation against .ai/TASK.yaml, checks technical decisions, looks for bugs, regressions, edge cases, and anything that slipped through. It also shouldn't accept an implementation just because "it seems to work."

If it finds a problem, it sends it back to the Engineer, which fixes it and presents new evidence.

This is where the annoying guy in the squad comes in.

Validation and closing

When the Planner, Engineer, and Reviewer finish their work, there is still the most important part: I look at it.

The Planner calls the user to validate the feature's behavior, the design, and the rest of the delivery. This stage can be rejected. The code review can also be rejected. When something isn't right, the flow goes back to implementation and continues until it is acceptable.

Only after approval does the Engineer make the commits and open the Pull Request.

Even with all this automation, the code still goes through my own code review at the end.

The idea behind the squad is to have the agents come to me with the work as well-prepared as possible. The final decision is still mine.

Security flow

The security flow is a little different from the feature flow.

I wanted an agent trying to figure out whether it could actually break something, instead of simply doing QA and checking whether the application "works."

The Security agent starts by understanding the project. It reads the code, checks knowledge-rag, looks at the architecture, and tries to figure out where the main security boundaries are.

Reconnaissance

The first step is understanding what is being protected.

Authentication, authorization, R2, Redis, Turnstile, uploads, APIs, and anywhere a user-controlled input can reach something sensitive all go on the radar.

It queries knowledge-rag, reads the code, and starts building a map of the application: endpoints, authentication, authorization, administrative operations, objects stored in R2, Redis usage, Turnstile integration, and the points where user-controlled data enters the system.

When it needs to confirm some specific framework or library behavior, it uses Context7.

At the end of this stage, it needs to have hypotheses that actually make sense, rather than a generic list of "security best practices that might be missing."

Each hypothesis gets an ID and goes into .ai/SECURITY_SCAN.md.

Hypotheses

This is where things start getting fun.

The agent looks at what it found and tries to answer a very simple question:

"If I control this input, how far can I get?"

This can generate hypotheses around IDOR, authorization bypasses, stored XSS, R2 object manipulation, SSRF, injection, Turnstile issues, cache poisoning, or some business logic abuse.

A hypothesis needs a reason to exist. If the code gives no indication that a certain path is possible, it doesn't make much sense to start throwing random payloads at it.

Each hypothesis also needs to make clear what would have to happen for it to be confirmed and what the impact would be if it actually worked.

But there is one important rule here:

suspicious code is not a vulnerability.

A weird line might just be a weird line. A missing header might have no impact at all. An endpoint returning a different error doesn't mean there is a vulnerability.

The agent needs to try to prove it.

Tests

After the hypotheses comes the attempt to break them.

The agent doesn't just execute destructive tests directly against production. It analyzes the code, prepares the test cases, and passes me what needs to be validated.

Depending on the case, this can be done with Playwright or through a controlled HTTP request.

The idea is simple:

For a protected endpoint, for example, it's not enough to see that there is a guard on the frontend. The test needs to check what happens when the request goes directly to the API.

For a possible IDOR, I can change the identifier and check whether I can access a resource that shouldn't be available.

For a possible stored XSS, the question is whether attacker-controlled input can actually reach a context where JavaScript can be executed.

And for an SSRF hypothesis, finding a WebClient that accepts a URL isn't enough. I need to demonstrate that this input can actually influence a request made by the server.

The diary

The whole investigation is recorded in .ai/SECURITY_SCAN.md.

This ended up being important because security has a lot of things that can change during an investigation. A hypothesis can look great at the beginning and then be discarded. A test can be inconclusive. A second attempt can show that another layer was blocking everything.

So the agent records:

hypothesis
    ↓
test
    ↓
evidence
    ↓
result

Each hypothesis can end as CONFIRMED, DISPROVED, or INCONCLUSIVE.

And I added a rule that I consider especially important: before turning something into a vulnerability, the agent has to try to prove itself wrong.

It needs to reproduce the problem, check whether another layer is blocking it, understand whether the impact actually exists, and verify that the behavior isn't simply intentional.

Only then does a finding become a vulnerability.

Benchmarks

I plan to go into more detail about this in another post, but public benchmarks usually aren't enough to choose models for a squad.

To get an idea of how important it is to have your own benchmark protocol, while writing this post I changed the Planner, Refiner, and Engineer agents twice.

What was evaluated

Role Goal Notes
Refiner Turn a raw idea, issue, or requirement into a clear specification for the next agents Understanding intent; identifying ambiguities; discovering implicit requirements; identifying constraints; organizing information; removing unnecessary scope; improving a request without changing its intent
Planner Understand the problem in the context of the project and define how it should be solved before coding Reading and understanding existing code; mapping affected files and components; breaking down the task; identifying dependencies; defining the order of changes; anticipating edge cases; choosing the technical approach; completeness and clarity of the plan
Engineer Execute the proposed solution and deliver a working implementation Code quality; adherence to the plan; adherence to existing patterns; understanding of the architecture; implementation correctness; handling edge cases; impact on existing parts; ability to solve problems found during execution; amount of intervention needed
Reviewer Try to find problems in the implementation before it is considered finished Ability to question decisions; bug detection; requirement inconsistencies; regressions; unnecessary code; architectural issues; edge cases; quality of proposed fixes; attention to detail; willingness to not accept the implementation as correct without checking
Security Look for security issues in the solution, including problems that aren't immediately obvious Authentication and authorization validation; access control; input validation and sanitization; data exposure; secrets; permissions; endpoints; file handling; error handling; possible abuse vectors; vulnerability identification; distinguishing real issues from false positives

The challenges

I preferred to keep the number of challenges small for this first round of agents, but I wanted them to reflect the kind of work the squad would actually have during development:

Challenge Scope
Reactions on posts and projects Web + Service + Redis + Turnstile
Statistics dashboard Web + Service + UI + Redis
Fixing Security Agent reports Code analysis + debugging + security

The environment

The environment was controlled to avoid other outside influences:

# Used
Program OpenCode
MCPs Caveman, Context7, Github, Knowledge-rag, Postgres & Sequential-thinking
Skills Caveman
Workspace All projects at the latest commit from 09/13/2026

The results

These results should be considered only for this Squad. They may not repeat at another point in time, in another project, or even with the same models.

Model Refiner Planner Engineer Reviewer Security
GPT 6 Luna 9 9.5 8.5 8.5 8.5
GPT 5.6 Luna 9 9.3 8.2 8.2 8.3
Nemotron 3 Ultra 2 2 4 7 4
Qwen 3.8 Flash 7 7 7.5 5.5 6.5
GLM 5.3 Flash 4 4.5 7.8 4 8
DeepSeek V4 Flash 0 1 2 0 0

To understand the scores:

Score Interpretation
0–2 Couldn't fulfill the role in a usable way
3–4 Managed to execute partially, but with serious problems and/or a lot of intervention
5–6 Works, but has clear limitations and requires considerable review
7–8 Good performance, generally usable with normal review
9–10 Excellent and consistent performance, with little need for intervention

GPT 5.6 Luna and GPT 6 Luna

I don't know what magic OpenAI did with these models, but they manage to be cheap and efficient in pretty much every role.

For me, the highlight is upstream, especially Refiner and Planner. They can take a somewhat messy idea and turn it into something much clearer and more efficient.

They also did well as Engineer, Reviewer, and Security, but I felt they end up spending a little more than they need to. They're not bad in those roles. They just don't seem to make as much sense when the goal is optimizing cost.

Nemotron 3 Ultra

It doesn't refine or plan well. It actually hurts to watch it trying to write some things.

As an Engineer, it didn't do very well either and gets VERY lost along the way.

In Security, it was pretty meh. It would forget what it had tested or even what it was testing and, sometimes, it seemed like it was just marking things as successful so it could finish the task.

The surprise was the Reviewer.

It is still my reviewer precisely because it is ANNOYING. Very annoying.

Outside the benchmarks, there was a situation where I gave it an issue, followed the development, and saw that the implementation wasn't turning out very well. I asked the Planner to have the Engineer adjust it.

Nemotron picked at the implementation so much during the review that it made the Engineer delete everything and redo practically the whole thing from scratch, following what was described in the issue.

Qwen 3.8 Flash

It refines and plans very well, with a special highlight as Refiner.

As an Engineer, it also did well and managed to deliver the tasks, but it gets stuck in its own habits.

In Review and Security, it was missing a bit of that behavior of being a little shit and looking for problems where there apparently aren't any.

That ends up taking away an important part of these agents' jobs.

GLM 5.3 Flash

As Refiner and Planner, it's useless.

The low scores mainly come from that.

As an Engineer, though, it can do a good job. The problem is that it has some pretty strong habits that are difficult, if not impossible, to work around.

As a Reviewer, it wasn't satisfactory, even though it knows how to be annoying about some things.

In Security, though, it wasn't bad. It knew how to be annoying and pay attention to details that could easily go unnoticed.

DeepSeek V4 Flash

It couldn't solve even a simple problem satisfactorily during the benchmark.

Sometimes I get the impression that DeepSeek is much more optimized for coding benchmarks and isolated puzzles than for working inside a squad, where it needs to understand context, follow a process, and collaborate with other agents.

That's a hypothesis, and this benchmark alone doesn't prove anything. But the difference in behavior was interesting.

Here I wasn't just testing whether the model could solve a coding problem. I was testing whether it could work inside a development process, with context, rules, and other agents.

Built in the open

When I started, the idea really was to "build in the open", showing that it's possible to create quality, functional, and secure code using squads and low-cost models.

The repositories exist and the service is published, except for the agent squad, because I thought there was one thing that needed to be clear first: there is no AGENTS.md, Squad, Model, MCP, or magical Skill that will be the best fit for your project. I plan to explain this better in another post, so I'll keep it brief here.

I can't be a hypocrite and say that there aren't good MCPs, Skills, and AGENTS.md. There are. I myself like using some that are almost sold as "miracles", like Context7, Sequential Thinking, and Taste Skill.

Unfortunately, a lot of developers (and executives) are falling for this and some are even paying a lot of money for something that doesn't deliver nearly as much performance as they're trying to sell.

The truth about squad agentic coding is that, without good engineering behind it and someone who actually understands what they're doing, the result rarely gets close to being satisfactory. It can work, but after 7–10 rounds even the model doesn't know what it's doing anymore.

An engineer who knows how to write good agents, create and configure the right MCPs, and write the Skills the project actually needs will get better results. And in the long run, that can bring more benefits, lower costs, and even more flexibility and stability for both upstream and downstream.


Related Projects



Comments