Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

ADR-004: Keep AI feedback summarization read-only and governed

Rating generates feedback insights at read time with allow-listed read tools, PII redaction, and rate limits, without persisting or changing feedback or Catalog projections.

October 25, 2026AcceptedSecurity

1. Context & Problem

Customers benefit from a concise summary of a BookEntityv1.0.0BookCanonical sellable title in the product catalog, encapsulating descriptive metadata, pricing, stock availability, taxono...Ownercatalog-experience-teamOpen docs‘s FeedbackEntityv1.0.0FeedbackRepresents an individual customer's rating and optional written review for a Catalog book.Ownercatalog-experience-teamOpen docs, especially when a title has many reviews. However, an AI-generated summary and classification is a derived interpretation—not an authoritative business record.

Allowing an AI summarization workflow to write directly to data stores could let an untrusted or unexpected model path alter real customer ratings or Catalog’s rating counts. In addition, summarizing customer comments combines private review text with Catalog product context, requiring strict privacy protection, controlled tool access, and bounded usage rather than unrestricted model access.

2. Business Value

  • Zero risk to authoritative data: Summaries cannot alter stored customer reviews, numeric ratings, or Catalog projections.
  • Stronger customer privacy: Sensitive personal details are redacted before and after model processing, and tool access follows a strict least-privilege policy.
  • Consistent numeric accuracy: Review counts and average ratings are calculated deterministically by application logic rather than estimated by the language model.
  • Cost and performance efficiency: Rate limits and short-lived caching prevent excessive model calls for repeated requests on the same book.

3. How It Works

Rating AgentAgentv1.0.0Rating AgentRead-only review intelligence specialist that summarizes customer feedback over A2A gRPC and map-reduce workflows while ...PublishesAnalyzeText, AnonymizeTextOwnercatalog-experience-teamDiagramRepositoryOpen docs generates book feedback summaries strictly on demand when an authenticated user requests one:

  1. Check cache first: The service first checks whether a recent summary is already cached for the book. If found, it returns that cached result immediately without invoking the AI workflow.
  2. Gather governed, read-only context: On a cache miss, the workflow retrieves Catalog product context and raw reviews using only explicitly approved, read-only tools. Write or destructive actions are blocked by default, and review reads are rate-limited.
  3. Protect personal data: Personally identifiable information is redacted before comments are sent to the model and again on the model’s output.
  4. Separate math from narrative: Application logic—not the AI model—calculates the exact review count, arithmetic mean rating, and final classification rules. The model partitions reviews into bounded batches, summarizes them in parallel, consolidates the evidence, and produces explanatory narrative and confidence assessment.
  5. Return without saving as truth: The generated summary is returned to the caller and optionally placed in a temporary, disposable cache—never persisted as an authoritative record.

4. Trade-offs & Lessons Learned

  • Bounded staleness from caching: Because cached summaries remain valid until their expiration window passes (up to six hours for books with reviews, or one minute when no reviews exist), a summary may temporarily lag behind newly added or deleted feedback.
  • Read-time dependency chain: On a cache miss, summarization relies on the feedback store, Catalog context, prompt access, and AI model availability. If any dependency is unavailable, the summary request can fail even though regular review browsing continues to work.
  • Ongoing governance obligation: Read-only access eliminates mutation risk, but it does not automatically eliminate privacy risk when reading customer comments. PII redaction rules, tool allow-lists, and rate limits require continuous monitoring.
  • Clear separation of authority: Consumers should treat the returned narrative as an explanatory aid, while trusting deterministic application metrics for exact rating counts and averages.

Alternatives Considered

  • Persist generated classifications as authoritative rating data: Rejected because it would turn model output into business state requiring separate invalidation, update, and audit workflows.
  • Give the summarizer write access: Rejected because write capabilities are unnecessary for a read-only summary and introduce unacceptable data-integrity risks.
  • Summarize on every request without caching: Rejected because it would repeatedly read reviews and invoke the model for unchanged data, increasing latency and cost.

5. Technical Reference

  • Participating components: Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs, Rating AgentAgentv1.0.0Rating AgentRead-only review intelligence specialist that summarizes customer feedback over A2A gRPC and map-reduce workflows while ...PublishesAnalyzeText, AnonymizeTextOwnercatalog-experience-teamDiagramRepositoryOpen docs, Summarize feedbackQueryv1.0.0Summarize feedbackReturns a generated feedback summary, classification, rating metrics, evidence, and confidence for a book.Ownercatalog-experience-teamSchemaDiagramOpen docs, and Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs.
  • Governance & security controls:
    • Default-deny tool policy with allow-listed read-only tools for Catalog context and raw feedback retrieval; write and destructive SQL operations are blocked.
    • Authenticated query access with per-user rate limiting and rate-limited review reads.
    • PII redaction applied before model input and after model output.
  • Execution & calculation split:
    • On cache miss, rating-api loads feedback and computes review count, arithmetic mean, and classification rules in application code.
    • rating-agent partitions review inputs, summarizes bounded batches in parallel, consolidates evidence, and returns explanatory text and confidence assessment without persisting results.
  • Cache lifetimes (non-authoritative, disposable):
    • Books with feedback: 6 hours TTL.
    • No-feedback results: 1 minute TTL.
  • Cache-miss runtime dependencies: Rating Database (rating-database), Catalog context, MCP prompt access, and AI model execution.