Commit Behavior Configuration
Forge adds commit instructions to every workflow prompt, so the AI agent knows whether it may create Git commits. This page shows how to set a project-wide policy, override it for a target or operation, and check the result.
Commit settings control only the instructions sent to the agent. They do not create, amend, or push commits themselves.
Prerequisites
- Forge is initialized in the project. See Project Setup.
- You can edit
.forge/config/project.tomland, for overrides,.forge/config/agents.toml.
How it works
For each operation, Forge sends one of three instruction sets:
| Result | Effect |
|---|---|
| Basic commit instructions | The agent may commit, without Forge attribution. |
| Attributed commit instructions | The agent may commit and adds Co-authored-by: frg <frg@Progress.com>. |
| No-commit instructions | The agent is told not to commit. |
Forge resolves the result in this order:
behavior = "disabled"inproject.tomlforces no-commit instructions for every operation.- An operation override (
commits) inagents.toml. For a modifier, such as a fix or edit variant, Forge checks the modifier operation first, then the base operation. - A target override (
commits) inagents.toml. - The built-in default for the operation.
- If commits are enabled,
behavior = "enabled"or"tagged"selects basic or attributed instructions.
Set the project policy
Set behavior under [commit] in .forge/config/project.toml:
[commit]
behavior = "enabled"
| Value | Effect |
|---|---|
enabled (default) | Basic commit instructions for operations that commit |
tagged | Commit instructions with Forge co-author attribution for operations that commit |
disabled | No-commit instructions for every operation, including code create |
enabled and tagged only choose the instruction style. They do not turn on commits for an operation that does not commit by default.
Override a target or operation
Add overrides under the agent that runs the workflow in .forge/config/agents.toml:
schema_version = "1.0.0"
[agent]
default = "github_copilot"
[agent.github_copilot.targets]
code = { commits = "off" }
[agent.github_copilot.operations]
"code.create" = { commits = "on" }
| Setting | Scope | Values |
|---|---|---|
agent.<agent>.targets.<target> | All operations of a target | commits = "on" or "off" |
agent.<agent>.operations."<target>.<operation>" | One operation; takes precedence over the target | commits = "on" or "off" |
The same inline table can also set model, for example code = { model = "claude-sonnet-5", commits = "on" }.
In this example, code create receives commit instructions and all other code operations receive no-commit instructions.
Note: Overrides apply only to the agent that runs the workflow. Check
[agent] defaultor the--agentflag you use.
Quote TOML keys that contain dots or hyphens, such as "code.review".
Built-in defaults
The agent receives commit instructions by default for operations that change code, documentation, or security fixes:
| Operation | Default |
|---|---|
code create, code create --fix | Commits |
code refactor, code refactor --fix | Commits |
code review --edit, --lite-edit, --auto-fix | Commits |
docs create, docs create --edit | Commits |
docs build fixes | Commits |
pr merge, pr merge --fix | Commits |
sec patch, sec patch --edit | Commits |
All other operations receive no-commit instructions by default, including plain reviews, analysis, draft generation, ask, and security audits.
Common policies
| Goal | Configuration |
|---|---|
| All commits are manual | project.toml: [commit] behavior = "disabled" |
| Keep Forge attribution | project.toml: [commit] behavior = "tagged" |
| Never commit during code review | agents.toml: "code.review" = { commits = "off" } |
| Never commit during documentation work | agents.toml: docs = { commits = "off" } under targets |
Verify the result
- Validate the configuration:
frg config validate
- Print the prompt for the operation and check its commit instructions:
frg code create --print-prompt
The prompt can contain paths and project details. Review it before sharing.
Troubleshooting
The agent is told not to commit
Cause: behavior = "disabled", an "off" override for the selected agent, or the operation does not commit by default.
Solution:
- Check
[commit] behaviorinproject.toml. - Check the operation and target overrides for the selected agent in
agents.toml. - Set
commits = "on"for the operation if it should commit.
commits = "on" has no effect
Cause: behavior = "disabled" in project.toml overrides every agents.toml setting.
Solution:
- Change
behaviorto"enabled"or"tagged". - Run
frg config validate, then inspect the prompt with--print-prompt.
A target override is ignored
Cause: An operation override takes precedence, or the override is under an agent that does not run the workflow.
Solution:
- Check
[agent] defaultand any--agentflag. - Look for an operation override for the same target, and update or remove it.
frg config validate rejects the commit settings
Cause: An unsupported value, a wrong table path, or invalid TOML.
Solution:
- Use
enabled,tagged, ordisabledforbehavior. - Use
onoroffforcommits. - Confirm that overrides are under
[agent.<agent>.targets]or[agent.<agent>.operations]. - Run
frg config validate.