doc/user/duo_agent_platform/agents/tool-governance.md
{{< details >}}
{{< /details >}}
{{< history >}}
gitlab_duo_governance_settings. Enabled by default.{{< /history >}}
[!warning] This feature is in beta. It is subject to change without notice. For more information, see GitLab Testing Agreement.
Tool governance sits at the execution boundary. After an agent has been admitted to a project, and before a tool is invoked, the governance layer consults the configured rules for the user's role and the tool's action category, then enforces the resulting mode.
Tools are classified into three action categories:
Agent tool governance (human-in-the-loop guardrail) lets administrators define how each agent tool is enforced at the moment of execution. Instead of allowing agents to invoke any tool without review, you can configure each tool to one of three modes:
This feature applies across Agentic Chat, IDE extensions, and flows.
| Classification | Mode |
|---|---|
| Read | Always Allow |
| Write | Always Ask |
| Delete | Always Ask |
When an agent calls a tool configured as Always Ask, execution pauses and an inline approval card is displayed. The card shows:
If you approve, the tool executes and the agent continues. If you reject, the tool is not executed. The agent receives a rejection signal and may attempt an alternative approach or stop.
When an agent attempts to invoke a tool that is configured as Always Deny for your role, the tool is not surfaced to the agent. If the agent's plan requires a denied tool, it receives an error indicating the tool is unavailable due to governance policy.
Rules are resolved in the following order, from most specific to least specific:
Project-level rules override group-level rules for the same tool, but can only be equal to or stricter than the group-level rule. Group-level rules override the defaults. If no rule is configured at any level, the tool defaults to Always Allow.
The fail-closed principle applies. If the governance service encounters a persistent error when resolving rules, the agent receives no tools rather than silently allowing execution.
Group-level rules apply to all projects in the group unless overridden at the project level.
Prerequisites:
To configure tool governance rules for a group:
Changes apply to all subgroups and projects that do not have a project-level override.
Project-level rules override the group-level rules for the same tool within that project.
Prerequisites:
To configure tool governance rules for a project: