Skip to main content

Well-Architected Framework

FrootAI aligns every primitive, play, and protocol element to the 6 pillars of the Azure Well-Architected Framework (WAF). This isn't optional โ€” WAF alignment is enforced at the protocol level via fai-manifest.json.

The 6 Pillarsโ€‹

PillarKey PrinciplesExample Enforcement
๐Ÿ›ก๏ธ SecurityIdentity, network, data protection, AI-specific securityManaged Identity, Key Vault, content safety filters
๐Ÿ”„ ReliabilityRetry, circuit breaker, health checks, graceful degradationExponential backoff, /health endpoints, cached fallbacks
๐Ÿ’ฐ Cost OptimizationModel routing, token budgets, right-sizing, FinOpsGPT-4o-mini triage, costPerQuery guardrails
โš™๏ธ Operational ExcellenceCI/CD, observability, IaC, incident managementStructured logging, App Insights, Bicep templates
โšก Performance EfficiencyCaching, streaming, async patterns, bundle optimizationResponse caching, SSE streaming, CDN for static assets
๐Ÿค– Responsible AIContent safety, groundedness, fairness, transparencyAzure AI Content Safety, groundedness โ‰ฅ 0.95, source citations

Securityโ€‹

Every FrootAI solution enforces:

  • Never hardcode secrets โ€” use Azure Managed Identity and Key Vault
  • RBAC with least-privilege โ€” Microsoft Entra ID for user authentication
  • Private endpoints for all PaaS services in production
  • Content safety filters on all AI endpoints
  • Rate limiting AI API calls per user/tenant
  • Input sanitization โ€” validate and sanitize all prompts before sending to models
fai-manifest.json โ€” Security WAF
{
"context": {
"waf": ["security"]
}
}

Reliabilityโ€‹

  • All external API calls must have retry logic with exponential backoff (3 retries: 1s/2s/4s with jitter)
  • Every service must expose a /health endpoint verifying downstream dependencies
  • If Azure OpenAI is unavailable, fall back to cached responses or static content
  • HTTP client timeouts: 30s for AI endpoints, 10s for search, 5s for metadata
config/guardrails.json โ€” Reliability thresholds
{
"thresholds": {
"coherence": 0.90,
"groundedness": 0.95
}
}

Cost Optimizationโ€‹

  • Use model routing: GPT-4o-mini for simple tasks, GPT-4o for complex reasoning
  • Implement token budgets per request via max_tokens in config
  • Cache frequent AI responses with TTL-based semantic deduplication
  • Set costPerQuery guardrails in fai-manifest.json
  • Default to the smallest viable SKU โ€” scale up based on metrics, not assumptions
config/openai.json โ€” Cost controls
{
"model": "gpt-4o",
"max_tokens": 4096,
"fallback_model": "gpt-4o-mini"
}
tip

Use the FrootAI Cost Estimator to calculate monthly Azure costs for any solution play at dev or production scale.

Operational Excellenceโ€‹

  • All deployments must go through CI/CD pipelines โ€” no manual deployments
  • Use conventional commits (feat:, fix:, docs:, chore:)
  • All infrastructure must be defined in Bicep/Terraform โ€” no portal clicks
  • Structured logging with correlation IDs across all services
  • Application Insights for APM, distributed tracing, and custom AI metrics
# Validate consistency before every release
npm run validate:primitives
node engine/index.js fai-manifest.json --status

Performance Efficiencyโ€‹

  • Target: < 3s for simple queries, < 10s for complex multi-step reasoning
  • Use streaming responses for AI chat interfaces
  • Implement response caching for repeated queries (semantic similarity > 0.95)
  • Parallelize independent AI calls (search + glossary lookup)
  • Use appropriate top_k for RAG scenarios (5โ€“10 for most use cases)

Responsible AIโ€‹

  • All user-facing AI responses must pass through Azure AI Content Safety
  • RAG responses must cite sources โ€” never generate unsourced claims
  • Implement groundedness checks (score โ‰ฅ 0.95 on 0โ€“1 scale)
  • Always include "AI-generated" disclaimers on outputs
  • Critical decisions must have human-in-the-loop validation
config/guardrails.json โ€” Responsible AI thresholds
{
"content_safety": {
"hate": 0,
"violence": 0,
"self_harm": 0,
"sexual": 0
}
}
danger

Content safety thresholds must be zero for all categories in production โ€” zero tolerance for harmful content.

WAF in the FAI Protocolโ€‹

Every primitive can declare WAF alignment in its frontmatter:

agents/fai-security-reviewer.agent.md
---
description: "Reviews code for OWASP LLM Top 10 vulnerabilities"
waf: ["security", "responsible-ai"]
plays: ["30-ai-security-hardening"]
---

The fai-manifest.json enforces play-level WAF pillars. The FAI Engine validates that a play's declared pillars are covered by its primitives:

fai-manifest.json
{
"context": {
"waf": ["security", "reliability", "cost-optimization", "responsible-ai"]
}
}

Valid WAF Pillar Valuesโ€‹

These are the only valid values in waf arrays:

ValuePillar
securityIdentity, network, data protection, AI security
reliabilityRetry, circuit breaker, health checks, degradation
cost-optimizationModel routing, token budgets, right-sizing
operational-excellenceCI/CD, observability, IaC, incidents
performance-efficiencyCaching, streaming, async, optimization
responsible-aiContent safety, groundedness, fairness

Next Stepsโ€‹

  • FAI Protocol โ€” how WAF is enforced at the protocol level
  • Primitives โ€” how each primitive type declares WAF alignment
  • PR Checklist โ€” WAF validation in pull requests