For the complete documentation index, see llms.txt. This page is also available as Markdown.

Remediation Agent

Internal endpoints for remediation-agent plugins and account-scoped STO base-image approval lookup

GetBaseImageApproval RemediationAgent

post
/api/v2/remediation-agent/base-image-approval

List the approved variants of one or more base images across an account (not scoped to org/project). Customers scan base images manually as their own container targets and approve variants via the target variant status update; this lookup does not depend on base image auto-detection (STO_BASE_IMAGE_DETECTION). For each requested target name, returns every variant of the container target with that name whose base image status is approved, newest scan first, de-duplicated. Variant strings are the bare parameters.variant value (for example 3.21), not the STO UI display form (tag: 3.21); tag: and branch: prefixes are stripped. Duplicate request names are collapsed; results follow request order and always contain one entry per distinct name. Does not pick a single upgrade tag.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
accountIdstringRequired

Harness Account ID

Example: abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$
Body
targetNamesstring[] · min: 1 · max: 50Required

STO container test target names to look up (for example alpine). Matched exactly; duplicates are collapsed

Example: ["alpine","ubuntu"]
Responses
200

OK response.

application/json
post/api/v2/remediation-agent/base-image-approval
POST /gateway/sto/api/v2/remediation-agent/base-image-approval?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 35

{
  "targetNames": [
    "alpine",
    "ubuntu"
  ]
}
{
  "results": [
    {
      "approvedVariants": [
        {
          "lastScanned": 1714521600,
          "variant": "3.21"
        },
        {
          "lastScanned": 1714521600,
          "variant": "3.21"
        },
        {
          "lastScanned": 1714521600,
          "variant": "3.21"
        }
      ],
      "targetName": "alpine"
    },
    {
      "approvedVariants": [
        {
          "lastScanned": 1714521600,
          "variant": "3.21"
        },
        {
          "lastScanned": 1714521600,
          "variant": "3.21"
        },
        {
          "lastScanned": 1714521600,
          "variant": "3.21"
        }
      ],
      "targetName": "alpine"
    }
  ]
}

DiffOccurrences RemediationAgent

get
/api/v2/remediation-agent/diff-occurrences

Diff the validation execution's scan against the original scan's ignore set. Resolves validationScanId from validationExecutionId (account-scoped — validation pipeline may live in a different org/project than the original scan), derives the original scan's ignored occurrences (every occurrence on the original scan minus the in-scope ones for the scoped issue type, same computation as ListOccurrencesInScope), and removes those (matched by fingerprint) from the validation scan. Remaining occurrences are split into existingOccurrences (fingerprint also present in original in-scope) and newOccurrences (introduced on the validation scan).

Required scopes
This endpoint requires the following scopes:
Authorizations
X-Api-KeystringRequired
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
accountIdstringRequired

Harness Account ID

Example: abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$
orgIdstring · max: 128Required

Harness Organization ID

Example: example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$
projectIdstring · max: 128Required

Harness Project ID

Example: example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$
scanIdstringRequired

Original STO scan id

Example: scan111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$
validationExecutionIdstring · max: 128Required

Validation pipeline execution id

Example: exec111111111111111111
onlyTruePositivebooleanOptional

Legacy: when true and onlyTruePositiveIssueTypes is empty, apply TP filter to all resolved issueTypes. Prefer onlyTruePositiveIssueTypes for per-type Exclude False Positives.

Default: falseExample: false
excludeUnreachablebooleanOptional

When true, exclude occurrences whose reachability is 'unreachable' (SAST). Missing/unknown reachability stays in scope.

Default: falseExample: false
limitinteger · int64 · min: 1 · max: 10000Optional

Maximum number of occurrences

Default: 1000Example: 8379
excludeRepoPatternsstring[]Optional

Glob patterns matching target.name on repository targets

Example: ["sf0","jak","c74"]
issueIdsstring[] · max: 200Optional

Restrict scope to these issue ids (issue.id). Empty = no restriction.

Example: ["sfi","ic0","6xb"]
Header parameters
X-Api-KeystringOptional

Harness personal or service access token

Example: Consequatur asperiores aut consequatur quia consequuntur.
Responses
200

OK response.

application/json
existingCountinteger · int64RequiredExample: 4106540942799589400
matchedCountinteger · int64Required

existingCount + newCount

Example: 6827266834604312000
newCountinteger · int64RequiredExample: 5561975453252969000
validationScanIdstringRequiredExample: scan222222222222222222Pattern: ^[a-zA-Z0-9_-]{22}$
get/api/v2/remediation-agent/diff-occurrences
GET /gateway/sto/api/v2/remediation-agent/diff-occurrences?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project&scanId=scan111111111111111111&validationExecutionId=exec111111111111111111 HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "existingCount": 4890454813826552000,
  "existingOccurrences": [
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    }
  ],
  "matchedCount": 2798979288219303000,
  "newCount": 7750807919324539000,
  "newOccurrences": [
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    }
  ],
  "validationScanId": "scan222222222222222222"
}

