New to FORGE? Start a free 30-day trial

Commit Behavior Configuration

Updated on Oct 1, 2026

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.toml and, for overrides, .forge/config/agents.toml.

How it works

For each operation, Forge sends one of three instruction sets:

ResultEffect
Basic commit instructionsThe agent may commit, without Forge attribution.
Attributed commit instructionsThe agent may commit and adds Co-authored-by: frg <frg@Progress.com>.
No-commit instructionsThe agent is told not to commit.

Forge resolves the result in this order:

  1. behavior = "disabled" in project.toml forces no-commit instructions for every operation.
  2. An operation override (commits) in agents.toml. For a modifier, such as a fix or edit variant, Forge checks the modifier operation first, then the base operation.
  3. A target override (commits) in agents.toml.
  4. The built-in default for the operation.
  5. 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:

toml
[commit]
behavior = "enabled"
ValueEffect
enabled (default)Basic commit instructions for operations that commit
taggedCommit instructions with Forge co-author attribution for operations that commit
disabledNo-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:

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" }
SettingScopeValues
agent.<agent>.targets.<target>All operations of a targetcommits = "on" or "off"
agent.<agent>.operations."<target>.<operation>"One operation; takes precedence over the targetcommits = "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] default or the --agent flag 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:

OperationDefault
code create, code create --fixCommits
code refactor, code refactor --fixCommits
code review --edit, --lite-edit, --auto-fixCommits
docs create, docs create --editCommits
docs build fixesCommits
pr merge, pr merge --fixCommits
sec patch, sec patch --editCommits

All other operations receive no-commit instructions by default, including plain reviews, analysis, draft generation, ask, and security audits.

Common policies

GoalConfiguration
All commits are manualproject.toml: [commit] behavior = "disabled"
Keep Forge attributionproject.toml: [commit] behavior = "tagged"
Never commit during code reviewagents.toml: "code.review" = { commits = "off" }
Never commit during documentation workagents.toml: docs = { commits = "off" } under targets

Verify the result

  1. Validate the configuration:
bash
frg config validate
  1. Print the prompt for the operation and check its commit instructions:
bash
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:

  1. Check [commit] behavior in project.toml.
  2. Check the operation and target overrides for the selected agent in agents.toml.
  3. 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:

  1. Change behavior to "enabled" or "tagged".
  2. 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:

  1. Check [agent] default and any --agent flag.
  2. 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:

  1. Use enabled, tagged, or disabled for behavior.
  2. Use on or off for commits.
  3. Confirm that overrides are under [agent.<agent>.targets] or [agent.<agent>.operations].
  4. Run frg config validate.

See Also