Set up Deploy Change Investigator
Connect builds, deployments, and code changes to understand what changed during incidents.
The Deploy Change Investigator helps you understand what changed when incidents occur by connecting three critical data streams: builds, deployments, and code changes (PRs).
How it works
The investigator connects your CI/CD pipeline data to provide precise answers about "what changed" during incidents:

The connection flow:
Build webhook sends: artifact name/version + commit SHA + repository
Deploy webhook sends: services deployed + environment + artifact versions
PR ingestion fetches: all PRs merged to your main deploy branch
The investigator maps deployments to builds to code changes, giving you precise answers to "what changed?" during incidents.
Prerequisites
Before starting, ensure you have:
AI SRE module enabled in your Harness account
Pipeline permissions to add webhook steps to your build and deployment pipelines
Source control connector (if not using Harness Code): GitHub or Bitbucket credentials configured in your project
Set up source control connector
Skip this step if: you are using Harness Code (it is already integrated).
For GitHub or Bitbucket:
Create a Harness connector for your repository. Go to Connect to a code repo to create one.
In the left navigation, click Project Settings (gear icon).
Under Project-level resources, select Third Party Integrations (AI SRE).
On the Third-Party Integrations for AI SRE page, find the Github or Bitbucket row and select your connector from the dropdown.

When you send your first build webhook that includes a source.repository_url, AI SRE automatically creates a PR ingestion job for your repository's main branch.
Create a PR ingestion manually
To create the ingestion without waiting for a build webhook:
In the AI SRE left navigation, go to Integrations.
Open the PR Ingestions tab.
Click + New PR Ingestion.
In the Create New PR Ingestion dialog, under Select Git Provider, choose Harness Code, GitHub, or Bitbucket.
Enter the Repository URL of the repository to track.
Click Create.

Create build webhook integration
Create an integration that receives build events from your pipeline:
In the AI SRE left navigation, go to Integrations.
Click + New Integration.
Fill in the form:
Name: Build (or your preferred name)
Type: Build
Select Template: Harness Build
Click Save.
Copy the Endpoint URL. You will need this when you configure your pipeline.
The integration is created with a unique ID (e.g., BUILB1A) and a webhook URL like:
Create deploy webhook integration
Create a second integration that receives deployment events from your pipeline:
While still in AI SRE > Integrations, click + New Integration again.
Fill in the form:
Name: Deploy (or your preferred name)
Type: Deployment
Select Template: Harness Deployment
Click Save.
Copy the Endpoint URL. You will need this when you configure your pipeline.
You should now see both integrations listed in your integrations view.
Configure build pipeline webhooks
Add a Shell Script step to your build pipeline that runs after the artifact is published.
Add the webhook step
Add the notification step to your build pipeline:
Open your build pipeline
Add a new Shell Script step (e.g., "IR Build Notification")
Place it after your artifact publishing step
Configure the step with the following command:
Configure environment variables
Map these variables to your pipeline outputs:
ARTIFACT_REPO: Maps to
<+execution.steps.build_service.output.outputVariables.ARTIFACT_REPO>.NEW_VERSION: Maps to
<+execution.steps.build_service.output.outputVariables.NEW_VERSION>.COMMIT_SHA: Maps to
<+codebase.commitSha>or your build step's commit SHA output.BRANCH: Maps to
<+codebase.branch>.MANIFEST_REPO: Your repository URL (for example,
https://github.com/yourorg/yourrepo).REGISTRY: Your artifact registry (for example,
us-west1-docker.pkg.dev).
IMPORTANT NOTES
Escape all quotes in
json_payloadThe assembled
json_payloadmust contain no newlines. The backslash line continuations above keep the source readable while producing a single-line string.Replace
YOUR_BUILD_WEBHOOK_URL_HEREwith the endpoint URL from your Build integration
Build webhook payload reference
The Build webhook expects this JSON structure:
Field mapping:
artifact.name: Full artifact path (registry + image name)
artifact.version: Artifact version/tag
source.commitSha: Git commit SHA that was built
source.kind: Usually "branch"
source.value: Branch name
source.repository_url: Git repository URL
service.name: Service identifier
service.version: Same as artifact version
buildId: Unique build ID (pipeline execution ID)
Test build webhook and verify PR ingestion
Run your build pipeline and verify two things:
Verify build webhook is received
Confirm the build integration is receiving events:
In the AI SRE left navigation, go to Integrations.
Click the More icon (...) on the BUILD integration.
Select Debug.
You should see a timeline of received webhook events with:
Timestamp
Payload preview
Status (success/failure)
Verify PR ingestion job was auto-created
If you configured your connector, AI SRE should automatically create a PR ingestion job:
In the AI SRE left navigation, go to PR Ingestions (tab next to Integrations).
You should see an ingestion job with:
Repository name
Branch being tracked (usually
main)Last sync status and timestamp
The job runs automatically and fetches PRs merged to your deploy branch.
Configure deploy pipeline webhooks
Add a Shell Script step to your deployment pipeline that runs after the deployment completes.
Add the webhook step
Add the notification step to your deployment pipeline:
Open your deployment pipeline
Add a new Shell Script step (e.g., "IR Deploy Notification")
Place it after your deployment step
Configure the step with the following command:
Customize the payload
Adjust the payload to match your deployment:
Replace the services array with your actual services and versions (supports multiple services per deployment)
Update the environments array with your environment names (e.g.,
["prod"],["staging", "qa"])Replace
YOUR_DEPLOY_WEBHOOK_URL_HEREwith the endpoint URL from your Deploy integration
Using Harness expressions for dynamic values:
changeId: Maps to
<+pipeline.executionId>(unique deployment ID).deployedBy: Maps to
<+pipeline.triggeredBy.name>(who triggered the deployment).deployTimestamp: Maps to
<+pipeline.startTs>(when deployment started).
Deploy webhook payload reference
The Deploy webhook expects this JSON structure:
Field mapping:
services[]: Array of services deployed (can be one or many).
services[].service: Service name (must match
service.namefrom the Build webhook).services[].version: Artifact version deployed (must match
artifact.versionfrom the Build webhook).environments[]: Array of environments deployed to.
changeId: Unique deployment ID.
status: "SUCCESS" or "FAILURE".
deployedBy: User who triggered the deployment.
deployTimestamp: ISO 8601 timestamp of deployment.
CRITICAL MAPPING REQUIREMENT
The services[].service and services[].version must match the corresponding fields from your Build webhooks. This is how the investigator links deployments to builds to commits.
Test deploy webhook
After running a deployment, verify the webhook is being received:
In the AI SRE left navigation, go to Integrations.
Click the More icon (...) on the DEPLOY integration.
Select Debug.
You should see deployment events with timestamps and payloads.
Verification checklist
At this point, you should have:
✓ Source control connector configured (if not using Harness Code)
✓ Build webhook integration created and receiving events
✓ Deploy webhook integration created and receiving events
✓ PR ingestion job created and syncing
✓ Verified webhook data in Debug views
Troubleshooting
Next steps
Now that your Deploy Change Investigator is configured:
Go to AI Agent RCA to understand how the AI agent uses change detection during incidents.
Go to Incident management workflows to manage incidents.
Go to Route alerts and integrations to configure alert routing.
Last updated
Was this helpful?