AI code review for GitLab · vulnerability auto-fix for AWS ECR

The AI reviewer that reads the whole repo.

Inline comments on the exact line, from a model that checked other files first. Container CVEs traced to the dependency that brings them in, then fixed.

Self-managed GitLab · Amazon ECR · Bedrock, Azure OpenAI, Anthropic, OpenAI, LiteLLM, local models

A mrsentry inline comment on a GitLab merge request diff, flagging an SQL injection with a one-click suggested fix
0duplicate comments on re-runs
8package managers it can fix
6kinds of LLM endpoint
1overview note, updated in place
Features

Precision first.
Then everything else.

mrsentry posts fewer, better comments. Each one is checked against your code before it reaches the merge request.

⌘

Full-repository context

It clones the repo at the exact MR head and reads the enclosing function, imports and related symbols. Before claiming anything about other files, it checks them with read_file, grep and find_symbol.

How the review works
✓

Evidence-verified findings

Every finding has to quote the code it's about, and the quote is matched against the real line. If they don't match, the finding is dropped. A critic pass then removes noise and duplicates.

Verification
↻

Clean, idempotent threads

Re-runs never post the same comment twice. When an issue is fixed, its thread is resolved. There's one overview note, edited in place, and diffs that haven't changed aren't reviewed again.

Re-runs
◎

Knows how fresh your ECR scan is

It detects basic or enhanced scanning, and on-push or continuous, for each repository. Stale results get a rescan or a local Trivy/Grype scan, so teams on scan-on-push aren't working from old data.

ECR scanning
⇢

Finds the dependency behind every CVE

Maps each finding to the exact path in your dependency graph across Maven, Gradle, npm, pnpm, yarn, Poetry, uv and pip, whether it's a direct dependency or five levels deep.

Dependency mapping
⚙︎

Fixes that are proven, not guessed

It upgrades the smallest version that fixes the issue, preferring a bump of the direct parent and pinning only when it has to. Then it regenerates lockfiles, re-resolves the graph to prove the vulnerable version is gone, and runs your build. If the upgrade breaks the build, the AI repairs it inside a sandbox.

Verify and repair
◇

Secure by design

Agent tools are confined to the checkout. Build commands never see your GitLab or AWS credentials. Repo config from the MR can't redirect your LLM.

Security model
The overview

One note that tells the whole story.

A verdict, a summary of the change, severity counts, and links to every thread. Below that, a security section showing how ECR scans this repository, how old the data is, and which dependency brings in each CVE.

  • Edited in place. It's never reposted, so the MR timeline stays readable.
  • Honest about freshness. Shows the scan type, frequency and last scan time.
  • Machine-readable too. Also writes GitLab Code Quality, SARIF, JSON and dotenv.
The mrsentry overview note: verdict, severity table, findings with thread links, and a container vulnerability table with dependency paths
Dependency intelligence

A CVE in the image is a line in your manifest.

mrsentry follows a vulnerable package back through the dependency graph to the manifest you own, then picks the least invasive fix.

A vulnerable transitive dependency, jackson-databind 2.13.3, reached through spring-boot-starter-json 2.7.2. Preferred fix: bump the direct parent. Otherwise pin the transitive version. orders-api your project spring-boot-starter-json 2.7.2 · direct jackson-databind 2.13.3 · transitive CVE-2022-42003 · fixed in 2.13.4.2 ① Preferred: bump the direct parent spring-boot-starter-json 2.7.2 → 2.7.5 already pulls jackson-databind 2.13.4.2 (checked against Maven Central) ② Otherwise: pin the transitive version <dependencyManagement> jackson-databind 2.13.4.2, then re-resolve the graph to prove it took effect
Auto-fix

Delivered the way your team works.

Choose per pipeline: open a new fix MR, or push the fix straight into the MR under review.

  • One MR per CVE set. Re-runs refresh it. A new CVE set closes the old MR.
  • No force pushes into your branches. Protected branches and forks are handled.
  • Built-in loop guard. The bot's own commit never starts another fix.
  • Unverified fixes open as Draft, labelled mrsentry::needs-human.
