Policy Gateway (Merged into Policy Engine)

Audience: Operators and integrators calling the Stella Ops Policy HTTP API (Console, CLI, and automation). Status: The StellaOps.Policy.Gateway service has been merged into StellaOps.Policy.Engine. All gateway endpoints (exceptions, deltas, gates, governance, tool-lattice, pack CRUD, activation) are now served directly by the policy-engine process. The separate gateway container, HTTP proxy layer, DPoP token flow, and PolicyEngineClient have been removed.

This guide documents the HTTP surface and operational behaviour of the policy-engine endpoints that the former gateway exposed. For the full DTO and schema reference, see the Policy Engine API doc.

1 - Responsibilities (now handled by Policy Engine)

2 - Endpoints

All endpoints below are served by the policy-engine service.

RouteMethodDescriptionRequired scope(s)
/api/policy/packsGETList policy packs and revisions for the active tenant.policy:read
/api/policy/packsPOSTCreate a policy pack shell or upsert display metadata.policy:author
/api/policy/packs/{packId}/revisionsPOSTCreate or update a policy revision (draft/approved).policy:author
/api/policy/packs/{packId}/revisions/{version}:activatePOSTActivate a revision, enforcing single/two-person approvals.policy:operate, policy:activate

Response shapes

Dual-control activation

Activation configuration wiring

3 - Authentication & headers

HeaderSourceNotes
AuthorizationCaller token.Caller tokens must include tenant scope.
X-StellaOps-TenantIdCallerTenant isolation header.

Note: The previous DPoP proxy layer (gateway client credentials, PolicyEngineClient, PolicyGatewayDpopHandler) has been removed. Callers authenticate directly with Policy Engine using standard StellaOps resource server authentication.

4 - Metrics & logging

All activation calls emit:

Structured logs (category StellaOps.Policy.Engine.Activation) include PackId, Version, Outcome, Source, and status code for audit trails.

5 - Release Gate Runtime Integrity

POST /api/v1/policy/gate/evaluate and the scheduler-backed async gate worker are fail-closed for missing baselines. A request that omits baselineRef and has no tenant baseline now returns a denied gate by default with baselineStatus: "missing:block", blockedBy: "missing-baseline", and evidence describing the selected missing-baseline mode.

Callers that need first-build behavior must choose it explicitly:

missingBaselineModeResult when no baseline existsUse case
block or omittedDeny/fail the gateProtected and production profiles
warnReturn a warning with evidenceNon-prod migration windows
bootstrapCreate the initial baseline only when no explicit baselineRef is suppliedAudited first-build enrollment

Bootstrap is never implicit. Explicit baselineRef values remain strict: a missing referenced snapshot is an error rather than a fabricated baseline.

Score-gate signing also fails closed. Operators must configure PolicyGate:ScoreGate:SigningSecretBase64 or STELLA_GATE_SIGNING_SECRET with at least 32 bytes of non-zero decoded key material. Empty, invalid, or all-zero secrets cause the request path to return 503 problem+json.

Transparency mode is explicit:

PolicyGate:ScoreGate:TransparencyModeBehavior
OfflineSign locally and do not submit to Rekor
OnlineRekorRequire PolicyGate:ScoreGate:RekorUrl or STELLA_REKOR_URL, and anchor requested verdicts to that endpoint

There is no public Rekor default. Online Rekor is an opt-in profile and the endpoint must be configured by the deployment.

6 - Sample curl workflows

Assuming you already obtained an access token ($TOKEN) for tenant acme:

curl -sS https://gateway.example.com/api/policy/packs \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-StellaOps-TenantId: acme"

# Draft a new revision
curl -sS https://gateway.example.com/api/policy/packs/policy.core/revisions \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-StellaOps-TenantId: acme" \
  -H "Content-Type: application/json" \
  -d '{"version":5,"requiresTwoPersonApproval":true,"initialStatus":"Draft"}'

# Activate revision 5 (returns 202 when awaiting the second approver)
curl -sS https://gateway.example.com/api/policy/packs/policy.core/revisions/5:activate \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-StellaOps-TenantId: acme" \
  -H "Content-Type: application/json" \
  -d '{"comment":"Rollout baseline"}'

7 - Offline Kit guidance

8 - Backwards compatibility

9 - Change log