Advisory AI API Reference

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

1. Overview

The Advisory AI service exposes deterministic, guardrail-enforced endpoints for generating advisory summaries, conflict explanations, and remediation plans. Each request is backed by the Aggregation-Only Contract (AOC): inputs originate from immutable Concelier/Excititor evidence and SBOM context, and every output ships with verifiable citations and cache digests.

The surface is gated behind Authority scopes and is designed to operate identically online or offline (local inference profiles).

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

2. Base conventions

ItemValue
Base path/v1/advisory-ai
Media typesapplication/json (request + response)
AuthenticationOAuth2 access token (JWT, DPoP-bound or mTLS as per tenant policy)
Required scopesSee Authentication & scopes
IdempotencyRequests are cached by (taskType, advisoryKey, policyVersion, profile, artifactId/purl, preferredSections) unless forceRefresh is true
DeterminismGuardrails reject outputs lacking citations; cache digests allow replay and offline verification

3. Authentication & scopes

Advisory AI calls must include aoc:verify plus an Advisory AI scope. Authority enforces tenant binding for all combinations.

ScopePurposeTypical principals
advisory-ai:viewRead cached artefacts (GET /outputs/{outputHash})Console backend, evidence exporters
advisory-ai:operateSubmit inference jobs (POST /summaries, /conflicts, /remediation)Platform services, CLI automation
advisory-ai:adminManage profiles & policy (PATCH /profiles, future)Platform operators

Requests without aoc:verify are rejected with invalid_scope. Tokens aimed at remote inference profiles must also satisfy tenant consent (requireTenantConsent in Authority config).

4. Profiles & inference selection

Profiles determine which model backend and guardrail stack execute the request. The profile field defaults to default (fips-local).

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)