A fix merge request opened by mrsentry listing upgraded packages, how each was fixed, and verification results
Amazon ECR

Scan-on-push or continuous.
It adapts.

Teams configure ECR differently. mrsentry reads the effective configuration for each repository and decides how far to trust the findings.

ECR freshness decision: detect scan type and frequency, then decide whether findings are fresh, and if stale rescan, scan locally, warn or fail. Detect scan profile registry rules → repo filters → legacy scanOnPush Enhanced · Continuous Inspector re-evaluates on new CVEs Fresh, unless SCAN_ELIGIBILITY_EXPIRED if stale → use findings Enhanced · On push re-scan cannot be triggered Stale when older than freshness_max_age if stale → local Trivy / Grype Basic · On push / manual mostly OS packages Stale when older than freshness_max_age if stale → StartImageScan → local

Freshness rules in detail

Bring your own model

Any LLM. Your rules.

Named profiles, a different model per task, automatic fallbacks and a hard cost limit for each run. API keys stay in environment variables.

mrsentry routes each task to a named LLM profile through LiteLLM: Amazon Bedrock, Azure OpenAI, Anthropic, OpenAI, a LiteLLM proxy, or local OpenAI-compatible servers. mrsentry via LiteLLM Amazon Bedrock bedrock/… Azure OpenAI azure/<deployment> Anthropic anthropic/… OpenAI openai/… LiteLLM proxy litellm_proxy/… vLLM · Ollama openai/ + api_base

Switch models with one line.

Use a strong model for the review, a cheaper one for the critic pass, and keep a LiteLLM proxy as a fallback for rate limits.

Provider recipes
llm:
  profiles:
    default:
      model: bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0
    azure:
      model: azure/gpt-4o-review
      api_base: https://acme.openai.azure.com
      api_key_env: AZURE_OPENAI_API_KEY
    proxy:
      model: litellm_proxy/claude-sonnet
      api_base: https://litellm.internal
  roles: { review: default, summarize: azure }
  fallbacks: [proxy]
  max_cost_usd_per_run: 5
GitLab CI

Two pipelines. One include.

Merge request pipelines review the change and fix it inside the MR. Scheduled pipelines open a fix MR from the latest image scan without running a review.

Two pipelines. Merge request pipeline: review job, then a generated child pipeline pushes the fix into the MR. Scheduled pipeline: scan the latest image and open or refresh one fix MR. MERGE REQUEST PIPELINE MR opened / pushed merge_request_event mrsentry:review AI review + ECR scan + overview fix-pipeline.yml generated only if fixable child: mrsentry:fix commit pushed into the MR next pipeline sees the Mrsentry-Fix trailer and does not start another fix (loop guard) SCHEDULED PIPELINE Nightly schedule no code review Scan latest image freshness-aware ECR / Trivy Map + fix + verify deps graph · bump · build One fix MR refreshed, never duplicated Same CVE set → same branch and MR. A new CVE set supersedes and closes the older fix MR.
include:
  - project: platform/mrsentry
    ref: main
    file: templates/ci/mrsentry.gitlab-ci.yml

variables:
  MRSENTRY_IMAGE: registry.example.com/mrsentry:full
  # ECR repo name or full URI; enables scan + fix
  MRSENTRY_ECR_IMAGE: orders-service
  MRSENTRY_FIX_WHEN: on_success  # or manual
Install

One command on any Linux runner.

Debian, Ubuntu, Amazon Linux 2 and 2023, RHEL and macOS. The installer sets up its own Python, so the distro's version doesn't matter. There are also slim and full Docker images with every toolchain included.

Run mrsentry doctor to check your token scopes, LLM access, AWS identity and ECR scanning setup in a few seconds.

Installation options
Terminal output of mrsentry doctor and mrsentry ecr status

Ship safer merge requests
starting today.

Install it, add a token, and run your first review in under five minutes.

curl -fsSL https://raw.githubusercontent.com/devops-monk/mrsentry/main/install.sh | sh