ListOccurrencesInScope RemediationAgent

get
/api/v2/remediation-agent/occurrences-in-scope

List (issue, occurrence) tuples for the remediation pre-plugin. Scoped to one scan and issue type; optionally filters to TRUE_POSITIVE triage verdicts.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
accountIdstringRequired

Harness Account ID

Example: abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$
orgIdstring · max: 128Required

Harness Organization ID

Example: example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$
projectIdstring · max: 128Required

Harness Project ID

Example: example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$
scanIdstringRequired

STO scan id

Example: scan111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$
targetIdstringOptional

Optional STO target id

Example: target1111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$
onlyTruePositivebooleanOptional

Legacy: when true and onlyTruePositiveIssueTypes is empty, apply TP filter to all resolved issueTypes. Prefer onlyTruePositiveIssueTypes for per-type Exclude False Positives.

Default: falseExample: false
excludeUnreachablebooleanOptional

When true, exclude occurrences whose reachability is 'unreachable' (SAST). Missing/unknown reachability stays in scope.

Default: falseExample: false
limitinteger · int64 · min: 1 · max: 10000Optional

Maximum number of occurrences

Default: 1000Example: 9809
excludeRepoPatternsstring[]Optional

Glob patterns matching target.name on repository targets

Example: ["ig4","stc","9ml"]
issueIdsstring[] · max: 200Optional

Restrict scope to these issue ids (issue.id). Empty = no restriction.

Example: ["mz1","s3e","eur"]
Responses
200

OK response.

application/json
ignoredOccurrenceIdsinteger · int64[]Required

Occurrence internal IDs excluded from scope because they already have remediation agent augmentation for this target variant

Example: [7973917382933212000,3048718097675218400]
originalOccurrenceCountinteger · int64Required

Uncapped SUM(issue_scan.num_occurrences) for the scoped issue type on the scan; not limited by the result list cap

Example: 3181632451803633000
get/api/v2/remediation-agent/occurrences-in-scope
GET /gateway/sto/api/v2/remediation-agent/occurrences-in-scope?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project&scanId=scan111111111111111111 HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "ignoredOccurrenceIds": [
    7933169035579455000,
    6867027967431410000,
    8605073441667216000
  ],
  "originalOccurrenceCount": 4345483215435471000,
  "results": [
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    },
    {
      "issueId": "issue11111111111111111",
      "issueTitle": "SQL Injection",
      "issueType": "SAST",
      "occurrenceDetails": "Et magni odit libero repudiandae.",
      "occurrenceInternalId": 2002,
      "severityCode": "HIGH"
    }
  ]
}

BatchPersistResults RemediationAgent

post
/api/v2/remediation-agent/results/batch

Atomically upsert per-occurrence remediation rows for one agent run. STO Core resolves in-scope occurrences for originalScanId (same query as ListOccurrencesInScope, using the same RemAgentScopeFilters from sto-plugins) and stamps pullRequestMetadata onto each issue_augmentation row. Run-level rollup counts on this payload are stored for audit/UI; the post-plugin ALSO posts the same counts to ssca-manager agentResults for the Agents Executions tab (same split as FP triage).

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
accountIdstringRequired

Harness Account ID

Example: abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$
orgIdstring · max: 128Required

Harness Organization ID

Example: example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$
projectIdstring · max: 128Required

Harness Project ID

Example: example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$
Body
activeOccurrenceCountinteger · int64Optional

original + new_introduced - remediated

Example: 8284459238533817000
excludeRepoPatternsstring[]Optional

Glob patterns matching target.name on repository targets

Example: ["x40","y27","p8u"]
excludeUnreachablebooleanOptional

When true, exclude occurrences whose reachability is 'unreachable' (SAST). Missing/unknown reachability stays in scope.

Default: falseExample: false
issueIdsstring[] · max: 200Optional

Restrict scope to these issue ids (issue.id). Empty = no restriction.

Example: ["9bp","m4b","4av"]
jiraEnabledbooleanOptional

When true, create a summary ticket after persist (still requires project External Tickets settings). Mirrors agent.jiraEnabled / pipeline setting jira_enabled. Default false when unset (older plugins omit → no ticket). Result is written to remediation_agent_summary.notification_metadata.jira {creationEnabled, ticketId, ticketUrl}.

Default: falseExample: true
limitinteger · int64 · min: 1 · max: 10000Optional

