Published on: January 14, 2026
10 min read
Learn how to customize GitLab Duo Agent Platform to match your team's workflow. Configure chat rules, craft system prompts, set up agent tools, and tailor flows for your specific needs.

Welcome to Part 8 of our eight-part guide, Getting started with GitLab Duo Agent Platform, where you'll master building and deploying AI agents and workflows within your development lifecycle. Follow tutorials that take you from your first interaction to production-ready automation workflows with full customization.
In this article:
🎯 Try GitLab Duo Agent Platform today!
GitLab Duo Agent Platform delivers powerful capabilities right away, and you can unlock even greater value by tailoring it to your team's specific needs. GitLab offers flexible customization options across multiple levels:
Custom rules provide instructions for agents and flows, ensuring consistent behavior across your team without requiring repetition. For example, in development style guides or how to execute tests.
Navigate to IDE workspace or user configuration directory.
User-level rules apply to all your projects and workspaces.
For detailed instructions on creating user-level custom rules, see the GitLab documentation.
Create the file ~/.gitlab/duo/chat-rules.md in your home directory.
Example rules:
- Include JSDoc comments for all functions
- Use single quotes for strings
- Follow the existing code style in the repository
- Write concise explanations, avoid lengthy descriptions
- Suggest tests for any code changes
- Use async/await instead of promises
Workspace rules apply only to a specific project. They override user-level rules for that project.
Create the file .gitlab/duo/chat-rules.md in your project root.
Example rules for a Vue.js project:
- Use Vue 3 Composition API with `<script setup>`
- Always include TypeScript types for props
- Use scoped styles with SCSS
- Follow the Slippers UI design system
- Keep components under 300 lines
- Use kebab-case for component names
- Include accessibility attributes (aria-*, role)
Tip: Use Code Owners to manage who approves changes to .gitlab/duo/chat-rules.md.
For a detailed use case tutorial for custom rules, see the Custom rules in GitLab Duo Agentic Chat for greater developer efficiency deep-dive blog post.
AGENTS.md is an industry-standard file for customizing agent behavior. It allows you to define how agents should behave in your chat conversations, foundational flows, and custom flows without modifying the agents themselves.
Difference to custom rules: AGENTS.md are consumed by all agents and flows (foundational and custom). It also follows an industry standard that other AI tools can use, for example, Claude Code as external agent. Use AGENTS.md when you want your instructions to apply across multiple contexts.
User-level (applies to all your projects and workspaces):
~/.gitlab/duo/AGENTS.md%APPDATA%\GitLab\duo\AGENTS.mdWorkspace-level (applies to a specific project):
AGENTS.md in your project root.Subdirectory-level (applies to specific directories in monorepos):
AGENTS.md in subdirectories for context-specific instructions.How it works:
# Agent Customization for Our Project
## General Guidelines
- Always prioritize code quality over speed
- Follow our project's architecture patterns
- Reference existing code examples when suggesting changes
- Ask for clarification if requirements are ambiguous
## Code Style
- Use TypeScript for all new code
- Follow ESLint configuration in the project
- Include unit tests for all new functions
- Use descriptive variable names (no single letters except loops)
## Documentation
- Add JSDoc comments to all public functions
- Update README.md if adding new features
- Include examples in code comments
## Security
- Never suggest hardcoding secrets or API keys
- Always validate user input
- Use parameterized queries for database operations
- Flag potential security issues immediately
user_rule contextCustom review instructions provide specific guidelines for the Code Review foundational flow. The instructions ensure consistent code review standards, and can be tailored to specific file types in your project.
Create the file .gitlab/duo/mr-review-instructions.yaml in your project root.
Example review instructions:
instructions:
- name: Ruby Style Guide
fileFilters:
- "*.rb" # Ruby files in the root directory
- "lib/**/*.rb" # Ruby files in lib and its subdirectories
- "!spec/**/*.rb" # Exclude test files
instructions: |
1. Ensure all methods have proper documentation
2. Follow Ruby style guide conventions
3. Prefer symbols over strings for hash keys
- name: TypeScript Source Files
fileFilters:
- "**/*.ts" # TypeScript files in any directory
- "!**/*.test.ts" # Exclude test files
instructions: |
1. Ensure proper TypeScript types (avoid 'any')
2. Follow naming conventions
3. Document complex functions
Best practices for custom review instructions:
fileFilters.Tip: Use Code Owners to protect changes to .gitlab/duo/mr-review-instructions.yaml.
For detailed setup instructions and examples, see the Custom Review Instructions documentation.
Model Context Protocol (MCP) enables agents to access external systems like Jira, Slack, AWS, and more. This section covers MCP configuration for extending agent capabilities.
🎯 Try it now: Interactive demo of MCP - Explore how to use Model Context Protocol.
Model Context Protocol (MCP) enables agents to access external systems like Jira, Slack, AWS, and more.
Scope: User-level (applies to all workspaces) or Workspace-level (project-specific, overrides user config)
Create user configuration:
~/.gitlab/duo/mcp.jsonC:\Users\<username>\AppData\Roaming\GitLab\duo\mcp.jsonGitLab MCP: Open User Settings (JSON)Create workspace configuration:
.gitlab/duo/mcp.json in your project rootBest practices:
.gitlab/duo/mcp.json with Code Owners' approval.For detailed setup instructions and configuration examples, see Part 7: Model Context Protocol (MCP) Integration.
Custom agents and flows allow you to automate your team's specific workflows. Before diving into customization, it's helpful to understand what they are and how they work. Here are parts of the Getting started with GitLab Duo Agent Platform guide that can help.
System prompts define an agent's personality, expertise, and behavior. A well-crafted prompt makes agents more effective and aligned with your team's needs.
What are system prompts? System prompts are instructions that tell an agent how to behave, what expertise it has, and how to respond to requests. They're the foundation of custom agent behavior.
Key elements of a strong system prompt:
Best practices:
For detailed guidance on crafting system prompts and creating custom agents, see Part 3: Understanding agents.
There is a lot to learn, and for easier reading, the tutorials are split:
Custom agents:
Custom flows:
Agent tools:
| Tool | Best For | Location |
|---|---|---|
| Custom Rules | Guiding Chat responses in IDE (tone, style, behavior) | ~/.gitlab/duo/chat-rules.md (user) or .gitlab/duo/chat-rules.md (workspace) |
| AGENTS.md | Enforcing standards across chat, flows, and other AI tools | ~/.gitlab/duo/AGENTS.md (user) or AGENTS.md (workspace root) |
| Custom Review Instructions | Guiding code review standards for specific file types | .gitlab/duo/mr-review-instructions.yaml (workspace only) |
| System Prompts | Customizing individual agent behavior | AI Catalog when creating an agent |
| MCP Configuration | Connecting agents to external tools | ~/.gitlab/duo/mcp.json (user) or .gitlab/duo/mcp.json (workspace) |
| Custom Agents | Creating specialized agents for team-specific tasks | Automate → Agents or AI Catalog |
| Custom Flows | Orchestrating multiple agents in workflows | Automate → Flows or AI Catalog |
Congratulations! You've completed the entire GitLab Duo Agent Platform series. You now understand:
Return to complete series overview to review all parts and explore specific topics in depth.
Previous: Part 7: Model Context Protocol integration
Back to start: Complete series overview
Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum.
Share your feedback