> ## Documentation Index
> Fetch the complete documentation index at: https://docs.khanhng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 2.4 Crosscutting Concepts

## Identity and authorization

The API validates Microsoft Entra bearer tokens and checks Customer, Reviewer, and Admin roles.

Customer upload and submission routes check claim ownership. Review and KPI routes require Reviewer or Admin roles, while the current test-order route also allows Customer. See the API reference before treating that route as Admin-only.

Local development has a bypass identity that grants all roles. The guide says to keep this limited to local mode and never set local mode in Azure.

## Validation and error handling

The API uses Pydantic request models and explicit HTTP errors for invalid state, missing resources, unauthorized roles, duplicate decisions, upload limits, and invalid payment webhook signatures.

Claim state transitions are owned by the application and durable workflow rather than the language model.

## Configuration and secrets

Configuration is supplied through environment variables. Local development uses a local environment file that must not be committed.

Deployed credentials use managed identity where available. Stripe secrets, webhook signing secrets, search keys, API audiences, function keys, and email settings belong in Key Vault or protected deployment configuration.

All tenant, subscription, resource, and secret values are redacted from this documentation.

## Resilience and side effects

Durable Functions owns retries, timers, external approval events, and workflow state.

Payment execution uses `refundflow:{claim_id}` as the Stripe idempotency key. Webhook signatures are verified before status updates.

The model has no side-effect tools. Policy retrieval failure closes the assessment path rather than allowing an unsupported decision.

## Observability

The repository configures telemetry and claim spans. The exact fields in a deployed Application Insights instance need runtime verification.

The guide calls for excluding customer email, document text, SAS URLs, tokens, Stripe keys, and raw prompts from telemetry. Inspect deployed traces to verify this.

## Human oversight

A model can propose eligibility and amount. It cannot approve, reject, or execute a refund.

A reviewer decision is required. The assessment workflow sets a two-reviewer requirement when its proposed refund amount is greater than 500.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.