Maximum number of occurrences

Default: 1000Example: 8773
modelNamestring · max: 256OptionalExample: us4
newOccurrenceIntroducedCountinteger · int64Optional

New findings introduced by the fix branch that were not in the original scope

Example: 8958288031106543000
occurrenceRemediatedCountinteger · int64Optional

Occurrences with verdict REMEDIATED

Example: 1688229898222595300
onlyTruePositivebooleanOptional

Legacy: when true and onlyTruePositiveIssueTypes is empty, apply TP filter to all resolved issueTypes. Prefer onlyTruePositiveIssueTypes for per-type Exclude False Positives.

Default: falseExample: false
originalOccurrenceCountinteger · int64Optional

In-scope occurrence count from the pre-plugin (original_occurrence_count)

Example: 6654595133128232000
originalScanIdstringRequired

STO scan id the agent remediated

Example: scan111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$
promptVersionstring · max: 64OptionalExample: o2x
pullRequestMetadatastring · binaryOptional

Run-level PR stamp (PascalCase keys matching types.PullRequestMetadata): Provider, AccountID, OrgID, ProjectID, RepositoryName, Number, Title, SourceBranch, TargetBranch, Url, CommentUrl, BuildId, CommitsCount, ConnectorRef. ConnectorRef (SCM connector that opened the PR) enables live status refresh. BuildId = TRIGGERING_PIPELINE_BUILD_NUMBER (not parsed from SourceBranch). CommitsCount = fix commits on the PR. Copied onto issue_augmentation.pr_metadata for every in-scope occurrence.

Example: Enim totam recusandae voluptatem.
targetIdstringOptional

Target id the agent remediated; supplied by the plugin

Example: target1111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$
targetNamestring · max: 128Optional

Target name the agent remediated; supplied by the plugin

Example: pv4
targetVariantNamestring · max: 128Optional

Target variant name the agent remediated; supplied by the plugin

Example: 4xl
userScanActiveCountinteger · int64OptionalExample: 4878067008882298000
workflowExecutionIdstring · max: 64Optional

Opaque ssca-manager workflow execution id

Example: k81
Responses
200

OK response.

application/json
summaryIdinteger · int64Required

remediation_agent_summary.internal_id for this run

Example: 6856567302341357000
ticketIdstring · max: 128Optional

External ticket key/id (e.g. Jira STO-34219) when ticket creation succeeds; omit when not created

Example: STO-34219
ticketUrlstring · uriOptional

URL of the summary ticket created for this remediation run, when ticket creation succeeds

Example: https://jira.example.com/browse/STO-123
writteninteger · int64Required

Number of per-occurrence augmentation rows written

Example: 429411489281479230
post/api/v2/remediation-agent/results/batch
POST /gateway/sto/api/v2/remediation-agent/results/batch?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1008

{
  "activeOccurrenceCount": 1905069439744297200,
  "excludeRepoPatterns": [
    "jfm",
    "ben",
    "cli"
  ],
  "excludeUnreachable": false,
  "issueIds": [
    "bro",
    "8da",
    "3by"
  ],
  "issueTypes": [
    "SECRET",
    "SAST",
    "SCA",
    "SAST"
  ],
  "jiraEnabled": false,
  "limit": 4742,
  "modelName": "vn1",
  "newOccurrenceIntroducedCount": 325278836991922200,
  "occurrenceRemediatedCount": 5362431424184966000,
  "onlyTruePositive": true,
  "onlyTruePositiveIssueTypes": [
    "SAST",
    "SECRET",
    "SAST",
    "SECRET"
  ],
  "originalOccurrenceCount": 5094687477339663000,
  "originalScanId": "scan111111111111111111",
  "promptVersion": "n2m",
  "pullRequestMetadata": "Quasi et.",
  "severityCodes": [
    "LOW",
    "MEDIUM"
  ],
  "targetId": "target1111111111111111",
  "targetName": "bzm",
  "targetVariantName": "ny1",
  "userScanActiveCount": 1632754644395087400,
  "validationMetadata": {
    "build": {
      "executionId": "2zz",
      "orgId": "h2h",
      "pipelineId": "qni",
      "projectId": "kb5",
      "status": "laq"
    },
    "remediation": {
      "executionId": "06w",
      "orgId": "a5g",
      "pipelineId": "2f9",
      "projectId": "qvo",
      "scanId": "scan222222222222222222",
      "status": "pxs"
    }
  },
  "workflowExecutionId": "7vf"
}
{
  "summaryId": 7900509402511571000,
  "ticketId": "STO-34219",
  "ticketUrl": "https://jira.example.com/browse/STO-123",
  "written": 5344232660940647000
}

Last updated

Was this helpful?