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

Read the architecture guide →

AI Governance

Input screening, privacy middleware, policy enforcement, and tool boundaries for BookWorm's AI workflows.

Cross-cutting Concept

Purpose and Scope

AI governance constrains prompts, models, agents, tool calls, and generated results across conversational discovery, review intelligence, and tool catalog capabilities. It applies wherever user text or external content crosses a model boundary or can trigger a state-changing action.

Visual Reference

AI Governance Guardrails

Loading graph...

Core Rules and Standards

  1. Screen before routing. Validate prompt shape, length, language, domain scope, and known injection patterns before invoking a specialist agent or tool.
  2. Protect PII at model boundaries. Anonymize sensitive data before external model calls and remove or redact sensitive content in returned results.
  3. Isolate untrusted content. Treat prompts, retrieved passages, tool output, and external documents as untrusted data rather than instructions.
  4. Apply deny-by-default policies. Every agent and tool must declare an allow rule; mutations and destructive operations require a specific policy grant.
  5. Bind actions to identity. Session state and tool authorization must remain tied to authenticated caller claims and approved workload identity.
  6. Require human review for ambiguity. Low-confidence or out-of-domain requests pause for clarification instead of guessing or escalating privilege.
  7. Record consequential decisions. Preserve policy outcome, model and tool identifiers, correlation, redaction status, and human disposition for auditable events.
Warning

Prompt screening and PII detection reduce risk but do not guarantee safety. Novel prompt attacks, detector bypasses, or policy gaps require a human review and rapid rollback mechanism.

Mechanism / How It Works

Governance StageRequired Behavior
Input admissionReject malformed, oversized, unsafe, or out-of-scope requests
Context isolationMark external text and tool output as data, never instructions
PrivacyAnonymize PII and minimize retained conversation and prompt content
RoutingClassify purpose and domain before selecting an agent or model
PolicyEvaluate tool and operation permissions with deny-overrides semantics
ExecutionUse least-privilege tools, bounded retries, and session isolation
ReviewEscalate ambiguity, policy conflicts, or consequential actions to a responsible human

Evaluation and Fallback

  • Evaluate prompt safety, domain classification, PII detection, tool authorization, output quality, and refusal behavior.
  • Use deterministic tests for policy allow/deny decisions and adversarial tests for prompt and tool poisoning patterns.
  • Fall back to a safe clarification or human handoff when routing confidence is low or policy state is uncertain.
  • Disallow silent retries that change policy scope or expand tool permissions.
  • Maintain an approved model, prompt, policy, and tool baseline for every release.

Verification and Governance

  • Test allow, deny, rate-limit, prompt-injection, PII, circuit-breaker, and human-handoff cases for every agent or tool change.
  • Review policy coverage when a model or integration gains new data or mutation access.
  • Verify that policy files and identity bindings load at runtime, not only during development.
  • Define rollback criteria for quality regressions, privacy incidents, elevated false refusal rates, or unexpected tool use.
  • Security and PrivacyCustom DocSecurity and PrivacyIdentity, authorization, and sensitive-data protections at BookWorm's API, AI, and logging boundaries.Ownerplatform-engineering-teamOpen doc — Identity and PII boundaries.
  • Conversational Book DiscoveryCustom DocConversational Book DiscoveryRouting, grounding, privacy, and response generation for a chat turn.Ownerai-capabilities-teamOpen doc — Conversational decision and tool flow.
  • MS Decisions Model Use Case & Lessons LearnedCustom DocMS Decisions Model Use Case & Lessons LearnedHow BookWorm applies Microsoft-Decision-1 (System 1) for single-pass chat routing, safety gating, and dynamic tool selec...Ownerarchitecture-enabling-teamOpen doc — Model-routing rationale.