Advisory AI API Reference

Audience: platform integrators and automation authors calling the Advisory AI HTTP API.

1. Overview

The Advisory AI host exposes composed pipeline and retrieval endpoints. Their provider, evidence, guardrail and output requirements must be checked per operation; route publication and returned citation/hash metadata do not establish verified evidence, deterministic inference or a signed output.

The surface is gated behind typed scopes. Online/offline provider capability depends on configured runtime implementations; publication does not establish identical behavior or an available local model.

Related: CLI usage · Evidence payloads (LNM-aligned) · AI attestations and replay · Deployment guide.

2. Base conventions

ItemValue
Base path/api/advisoryai/v1/advisory-ai (PCD-456 source ad9edbcef5, 2026-10-08)
Media typesapplication/json (request + response)
AuthenticationThe owner hydrates its principal from the gateway-signed identity envelope. Gateway token handling and direct-owner authentication are separate; raw identity headers are not authorization.
Required scopesSee Authentication & scopes
IdempotencyRequests are cached by (taskType, advisoryKey, policyVersion, profile, artifactId/purl, preferredSections) unless forceRefresh is true
DeterminismCache/output digests identify data; they do not establish identical regenerated inference or cryptographic verification.

3. Authentication & scopes

The current AdvisoryAIPolicies use typed any-of requirements. View accepts view/operate/admin; operate accepts operate/admin; admin accepts admin only. Pipeline and explanation handlers have additional task/explain checks. In particular explanation replay’s view policy does not make a view-only caller pass its explain helper. These checks do not require an aoc:verify claim.

ScopePurposeTypical principals
advisory-ai:viewRead cached outputs and declared read surfaces; additional handler checks may narrow accessConsole backend, evidence exporters
advisory-ai:operateSubmit mapped pipeline/explanation/workflow operationsPlatform services, CLI automation
advisory-ai:adminSatisfy the admin policy and the broader operate/view any-of requirementsPlatform operators

Provider exposure and runtime configuration remain separate gates. Reverify Program.cs, Security/AdvisoryAIPolicies.cs and the operation handler before assuming a scope, tenant-isolation property or remote-provider permission.

4. Profiles & inference selection

The profile table below is design vocabulary, not a verified provider catalogue. The request’s profile and the configured inference/provider implementation are separate; no available local/FIPS/GOST/cloud model is inferred from these names.

ProfileDescription
default / fips-localLocal deterministic model packaged with Offline Kit; FIPS-compliant crypto
gost-localLocal profile using GOST-approved crypto stack
cloud-openaiRemote inference via cloud connector (disabled unless tenant consent flag set)
CustomInstallations may register additional profiles via Authority advisory-ai admin APIs

5. Common request envelope

All task endpoints accept the same JSON payload; taskType is implied by the route.

{
  "advisoryKey": "csaf:redhat:RHSA-2025:1001",
  "artifactId": "registry.stella-ops.internal/runtime/api",
  "artifactPurl": "pkg:oci/runtime-api@sha256:d2c3...",
  "policyVersion": "2025.10.1",
  "profile": "fips-local",
  "preferredSections": ["Summary", "Remediation"],
  "forceRefresh": false
}

Field notes:

6. Responses & caching

Successful responses share a common envelope:

{
  "taskType": "Summary",
  "profile": "fips-local",
  "generatedAt": "2025-11-03T18:22:43Z",
  "inputDigest": "sha256:6f3b...",
  "outputHash": "sha256:1d7e...",
  "ttlSeconds": 86400,
  "content": {
    "format": "markdown",
    "body": "### Summary\n1. [Vendor statement][1] ..."
  },
  "citations": [
    {
      "index": 1,
      "kind": "advisory",
      "sourceId": "concelier:csaf:redhat:RHSA-2025:1001:paragraph:12",
      "uri": "https://access.redhat.com/errata/RHSA-2025:1001"
    }
  ],
  "context": {
    "planCacheKey": "adv-summary:csaf:redhat:RHSA-2025:1001:fips-local",
    "chunks": 42,
    "vectorMatches": 12,
    "sbom": {
      "artifactId": "registry.stella-ops.internal/runtime/api",
      "versionTimeline": 8,
      "dependencyPaths": 5,
      "dependencyNodes": 17
    }
  }
}

7. Endpoints

7.1 POST /v1/advisory-ai/summaries

Generate or retrieve a cached advisory summary. Requires advisory-ai:operate.

7.2 POST /v1/advisory-ai/conflicts

Explain conflicting VEX statements, ranked by trust metadata.

7.3 POST /v1/advisory-ai/remediation

Produce remediation plan with fix versions and verification steps.

7.4 POST /v1/advisory-ai/remediation/apply

