API Management Policy Model
ION composes APIM behavior from a platform-owned global policy and service-owned API and operation policies. The final behavior is the inherited policy chain, not one XML file viewed in isolation.
Concepts
| Term | ION V2 meaning |
|---|---|
| API | A versioned set of operations imported from an OpenAPI contract and connected to a service backend. |
| Operation | One OpenAPI operationId with a method, public path, backend rewrite, required role, and optional caching behavior. |
| Product | A grouping and publication boundary for APIs. Product subscription keys are not the ION caller-authentication mechanism. |
| Policy | Ordered XML statements that alter or constrain inbound, backend, outbound, and error processing. |
| Named value | Environment-specific APIM configuration, optionally sourced from Key Vault, referenced as {{NAME}} in policy XML. |
| Policy fragment | Shared policy statements included by identifier, used in V2 for request, response, and error tracing. |
| Backend | The OAuth-protected Azure compute endpoint implementing an API or operation. |
| Diagnostic/logger | API-level Application Insights integration and capture settings used with policy trace events. |
ION does not use the APIM developer portal or subscription keys as the application security boundary. APIs are defined and deployed through OpenAPI, Terraform, and policy XML.
Policy sections
<policies>
<inbound>
<!-- Authenticate, authorize, route, transform, throttle, and cache lookup. -->
</inbound>
<backend>
<!-- Control forwarding and backend execution. -->
</backend>
<outbound>
<!-- Shape, sanitize, trace, and optionally cache the response. -->
</outbound>
<on-error>
<!-- Trace and normalize failures. -->
</on-error>
</policies>
Policies execute top to bottom within each section. Not every APIM statement is valid in every section or scope.
Scope and inheritance
APIM supports global, workspace, product, API, and operation scopes. V2 uses the following effective chain:
Workspace policy is not part of V2. Products group APIs, but the deployed security controls are defined at global, API, and operation scope.
<base /> inserts the parent scope at its location. In the normal inbound chain:
- The global policy validates caller and tenant and creates the validated
jwtcontext. - The API policy selects the backend, applies API traffic controls, obtains the
APIM managed-identity token, and replaces backend
Authorization. - The operation policy rewrites the URI, validates an
Ion.*role, and optionally performs cache lookup. - The inherited global backend section applies per-API concurrency and executes
forward-request.
Moving or removing <base /> can bypass authentication, tracing, backend-token
creation, or forwarding. It is therefore a security-relevant change. The deployed
Phoenix webhook flow is a reviewed exception: its
API policy omits global inbound inheritance because Microsoft Graph does not use
ION caller tokens, while retaining global backend, outbound, and error behavior.
Global platform policy
The environment-specific Rome global policy currently provides:
- a required
Authorizationheader; - generation or preservation of
X-Transaction-Id; - extraction of the tenant claim;
- cached tenant-status validation using a managed-identity-authenticated
HEADrequest for non-Ontinue tenants; - JWT signature, issuer, audience, and validity validation;
- required
rolesandtidclaims; - rejection of customer application tokens where unsupported;
- trusted
X-Tenant-Id, original-token context, and forwarding context; - request, response, and error fragments;
- per-API backend concurrency; and
- backend forwarding with a bounded timeout and failure on backend error.
Global policy must remain environment-specific where audiences and issuer configuration differ, but policy behavior should remain consistent across environments. See Global policy implementation for the complete deployed execution flow, sanitized XML, environment differences, and current implementation risks.
Webhook inbound exception
A dedicated provider webhook API may omit global inbound <base /> only when the
provider cannot present an ION token and the backend implements the provider’s
sender-validation protocol. The API must still authenticate APIM to the protected
backend, enforce bounded traffic controls, and inherit global backend, outbound,
and error sections.
This is not a general public-API pattern. Provider validation, subscription and tenant binding, replay controls where available, safe acknowledgement, and negative tests are mandatory. See Webhook flow implementation for the deployed Phoenix example.
Service API policy
The API policy applies controls common to every operation in one imported API:
- backend base URL;
- per-caller or per-API rate limiting;
- APIM user-assigned managed-identity token acquisition;
- replacement of backend
Authorizationwith the APIM token; and - removal of unnecessary technology-disclosure headers.
Backend authentication belongs at API scope when all operations use the same backend trust boundary. An operation may override a backend only when it still inherits equivalent authentication and authorization.
Operation policy
The operation policy owns behavior that varies by OpenAPI operationId:
- public-to-backend URI rewrite;
- required
Ion.*role or roles; - optional backend override;
- cache lookup and storage; and
- operation-specific transformation or validation.
Every protected OpenAPI operation must have an explicit operation-policy mapping
or an equivalent API-level authorization rule. An OpenAPI security declaration
documents the contract but does not itself create APIM role enforcement.
Original caller context and backend identity
The backend receives an APIM managed-identity token in Authorization. The
deployed global policy can also preserve the validated caller token in
X-Authorization for approved BFF routes and provides trusted tenant and
correlation context.
X-Authorization is sensitive bearer data. It must not be logged, stored,
forwarded to another service, or enabled for a route that does not explicitly
require the original user context. New domain-service APIs should use the APIM
identity and minimal validated context instead.
Caching model
APIM cache policy is operation-specific. A cache key must vary by every request dimension that can change authorization or response content, including customer or tenant context when applicable. A cached customer response must never be servable to another customer.
Only safe, idempotent responses may be cached. Mutations, authorization failures, error responses, and sensitive personalized data are not cached unless a reviewed design proves isolation and correctness.
Diagnostics model
Effective diagnostics combine the API diagnostic resource and inherited trace fragments. Correlation identifiers, route, operation, status, latency, cache result, and bounded authorization outcomes are useful. Full payloads, user attributes, raw claims, and request or response headers can contain customer data or credentials and require minimization.
Authorization and X-Authorization must never appear in diagnostic output.
Production trace destinations, access, sampling, and retention are controlled
platform configuration.