Agent P Configuration References
Agent P uses a governed configuration model where settings are managed centrally through Sonatype Guide rather than stored in individual repositories.
Configuration Model
Agent P uses organization-level defaults with optional repository-level overrides.
Default Configuration
Organization owners define a default configuration that applies to all onboarded repositories. The configuration can include:
Feature settings, such as security-only mode, AI fixes, pull request creation, dry runs, automatic merging, and validation.
Validation commands and breaking-change checks.
Pull request templates, labels, and reviewers.
Pull request limits and upgrade wait periods.
Packages and paths to ignore.
Project-specific settings for monorepositories.
Repository Overrides
You can override the default configuration for repositories that require different settings.
Configure only the fields that must differ from the organization defaults.
Fields without an override continue to use the default configuration.
Sonatype Guide centrally stores and manages the overrides.
Agent P applies changes during the next run.
Effective Configuration
When Agent P runs, it determines the effective configuration by applying settings in the following order:
Built-in baseline settings.
Organization default configuration.
Repository-level overrides.
Repository-level settings take precedence over organization defaults. Agent P retrieves the latest effective configuration at the start of each run, so configuration changes do not require a pull request or repository re-onboarding.
agp-workflow.yml
The agp-workflow.yml file defines the GitHub Actions workflow that executes Agent P. This file is created during onboarding and should not be edited manually. The configuration is managed through Sonatype Guide.
# .github/workflows/agp-workflow.yml
name: Sonatype Guide - Agent P
on:
schedule:
# Runs once a day. Sonatype Guide picks a randomized time
# for each repository so onboarded repos don't all run simultaneously.
- cron: '0 6 * * *'
workflow_dispatch:
inputs:
verbose:
description: 'Enable verbose output'
required: false
default: 'false'
type: boolean
mode:
description: 'Run mode (standard or security)'
required: false
default: 'standard'
type: string
vulnerabilities:
description: 'JSON array of vulnerabilities to target (security mode)'
required: false
default: ''
type: string
permissions:
contents: write
pull-requests: write
id-token: write # Required for OIDC authentication with Sonatype Guide
concurrency:
group: agp-${{ github.ref }}
cancel-in-progress: false
jobs:
# Gate job: checks if repo should run, fetches governed config
gate:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
directive: ${{ steps.gate.outputs.directive }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sonatype Guide gate
id: gate
uses: sonatype/agp-action/gate@v1
with:
guide-url: ${{ vars.AGP_API_URL }}
# Main AGP job: only runs when gate outputs 'run'
agp:
needs: gate
if: needs.gate.outputs.directive == 'run'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch governed configuration
uses: sonatype/agp-action/gate@v1
with:
guide-url: ${{ vars.AGP_API_URL }}
- name: Run AGP
uses: sonatype/agp-action@v1
with:
mode: ${{ inputs.mode || 'standard' }}
vulnerabilities: ${{ inputs.vulnerabilities }}
verbose: ${{ inputs.verbose || 'false' }}
env:
GITHUB_TOKEN: ${{ github.token }}
Default Configuration Settings
The Default Configuration tab organizes Agent P settings into sections. Sonatype Guide centrally stores these settings and provides the applicable configuration to Agent P at the start of each run.
Repository-level overrides can replace individual default settings without affecting other repositories.
Feature Defaults
Use Feature Defaults to control the primary Agent P behaviors.
Setting | Description |
|---|---|
PR Creation | Creates pull requests for validated dependency updates. |
Validation Gates | Runs the configured validation commands before creating a pull request. |
Security Only (Beta) | Processes only dependencies with known security vulnerabilities. |
AI Fix | Allows Agent P to generate AI-assisted fixes. |
Dry Run | Runs the analysis without creating pull requests. |
Auto Merge | Automatically merges eligible pull requests. |
Setup
Use Setup to define commands that prepare the runner environment before Agent P starts its main analysis.
Field | Description | Example |
|---|---|---|
Setup commands | One or more shell commands that run before Agent P starts. |
|
Build
Use Build to configure the Java version for Java-based projects.
Field | Description | Example |
|---|---|---|
Java version | Specifies the JDK major version used to build the project. | JDK 21 |
Validation
Use Validation to define how Agent P validates a proposed dependency update before creating a pull request.
Validation settings are available only when Validation Gates is enabled.
Commands
Specify one or more commands to validate a proposed dependency update before Agent P creates a pull request.
If you do not specify any commands, Agent P uses the default command for the detected package ecosystem.
Ecosystem | Default command |
|---|---|
Maven |
|
Gradle |
|
npm, bun, pnpm, or yarn |
|
Go |
|
Python |
|
NuGet |
|
Breaking-change Commands
Specify one or more additional commands to run when Agent P detects a breaking change.
Timeout
Specify the maximum time that Agent P allows for validation to complete.
Pull Requests
Use Pull Requests to configure how Agent P creates and assigns pull requests.
Field | Description | Example |
|---|---|---|
Labels | Specifies one or more labels to apply to every Agent P pull request. |
|
Reviewers | Specifies one or more GitHub usernames to request as reviewers. |
|
Title template | Defines the title format for Agent P pull requests. |
|
Body template | Defines the content of the pull request description. | - |
Branch template | Defines the naming format for branches created by Agent P. |
|
Draft PRs | Determines whether Agent P creates pull requests as drafts. | - |
Automatic Pull Request Classifications
Agent P classifies each pull request based on the reason for the update. It adds a classification label, title prefix, and reason to the pull request.
Agent P applies classifications in the following precedence order cve > policy > opportunistic
When an update matches more than one classification, Agent P applies only the highest-precedence classification.
Classification | Pull request label | Title prefix | Applied when |
|---|---|---|---|
Security | agp:cve | [Security] | The update addresses a known CVE or GHSA advisory. This classification has the highest precedence. |
Policy | agp:policy | [Policy] | The update addresses a dependency policy requirement but does not include a direct CVE fix. |
Opportunistic | agp:opportunistic | [Update] | The update is a routine dependency upgrade with no security or policy trigger. |
In security mode, Agent P can use the title prefix [Security] for security updates.
Custom labels configured in the Labels field are added alongside the automatic agp: classification label.
Template Variables
Use template variables in the Title template, Body template, and Branch template fields.
Group Variables
Variable | Description | Example |
|---|---|---|
{{.GroupName}} | Human-readable name or summary of the dependency update group. | Update lodash 4.17.20 → 4.17.21 |
{{.GroupID}} | Unique identifier for the recommendation group. | sec-group-8492 or group-lodash |
Single-Dependency Variables
Variable | Description | Example |
|---|---|---|
{dependency} | Name of the package or dependency being updated. | lodash, express, or @auth0/nextjs-auth0 |
{version} | Target version or version update path. | 4.17.21 or 1.0.0 → 2.0.0 |
Auto Merge
Use Auto Merge to configure how Agent P merges eligible pull requests when Auto Merge is enabled.
Select Squash, Merge, Rebase, or Inherit default as the merge method. When you select Inherit default, Agent P uses the merge method defined in the organization Default Configuration.
Limits
Use Limits to control how many pull requests Agent P can create and how long it waits before proposing newly released versions.
Field | Description |
|---|---|
Max open PRs | Maximum number of Agent P pull requests that can remain open for a repository. Agent P does not create additional pull requests when this limit is reached. |
Max PRs per run | Maximum number of pull requests Agent P can create during a single run. |
Major wait period | Minimum time Agent P waits after a major version is released before proposing the upgrade. |
Minor wait period | Minimum time Agent P waits after a minor version is released before proposing the upgrade. |
Patch wait period | Minimum time Agent P waits after a patch version is released before proposing the upgrade. |
If you close an Agent P pull request without merging it, Agent P applies a cooldown before proposing another upgrade for the same package. The default cooldown period is 7 days.
Ignore
Use Ignore to exclude specific packages or repository paths from Agent P processing.
Field | Description | Example |
|---|---|---|
Packages | Specifies package names that Agent P must not upgrade. Add each package separately. |
|
Paths | Specifies glob patterns for files or directories that Agent P must ignore. Add each pattern separately. |
|
General
Use General to configure major-version upgrades and labels associated with Agent P runs.
Field | Description | Example |
|---|---|---|
Skip major versions | Determines whether Agent P skips upgrades that cross a major version boundary. Select On, Off, or Inherit. When set to Inherit, Agent P uses the organization default. | - |
Labels | Specifies one or more top-level labels associated with the Agent P run. These labels are separate from pull request labels. | agp |