doc/editor_extensions/security_considerations.md
GitLab editor extensions and CLI tools can run AI agents in your local environment. Understand the security implications and follow best practices to protect your development environment.
When editor extensions and CLI tools execute agents locally, the agents run without container isolation and have direct access to your system resources.
Agents have different file access levels depending on the operation type.
Agents can perform file operations (read, write, edit, search, and list) on:
.gitignore rules.Shell commands executed by agents can access all files, including those outside of Git repositories
and those that match .gitignore patterns.
Agents have access to all environment variables in your shell session except for the following:
CI_JOB_TOKENGITLAB_OAUTH_TOKENDUO_WORKFLOW_SERVICE_TOKENAgents have access to the following system resources:
Because isolation is not in place, the following threats are possible:
To protect your development environment, follow these security best practices.
When agents request your approval to execute actions, carefully review each tool call before approving.
Verify that:
If you use the GitLab Duo CLI in headless mode, tool calls are approved automatically. Use headless mode with caution and in a controlled sandbox environment, such as a development container.
To use Model Context Protocol (MCP) servers securely with GitLab Duo:
Use development containers to mitigate local execution risks.
For GitLab Duo CLI users, headless mode bypasses manual tool approvals, so development containers are especially important.
Development containers provide:
The GitLab for VS Code extension is compatible with VS Code Dev Containers. For more information, see use the extension in a Visual Studio Code Dev Container.