-
-
This image is currently processing. Please be patient...
Inspiration
A passing pipeline can still contain a security finding. For a small team, the work after that finding—triage, a safe patch, verification, merge and deployment—can take more attention than writing the feature. We built an assembly line that carries the evidence through those handoffs.
What it does
The Assembly Line After Code combines a real TypeScript payments-policy demo, a four-station GitLab Duo custom flow, and a deterministic release controller.
The original unsafe loader evaluated configuration as code. Duo created issue #3, committed an eval-to-JSON repair, opened MR !1 and posted its review. The final implementation adds executable security regression tests and a release controller that:
- Starts the configured Duo flow for an explicitly selected release MR and waits for the agents to finish.
- Requires passing unit tests and
PROOF_OF_FIX PASSEDfor the exact patch commit. - Reads the Semgrep and secret-detection artifacts and requires zero findings.
- Confirms that the patch and main branch have not changed, then merges only the verified SHA.
- Waits for main CI to publish the actual compiled policy loader to GitLab Pages.
- Checks the anonymous public health endpoint against the exact production commit.
The browser demo accepts JSON retry policies and shows that an injection payload is rejected without executing it. Its health record links the deployed commit to the real pipeline.
GitLab implementation
The repository contains the exact Flow Registry v1 YAML enabled as AI Catalog v2.1.0. Four AgentComponents handle triage, targeted repair, diff verification and release evidence, using explicit routers and minimal built-in toolsets. GitLab CI runs tests, deterministic proof, SAST, secret detection and Pages deployment. A Python controller orchestrates the release through GitLab's API; its credential stays in the process environment.
Path: Start Fresh. Autonomy: Hands-off after one explicit controller invocation. The initial invocation is the intent; the validated final run needs no intermediate human approval. A permanent pipeline-event webhook is not configured. The original agent repair is MR !1; MR !2 validates the corrected release controller, preserving that repair.
Lifecycle coverage
- Plan: the agent-created tracking issue records the risk and acceptance criteria.
- Create: Duo committed the minimal repair and opened its MR.
- Verify: five executable tests plus the deterministic proof gate.
- Package: CI compiles the TypeScript loader into the published browser artifact.
- Secure: real Semgrep and secret-detection reports are checked for findings.
- Release: the controller merges the verified SHA and CI deploys it.
- Configure: retry policies are loaded as JSON with validated fields and safe defaults; deployment configuration is versioned.
- Monitor: a post-deploy HTTP health probe verifies the production commit.
- Govern: release policy fails closed on failed checks, findings, changed branch heads or timeouts, and saves an audit trail.
Challenges and what we learned
The enabled catalog flow differed from an early repository draft, so we synchronized the actual executable definition. A green scanner job did not mean zero findings, so the controller reads the reports. The first controller run correctly blocked on its own new SAST findings; we fixed the code without disabling scanner rules. Pages deployment succeeded, but the Pages administration API required Maintainer permissions. The final controller discovers the public URL through the Developer-accessible production environment API instead.
We learned to give agents the reasoning work and make the release boundary executable: a diff review is useful evidence, while tests, scan artifacts, exact-SHA checks and a public health readback decide whether the release completes.
Impact and next steps
The target is small teams that need fewer manual post-code handoffs while retaining inspectable evidence. Next steps are a persistent pipeline-event trigger, more repair lanes, and continuous health monitoring. The current monitoring scope is a deployment probe; governance is the enforced release policy and saved evidence. No Google Cloud bonus or measured sustainability benefit is claimed.
Built With
- ai-agents
- automation
- devsecops
- gitlab
- gitlab-ci/cd
- gitlab-duo-agent-platform
- sast
- typescript