CTL-163 · agent

Scanning Agent-Written Code in the Pipeline

Run static checks on anything an agent writes or changes before it can reach a build or main branch.

TechnicalEffort LowEffectiveness Medium

Let CI/CD be the gatekeeper and do not accept agent output on trust. Scan agent and MCP config files, browser extension and agent source, build inputs and generated diffs. Look for hard-coded credentials, committed secrets, destructive commands and prompts planted for a later agent to run. Fail the build automatically when a check trips, and keep the check required so that neither the agent nor a rushed reviewer can skip it.

Put it in place

  1. 01Add secret scanning and SAST as required checks on agent-authored branches.
  2. 02Include agent and MCP config files and prompt files in scan scope.
  3. 03Add rules that flag destructive commands and embedded instructions.
  4. 04Block merge on failure with no agent-level override.

Counters 4 techniques