ENGINEERING

Scan new GitLab MR diffs for leaked secrets and block the merge

On every new merge request, this scans the diff for hardcoded secrets and credentials, and if any are found it sets the MR to draft, applies a blocking label.

CategoryEngineering
Enginesim
Difficultyadvanced
Triggerwebhook
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitLab MR webhook fires on open or updateGitLabGitLab
  • ActionFetch the MR diff from GitLabGitLabGitLab
  • ActionClassify suspicious strings as secrets with OpenAIOpenAI
  • LogicBranch: any confirmed secret found?
  • ActionSet MR to draft + apply blocking labelGitLabGitLab
  • OutputAlert the security channel in SlackSlack

What it does

Inspects the diff of every incoming merge request for leaked credentials — API keys, tokens, private keys, connection strings — using pattern matching plus an LLM pass to catch context-specific secrets the regex misses. When something looks exposed, it converts the MR to draft, applies a `blocked:secret-detected` label, and notifies the security team with the exact files and lines.

When to use it

Use it as a last-line guard before merge when pre-commit hooks are inconsistently installed across a team. It catches secrets that slip past local tooling and stops them from reaching a protected branch.

How it works

  1. 1A GitLab merge request webhook fires when an MR opens or updates.
  2. 2The flow pulls the MR diff via the GitLab API.
  3. 3An OpenAI pass classifies suspicious strings as real secrets versus false positives and returns the affected file and line.
  4. 4A branch checks whether any confirmed secret was found.
  5. 5If yes, the flow marks the MR draft and applies the blocking label via GitLab.
  6. 6A Slack alert goes to the security channel listing each finding.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitLabRepos, MRs, pipelines, registry.
  2. 2
    Connect OpenAIModels, embeddings, files.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.