# No One Talks Enough About Security for AI Coding. Here's How I Do It in My Workflows <!-- ref: @content/youtube/cole-medin/no-one-talks-enough-about-security-for-ai-coding-here-s-how-i-do-it-in-my-workflows tags: [AI coding security, CVEs, dependency risk, deterministic gates, SonarQube, agent workflows, pull request verification] version: 2 updated_at: 2026-11-24T06:11:59.752Z --> **[Watch on YouTube](https://www.youtube.com/watch?v=SGodxQHnVxc)** # No One Talks Enough About Security for AI Coding. Here's How I Do It in My Workflows *Synthesized from Cole Medin, 2026-09-10.* Cole Medin presents this solo video and walks through his own agent workflow, built in the open-source Archon tool (captioned as "Arkon" in the transcript), with SonarQube scanning. ## Core Thesis Cole Medin argues that AI coding agents routinely add security flaws, either by writing unsafe code or by adding third-party packages that carry known CVEs, including packages pulled in as dependencies of dependencies. Asking a second agent to review the pull request is a useful start, but it is another probabilistic check that tends to miss what the first agent missed. His answer is a deterministic gate: scan against the CVE catalog, force the implementing agent to fix whatever is flagged, and open the merge request only once the scan is green. ## Key Insights - **Two sources of flaws.** The agent can write a vulnerability straight into the code, such as SQL injection, or install a library that already has one. Agents usually check only the top level of a dependency tree, not the chain beneath it. - **Noticed but unfixed.** Agents sometimes flag a vulnerability in the pull-request description and suggest a separate fix, which may never happen, so the flaw stays in the codebase. - **Reviewer agents.** A separate review agent is better than nothing, but it is another probabilistic step, and if the implementing agent missed an issue the reviewer often misses it too. - **The gate workflow.** Classify the task as a bug or a feature, plan it, implement it, run tests and open a merge request. A script node, not an agent, then calls the SonarQube API to scan the merge request. An agent fixes what is flagged, and a rescan confirms the result before the workflow hands control back for a manual review. - **Worked example.** On issue 79, a scan of merge request 73 flagged three problems, one a possibly hardcoded password. The agent fixed them, and the rescan reached an A safety rating. - **Operations.** The scan can run in CI. A monitoring agent reads the workflow logs and reports which stage is running, and several workflows can run in parallel for different issues. ## Actionable Takeaways 1. Add a deterministic scan step, such as SonarQube, to every agent-generated change, rather than relying on an agent to find CVEs on its own. 2. Make sure the scanner covers transitive dependencies, not just the packages the agent named. 3. Treat a red scan as a hard stop: the implementing agent reruns the fix until the scan is green, and only then does the merge request open. 4. Run the scan from a script node instead of an agent, so that the step always completes the same way. 5. Use a monitoring agent to read workflow logs and report stage status while several issue workflows run in parallel. ## Notable Quotes > "This simply cannot be the end of your vulnerability discovery," — Cole Medin > "Only when everything turns green are you allowed to open the merge request." — Cole Medin --- *Related: `@content/youtube/nate-herk/how-anthropic-engineers-actually-prompt-fable-5` · `@content/youtube/nate-herk/how-i-make-opus-think-like-fable-5-easy-steps` · `@content/youtube/bmad-code/bmad-v6-is-finally-here-bmad-help-party-mode-pure-magic` · `@content/youtube/latent-space/scaling-linears-gtm-to-100m-arr-cristina-cordova-coo`* --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*