Apply a remediation plan by creating a PR/MR in the target SCM. Requires advisory-ai:operate and tenant SCM connector configuration. GitHub PR bodies are returned only after the SCM connector and repository owner/repo context are valid and the PR is created. Missing connector or invalid repository context returns a failed result without prBody; the service must not emit placeholder PR text.

{
  "planId": "plan-abc123",
  "scmType": "github"
}
{
  "prId": "gh-pr-42",
  "prNumber": 42,
  "url": "https://github.com/owner/repo/pull/42",
  "branchName": "stellaops/security-fix/plan-abc123",
  "status": "Open",
  "statusMessage": "Pull request created successfully",
  "prBody": "## Security Remediation\n\n**Plan ID:** `plan-abc123`\n...",
  "createdAt": "2026-01-14T12:00:00Z",
  "updatedAt": "2026-01-14T12:00:00Z"
}

7.5 GET /v1/advisory-ai/remediation/status/{prId}

Check the status of a PR created by the remediation apply endpoint.

7.6 GET /v1/advisory-ai/outputs/{outputHash}

Fetch cached artefact (same envelope as §6). Requires advisory-ai:view.

7.7 GET /v1/advisory-ai/plans/{cacheKey} (optional)

When plan preview is enabled (feature flag advisoryAi.planPreview.enabled), this endpoint returns the orchestration plan using AdvisoryPipelinePlanResponse (task metadata, chunk/vector counts). Requires advisory-ai:operate.

7.8 LLM adapter exposure

Advisory AI exposes a unified adapter surface for provider discovery and OpenAI-compatible completion calls.

Scope requirements (enforced by the canonical named policies — see architecture.md §8):

Historical note: earlier builds layered a dead inner advisory:adapter:read / advisory:adapter:invoke / advisory:openai:* / advisory:{providerId}:invoke / advisory:run check under the named policy. Those strings were never registered Authority scopes and were granted to no client, so the inner AND gate made these endpoints unreachable even for a valid advisory-ai:operate caller. The dead inner check was removed; the named policies are the sole gate.

Operational notes:

Runtime config keys:

Gateway exposure paths:

Deterministic retrieval API for docs, OpenAPI operations, and Doctor checks.

Scope notes:

Search request:

{
  "q": "docker login fails with x509 unknown authority",
  "k": 10,
  "filters": {
    "type": ["docs", "doctor"],
    "product": "stella-ops",
    "version": "2026.02",
    "service": "gateway",
    "tags": ["troubleshooting", "tls"]
  },
  "includeDebug": false
}

Search response contains only grounded results with source actions:

Rebuild response:

{
  "documentCount": 12034,
  "chunkCount": 68291,
  "apiSpecCount": 41,
  "apiOperationCount": 2132,
  "doctorProjectionCount": 84,
  "durationMs": 8245
}

8. Error model

Errors follow a standard problem+JSON envelope:

{
  "status": 400,
  "code": "advisory.summary.missingAdvisoryKey",
  "message": "advisoryKey must be provided",
  "traceId": "01HECAJ6RE8T5H4P6Q0XZ7ZD4T",
  "retryAfter": 30
}
HTTPCode prefixMeaning
400advisory.summary.*, advisory.remediation.*Validation failures or unsupported profile/task combinations
401auth.invalid_tokenToken expired/invalid; ensure DPoP proof matches access token
403auth.insufficient_scopeMissing advisory-ai scope or tenant consent
404advisory.*.notFoundAdvisory/key not available for tenant
409advisory.*.contextUnavailableDependencies (SBOM, VEX, policy) not ready; retry after indicated seconds
422advisory.*.noFixAvailableRemediation cannot be produced given current evidence
429rate_limit.exceededCaller breached tenant or profile rate limit; examine Retry-After
503advisory.backend.unavailableModel backend offline or remote profile disabled

All errors include traceId for cross-service correlation and log search.

9. Rate limiting & quotas

Advisory AI honours per-tenant quotas configured under advisoryAi.rateLimits:

Limits are enforced at the gateway; the API returns 429 with standard Retry-After seconds. Operators can adjust limits via Authority configuration bundles and propagate offline using the Offline Kit.

10. Observability & audit

11. Offline & sovereignty considerations

12. Change log

Date (UTC)Change
2025-11-03Initial sprint-110 preview covering summary/conflict/remediation endpoints, cache retrieval, plan preview, and error/rate limit model.
2026-01-14Added PR generation endpoints (7.4, 7.5): POST /remediation/apply and GET /remediation/status/{prId}. PR body includes security remediation template with steps, expected changes, tests, rollback, VEX claim. Supported SCM types: github, gitlab, azure-devops, gitea. (SPRINT_20260112_007_BE_remediation_pr_generator)