Configuration reference
Every parameter mrsentry accepts, generated from the code. Each key can be set in YAML, as an environment variable, or for many keys, as a CLI flag.
Where settings come from
From highest to lowest priority:
- CLI flags, e.g.
--fail-on highor--model azure/gpt-4o. - Environment variables named
MRSENTRY_<SECTION>__<KEY>(double underscore between levels). Values are parsed as YAML, soMRSENTRY_REVIEW__EXCLUDE='["**/gen/**"]'andMRSENTRY_REVIEW__MAX_INLINE_COMMENTS=10both work. - The repository's
.mrsentry.yml, restricted to the keys marked repo below. - Org config from
--configorMRSENTRY_CONFIG. - Defaults.
In GitLab CI, CI_SERVER_URL, CI_PROJECT_ID and CI_MERGE_REQUEST_IID fill in gitlab.url, gitlab.project and gitlab.mr_iid automatically. The GitLab token is looked up in MRSENTRY_GITLAB_TOKEN, then the variable named in gitlab.token_env, then GITLAB_TOKEN.
Useful commands
mrsentry config init writes an annotated starter file. mrsentry config show prints the effective configuration with secrets redacted. mrsentry config validate checks it, including a repository's .mrsentry.yml with --repo-dir.
On this page: GitLab · LLM · Review · ECR · Fix · Output · General
GitLab gitlab.*
Where your GitLab is and how mrsentry authenticates to it.
| Key | Type / default | Description |
|---|---|---|
gitlab.urlMRSENTRY_GITLAB__URL |
str |
GitLab base URL, e.g. https://gitlab.example.com. Defaults to $CI_SERVER_URL. |
gitlab.tokenMRSENTRY_GITLAB__TOKEN |
str |
Bot token (project/group access token or PAT) with api + write_repository. Prefer env MRSENTRY_GITLAB_TOKEN. CI_JOB_TOKEN cannot post notes. |
gitlab.token_envMRSENTRY_GITLAB__TOKEN_ENV |
str |
Name of the env var holding the token, if your CI already uses its own (e.g. COMPANY_GITLAB_TOKEN). Default lookup: MRSENTRY_GITLAB_TOKEN, then GITLAB_TOKEN. |
gitlab.verify_sslMRSENTRY_GITLAB__VERIFY_SSL |
booltrue |
Verify TLS certificates. |
gitlab.ca_bundleMRSENTRY_GITLAB__CA_BUNDLE |
str |
Path to a custom CA bundle for self-managed GitLab. |
gitlab.timeout_sMRSENTRY_GITLAB__TIMEOUT_S |
float30.0 |
HTTP timeout in seconds. |
gitlab.max_retriesMRSENTRY_GITLAB__MAX_RETRIES |
int4 |
Retries on 429/5xx with exponential backoff. |
gitlab.projectMRSENTRY_GITLAB__PROJECT |
str |
Project id or path (group/name). Defaults to $CI_PROJECT_ID. |
gitlab.mr_iidMRSENTRY_GITLAB__MR_IID |
int0 |
Merge request IID. Defaults to $CI_MERGE_REQUEST_IID. |
LLM llm.*
Model profiles, which profile each task uses, fallbacks and spending limits.
| Key | Type / default | Description |
|---|---|---|
llm.profilesMRSENTRY_LLM__PROFILES |
dict{"default": {"model": "anthropic/claude-sonnet-4-5", "api_base": "", "api_key_env": "", "api_version": "", "aws_region": "", "temperature": 0.1, "max_tokens": 8192, "timeout_s": 180.0, "extra": {}}} |
Named model profiles. |
llm.roles.reviewMRSENTRY_LLM__ROLES__REVIEW |
str"default" |
Profile used for the main review pass. |
llm.roles.summarizeMRSENTRY_LLM__ROLES__SUMMARIZE |
str"default" |
Profile used for the critic/summarizer pass. |
llm.roles.fix_repairMRSENTRY_LLM__ROLES__FIX_REPAIR |
str"default" |
Profile used for repairing builds broken by dependency bumps. |
llm.fallbacksMRSENTRY_LLM__FALLBACKS |
list |
Profiles tried in order when a call fails. |
llm.max_retriesMRSENTRY_LLM__MAX_RETRIES |
int3 |
Retries per call (rate limits, transient errors). |
llm.max_cost_usd_per_runMRSENTRY_LLM__MAX_COST_USD_PER_RUN |
float5.0 |
Abort further LLM calls once estimated cost exceeds this. |
llm.input_token_budgetMRSENTRY_LLM__INPUT_TOKEN_BUDGET |
int600000 |
Total input-token budget for one review run. |
Review review.*
What gets reviewed, how strict the reviewer is and how comments are posted.
| Key | Type / default | Description |
|---|---|---|
review.enabledMRSENTRY_REVIEW__ENABLED |
booltrue |
Run the AI code review step. |
review.categories repoMRSENTRY_REVIEW__CATEGORIES |
list["bug", "security", "performance", "reliability", "maintainability", "testing"] |
Review categories the model may report. |
review.min_severity repoMRSENTRY_REVIEW__MIN_SEVERITY |
Severity"medium" |
Lowest severity posted as an inline comment. |
review.min_confidence repoMRSENTRY_REVIEW__MIN_CONFIDENCE |
float0.6 |
Drop findings with model confidence below this (0-1). |
review.max_inline_comments repoMRSENTRY_REVIEW__MAX_INLINE_COMMENTS |
int25 |
Cap on inline comments per run (highest severity first). |
review.include repoMRSENTRY_REVIEW__INCLUDE |
list["**"] |
Glob patterns of files to review. |
review.exclude repoMRSENTRY_REVIEW__EXCLUDE |
list["**/*.lock", "**/package-lock.json", "**/pnpm-lock.yaml", "**/yarn.lock", "**/*.min.js", "**/*.map", "**/dist/**", "**/build/**", "**/generated/**", "**/vendor/**", "**/*.snap", "**/*.svg", "**/*.png", "**/*.jpg"] |
Glob patterns of files to skip. |
review.max_file_diff_linesMRSENTRY_REVIEW__MAX_FILE_DIFF_LINES |
int1500 |
Files with larger diffs are reviewed hunk-group by hunk-group. |
review.unit_token_targetMRSENTRY_REVIEW__UNIT_TOKEN_TARGET |
int24000 |
Approximate input tokens per review unit (chunk size). |
review.concurrencyMRSENTRY_REVIEW__CONCURRENCY |
int4 |
Parallel review units. |
review.agent.enabledMRSENTRY_REVIEW__AGENT__ENABLED |
booltrue |
Let the model call read-only repo tools to verify findings. |
review.agent.max_stepsMRSENTRY_REVIEW__AGENT__MAX_STEPS |
int12 |
Max tool-calling rounds per review unit. |
review.agent.tool_timeout_sMRSENTRY_REVIEW__AGENT__TOOL_TIMEOUT_S |
int20 |
Timeout for a single tool call. |
review.agent.max_tool_output_charsMRSENTRY_REVIEW__AGENT__MAX_TOOL_OUTPUT_CHARS |
int20000 |
Truncate tool output beyond this many characters. |
review.summarizerMRSENTRY_REVIEW__SUMMARIZER |
booltrue |
Run a critic pass that removes noise and duplicates. |
review.incrementalMRSENTRY_REVIEW__INCREMENTAL |
booltrue |
Skip files whose diff is identical to the last reviewed one. |
review.suggestions repoMRSENTRY_REVIEW__SUGGESTIONS |
booltrue |
Emit GitLab suggestion blocks when safe. |
review.guidelines repoMRSENTRY_REVIEW__GUIDELINES |
list["bundled:general", "bundled:java", "bundled:python", "bundled:typescript", "repo:.mrsentry/guidelines.yml"] |
Guideline packs: bundled:<name>, repo:<path> or an absolute path. |
review.extra_instructions repoMRSENTRY_REVIEW__EXTRA_INSTRUCTIONS |
str |
Free-text team instructions appended to the prompt. |
review.language repoMRSENTRY_REVIEW__LANGUAGE |
str"English" |
Language used for comments. |
review.skip_draft_mr repoMRSENTRY_REVIEW__SKIP_DRAFT_MR |
boolfalse |
Skip MRs marked Draft. |
review.resolve_fixedMRSENTRY_REVIEW__RESOLVE_FIXED |
booltrue |
Resolve bot threads whose finding no longer reproduces. |
review.post_lgtm repoMRSENTRY_REVIEW__POST_LGTM |
booltrue |
Post an overview note even when there are no findings. |
ECR ecr.*
Which image to scan, which severities matter and what to do with stale results.
| Key | Type / default | Description |
|---|---|---|
ecr.enabledMRSENTRY_ECR__ENABLED |
booltrue |
Run the ECR vulnerability step when an image is given. |
ecr.imageMRSENTRY_ECR__IMAGE |
str |
ECR repository[:tag|@digest] or full URI <acct>.dkr.ecr.<region>.amazonaws.com/<repo>:<tag>. |
ecr.regionMRSENTRY_ECR__REGION |
str |
AWS region (falls back to AWS_REGION / default chain). |
ecr.registry_idMRSENTRY_ECR__REGISTRY_ID |
str |
AWS account id of the registry (default: caller account). |
ecr.tag_strategyMRSENTRY_ECR__TAG_STRATEGY |
Literal"latest-pushed" |
How to pick the image when no tag/digest is given. |
ecr.tag_filterMRSENTRY_ECR__TAG_FILTER |
str |
Regex limiting candidate tags for latest-pushed/semver. |
ecr.min_severity repoMRSENTRY_ECR__MIN_SEVERITY |
Severity"high" |
Lowest vulnerability severity to act on. |
ecr.freshness_max_ageMRSENTRY_ECR__FRESHNESS_MAX_AGE |
str"24h" |
Findings older than this are considered stale. |
ecr.on_staleMRSENTRY_ECR__ON_STALE |
OnStale"rescan" |
rescan (BASIC only, then local), local (Trivy/Grype), warn, or fail when findings are stale or missing. |
ecr.local_scannerMRSENTRY_ECR__LOCAL_SCANNER |
Literal"trivy" |
Scanner used for local fallback. |
ecr.rescan_wait_sMRSENTRY_ECR__RESCAN_WAIT_S |
int600 |
Max seconds to wait for a triggered StartImageScan. |
ecr.include_os_packages repoMRSENTRY_ECR__INCLUDE_OS_PACKAGES |
Literal"report" |
OS/base-image packages are reported (with base image hint) or ignored. |
ecr.ignore repoMRSENTRY_ECR__IGNORE |
list |
Accepted vulnerabilities. |
Fix fix.*
How vulnerabilities are fixed, verified and delivered.
| Key | Type / default | Description |
|---|---|---|
fix.enabledMRSENTRY_FIX__ENABLED |
booltrue |
Allow the fix step. |
fix.modeMRSENTRY_FIX__MODE |
Literal"new-mr" |
Open a new MR or push into the MR. |
fix.target_branchMRSENTRY_FIX__TARGET_BRANCH |
str |
Base branch for new fix MRs (default: project default branch). |
fix.branch_prefixMRSENTRY_FIX__BRANCH_PREFIX |
str"mrsentry/vuln-fix" |
Prefix for fix branches. |
fix.strategy repoMRSENTRY_FIX__STRATEGY |
Literal"prefer-direct-upgrade" |
For transitive deps: try bumping the direct parent first, or pin. |
fix.allow_major_upgrades repoMRSENTRY_FIX__ALLOW_MAJOR_UPGRADES |
boolfalse |
Allow fixes that cross a major version. |
fix.verifyMRSENTRY_FIX__VERIFY |
dict |
Verification command per ecosystem (maven, gradle, npm, yarn, pnpm, poetry, uv, pip). Empty = skip build. |
fix.verify_timeout_sMRSENTRY_FIX__VERIFY_TIMEOUT_S |
int1800 |
Timeout for each verify command. |
fix.allow_llm_repairMRSENTRY_FIX__ALLOW_LLM_REPAIR |
booltrue |
Let the LLM edit code when a bump breaks verification. |
fix.max_repair_iterationsMRSENTRY_FIX__MAX_REPAIR_ITERATIONS |
int3 |
Max LLM repair rounds. |
fix.shell_allowlistMRSENTRY_FIX__SHELL_ALLOWLIST |
list["mvn", "./mvnw", "gradle", "./gradlew", "npm", "npx", "pnpm", "yarn", "node", "python", "python3", "pip", "poetry", "uv", "pytest", "tsc", "java", "javac"] |
Executables the repair agent may run. |
fix.build_env_passthroughMRSENTRY_FIX__BUILD_ENV_PASSTHROUGH |
list |
Env var names passed to build tools despite secret scrubbing (e.g. NEXUS_USER, NEXUS_PASSWORD, NPM_TOKEN used by settings.xml/.npmrc). GitLab/AWS/LLM creds never pass. |
fix.draft_mr repoMRSENTRY_FIX__DRAFT_MR |
boolfalse |
Open fix MRs as Draft. |
fix.labels repoMRSENTRY_FIX__LABELS |
list["security", "mrsentry"] |
Labels on fix MRs. |
fix.commit_author_nameMRSENTRY_FIX__COMMIT_AUTHOR_NAME |
str"mrsentry-bot" |
Git author name for fix commits. |
fix.commit_author_emailMRSENTRY_FIX__COMMIT_AUTHOR_EMAIL |
str"mrsentry-bot@noreply.local" |
Git author email. |
fix.registry_mirrorsMRSENTRY_FIX__REGISTRY_MIRRORS |
dict |
Registry base URLs per ecosystem (maven, npm, pypi) for upgrade lookups, e.g. Nexus/Artifactory. |
Output output.*
Artifacts written for GitLab and for humans.
| Key | Type / default | Description |
|---|---|---|
output.dirMRSENTRY_OUTPUT__DIR |
str"mrsentry-out" |
Directory for JSON/SARIF/CodeQuality/dotenv artifacts. |
output.formatsMRSENTRY_OUTPUT__FORMATS |
list["json", "codequality", "dotenv", "markdown"] |
Artifacts to write: json, markdown, sarif, codequality, dotenv. |
output.save_llm_transcriptsMRSENTRY_OUTPUT__SAVE_LLM_TRANSCRIPTS |
boolfalse |
Store every prompt/response for audit (may hold code). |
output.fail_onMRSENTRY_OUTPUT__FAIL_ON |
mrsentry.config.Severity or None |
Exit 1 if any finding/vuln >= this severity. |
General
Top-level switches.
| Key | Type / default | Description |
|---|---|---|
dry_runMRSENTRY_DRY_RUN |
boolfalse |
Do everything except write to GitLab / push. |
log_levelMRSENTRY_LOG_LEVEL |
str"INFO" |
DEBUG, INFO, WARNING, ERROR. |
Annotated example
This is the starter org config produced by mrsentry config init:
# mrsentry org/CI configuration. Pass with --config or MRSENTRY_CONFIG.
# Secrets never go here: use env vars (MRSENTRY_GITLAB_TOKEN, AWS default chain, api_key_env).
gitlab:
url: https://gitlab.example.com # default: $CI_SERVER_URL
verify_ssl: true
# ca_bundle: /etc/ssl/certs/corp-ca.pem
llm:
profiles:
default: # Amazon Bedrock (uses the AWS default credential chain)
model: bedrock/us.anthropic.claude-sonnet-4-5-20250929-v1:0
aws_region: us-east-1
# azure:
# model: azure/my-gpt-4o-deployment
# api_base: https://my-resource.openai.azure.com
# api_version: "2024-10-21"
# api_key_env: AZURE_OPENAI_API_KEY
# anthropic:
# model: anthropic/claude-sonnet-4-5
# api_key_env: ANTHROPIC_API_KEY
# proxy: # LiteLLM proxy
# model: litellm_proxy/claude-sonnet
# api_base: https://litellm.internal
# api_key_env: LITELLM_API_KEY
# local: # any OpenAI-compatible server (vLLM, Ollama, LM Studio)
# model: openai/qwen2.5-coder-32b
# api_base: http://vllm.internal:8000/v1
# api_key_env: VLLM_API_KEY
roles: { review: default, summarize: default, fix_repair: default }
fallbacks: []
max_cost_usd_per_run: 5.0
review:
min_severity: medium
max_inline_comments: 25
agent: { enabled: true, max_steps: 12 }
# extra_instructions: |
# We use Spring Boot 3 and jOOQ. Flag any raw JDBC.
ecr:
# image: 123456789012.dkr.ecr.us-east-1.amazonaws.com/my-service:latest
min_severity: high
freshness_max_age: 24h
on_stale: rescan # rescan | local | warn | fail
local_scanner: trivy
fix:
mode: new-mr # new-mr | existing-mr
strategy: prefer-direct-upgrade
verify:
maven: mvn -B -q -DskipITs verify
gradle: ./gradlew build -x integrationTest
npm: npm ci
pnpm: pnpm install --frozen-lockfile
yarn: yarn install --frozen-lockfile
poetry: poetry install --no-root
uv: uv sync
allow_llm_repair: true
output:
dir: mrsentry-out
formats: [json, markdown, codequality, dotenv]
# fail_on: critical