Skip to content

Create your first agent

Mate’s behaviour is defined in a YAML config file that lives in the console. It specifies agents (what the LLM does and what permissions it has) and triggers (which GitLab events start an agent run).

You can edit this config during onboarding (Step 3) or at any time from the Config page in the tenant sidebar.

The editor is a full-screen YAML editor with live validation. Errors are underlined inline and counted in the toolbar. The config is only saved when you click Save (or press Ctrl+S / Cmd+S). Navigating away with unsaved changes prompts you to confirm.

The template the wizard starts with is a good base. Here is the simplest possible config that does something useful:

version: 1
agents:
assistant:
backend: claude-code
model: "anthropic/claude-sonnet-4-6"
system_prompt: |
You are a helpful engineering assistant.
Be concise. Do not make unrequested changes.
permissions:
- read
- comment
triggers:
- on: issue_assigned
agent: assistant

This config defines one agent (assistant) that can read the GitLab project and post comments, and one trigger that starts that agent whenever an issue is assigned to the bot user.

Paste this into the editor (or keep the pre-loaded template), then click Save and continue.

Each entry under agents is a named configuration block:

FieldRequiredDescription
backendyesUse claude-code.
modelyesModel identifier string. For OpenRouter: anthropic/claude-sonnet-4-6 or any model available on your account. For Anthropic direct: claude-sonnet-4-6.
system_promptyesThe agent’s instructions.
permissionsyesList of operations the agent may perform. See below.
timeoutnoMaximum wall-clock time per run, e.g. 30m. Defaults to a system limit if unset.

Start with the minimum set and expand as needed:

PermissionWhat it allows
readRead issue/MR content, project files, CI results
commentPost comments on issues and MRs
push_branchPush commits to non-protected branches
push_mr_branchPush commits to the source branch of an open MR
open_mrOpen new merge requests
mergeMerge an MR (subject to GitLab branch protection rules)
close_issueClose issues
update_issueEdit issue title, description, labels, state
touch_ciRetry or cancel CI pipelines

Each entry in the triggers list pairs an event with an agent. The first matching trigger wins.

EventWhen it fires
issue_assignedAn issue is assigned to the bot user
mr_assignedAn MR is assigned to the bot user
mr_openedAn MR is opened (any author)
label_appliedA label matching the label: glob is added to an issue or MR
comment_mentionThe bot is @-mentioned in a comment
pipeline_failedA pipeline fails on a branch with an open MR

Example with multiple triggers:

triggers:
- on: issue_assigned
agent: assistant
- on: comment_mention
agent: assistant
- on: label_applied
label: "needs-review"
agent: assistant

Click Save or press Ctrl+S / Cmd+S. The editor validates the YAML schema server-side; any errors are shown inline with a count in the toolbar. The save button is disabled while there are errors.

Next: Run your first job