One commit, five stages.
Three sites on one Bitrix core, two Docker images, a private pinned core repository. Every push walks the same road, and nothing is published until the code has been read by machines it cannot argue with.
- Quality6 checks on the source
- Buildapp, then nginx from it
- Verifyopt-in, manual
- Scan2 images, findings by CWE
- Shipall eight green
Example · how it was built on a real project
The eight.
I build the pipeline around your project: your stack, your risks, your rules for a release. This is how it came out on one real Bitrix project. Six checks read the source, two read the finished images.
Another project gets another eight. GitLab CI or GitHub Actions, PHP or Node, Go or Python: the tools change, the idea stays. Nothing ships unread.
- 01Code
Pipeline tests
The CI scripts are tested too, against fake Docker, registry and scanners.
- 02Code
PHP lint
Every PHP file is parsed. Nothing is executed.
- 03Code
PHPStan
Static analysis of the sites: wrong types, calls to nothing, classes that do not exist. Vendors and third-party viewers stay out of scope.
- 04Code
SonarQube
Bugs, code smells and security hotspots, reported on the merge request where they appear.
- 05Secrets
Gitleaks
Keys and passwords in the repository, reported redacted.
- 06Libraries
Composer audit
Known advisories in each site’s locked packages.
- 07Image
Trivy · app
High and critical vulnerabilities that have a fix, in the PHP image.
- 08Image
Trivy · nginx
The same scan for the web server image built on top of it.
Built once. Named by its commit.
app:latest app:3f9c2e1
- The image is the evidence. Scanners read the exact image that will run, tagged with its commit, not a moving
latest. - No race between pipelines. Two merges at once cannot swap the scan’s input. Nothing scans an alias.
- Merge requests stay private. Their images are built to prove they build, and are not published.
- Nothing starts by accident. Running the containers is a separate manual check, off by default.
Weaknesses, not packages.
A scan returns a list of package versions. The last stage turns it into a short list of weakness classes, so the team fixes a cause once instead of chasing every package.
How a report reads. Classes shown as examples, not this project’s results.
- CWE-79
- Cross-site scripting
- escape output where it is printed
- CWE-89
- SQL injection
- bound parameters, no string concatenation
- CWE-862
- Missing authorization
- check the right before the action
- CWE-798
- Hard-coded credentials
- move to CI variables and rotate
- CWE-1395
- Vulnerable third-party component
- update the base image or the lockfile
Fewer blind “Looks good to me.”
Checks catch what rules can describe. Code quality still needs a person. So the pipeline gives that person something to read first: an AI review of the change, posted on the merge request next to the reports.
The report is not only about CVEs. It is written for whoever approves: what changed, what looks risky, what to look at first.
- AI
Reads the change
The diff, the check results and the scan, together. It writes short notes with the line each one is about.
- You
Check each note
Open the code, decide whether the note is relevant. A note is a reason to look, not a verdict.
- You
Approve or send back
With the note attached, so the author sees why. The AI never approves anything.
orders/ajax.php:41A request parameter goes into the ORM filter without a type check.Relevant. Sent back to the author.
Handler::save()The method grew to 140 lines and mixes rendering with saving.Known. Separate task, dismissed with a reason.
composer.lockA new package has had no release in three years.Question. Asked the author why this one.
The AI does not approve.
It makes “LGTM” cost a read.
Agents do the repetitive part.
An AI agent reads the findings, finds the cause and drafts the fix. It works inside rules written in the repository, and its work goes through the same eight checks as anyone’s.
- 01Rule
One fix, one commit
Each fix lands with its own tests and a line in the tracker, so it can be reviewed and reverted on its own.
- 02Rule
Hands off production
No running the stack, no data, no secrets, no calls to live integrations. Static analysis and isolated tests only.
- 03Rule
No silent scope creep
The agent fixes what it was given. Anything else it notices goes into the report for a person to decide.
“Fixed in code” is the agent’s word.
“Closed” is mine.
From your YAML to mine.
- 01Step
Read
You send the pipeline you have, or tell me you have none. I answer in writing with what I would add first and why.
- 02Step
Agree the gates
Which checks block a release and which only report. Written into the pipeline, not kept in someone’s head.
- 03Step
Build
Checks, image build, scans, the CWE report and AI review notes, on a branch, until a full run is green or every red is explained.
- 04Step
Hand over
Pipeline in your git, variables in your CI settings, the agent’s rules in the repository, a page on what to do when a check goes red.
Questions.
Will a red check stop the release?
Only the checks we agree on. Each one is written into the pipeline as blocking or reporting, so the rule is visible to everyone and changes only by a merge request.
Do you need to run our project to set this up?
No. Every check here works on the source and the built images. Starting the application is a separate, manual step that is off by default.
We use GitHub, not GitLab.
The checks are the same tools: PHPStan, Gitleaks, Composer audit, SonarQube and Trivy run in GitHub Actions too. The case on this page is GitLab CI.
Does the AI approve merge requests?
No. It writes notes for the reviewer and nothing more. Approving stays with a person, who reads the notes, checks them against the code and decides.
What does the AI agent have access to?
The repository and the reports. Not production, not your data, not your secrets. Its rules are a file in the repository, and every change it makes goes through the same eight checks and a human review.