Documentationv1.4.0

Policy Profiles

Configure risk posture and automation behavior per path and team.

Risk Management

Not all code carries the same risk. A conflict in a documentation file is trivial, while a conflict in a payment processing handler is critical. Policy profiles allow you to tune gitresolve's automation threshold based on the file's importance.

Profile

strict

Maximum escalation. Blocks 'Both' strategy for all source files. Forced manual review for sensitive paths.

Profile

balanced

Default posture. Auto-resolves trivial blocks but escalates on semantic structural changes.

Profile

aggressive

Maximum automation. Suitable for generated code, logs, or documentation where safety gates can be relaxed.

Profile

auto

Dynamic resolution. Matches files against .gitresolve/policy.json for path-specific overrides.

Configuration: policy.json

Create a .gitresolve/policy.json at your repository root to define fine-grained rules.

.gitresolve/policy.json
{ "default": "balanced", "path_profiles": { "internal/auth/": "strict", "internal/payments/": "strict", "docs/": "aggressive", "scripts/": "aggressive" }, "team_profiles": { "security-ops": "strict", "dx-team": "aggressive" } }

Resolution Logic

How the engine determines the active profile.

Path Overrides

The engine uses a longest-path match. If a file is in internal/auth/utils.go, it receives the "strict" profile even if the rest of internal/ is balanced.

Previewing Policy

You can preview which profile is active for a file by running:

$gitresolve resolve --policy-profile auto --dry-run path/to/file.go