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โ
| Pillar | Key Principles | Example Enforcement |
|---|---|---|
| ๐ก๏ธ Security | Identity, network, data protection, AI-specific security | Managed Identity, Key Vault, content safety filters |
| ๐ Reliability | Retry, circuit breaker, health checks, graceful degradation | Exponential backoff, /health endpoints, cached fallbacks |
| ๐ฐ Cost Optimization | Model routing, token budgets, right-sizing, FinOps | GPT-4o-mini triage, costPerQuery guardrails |
| โ๏ธ Operational Excellence | CI/CD, observability, IaC, incident management | Structured logging, App Insights, Bicep templates |
| โก Performance Efficiency | Caching, streaming, async patterns, bundle optimization | Response caching, SSE streaming, CDN for static assets |
| ๐ค Responsible AI | Content safety, groundedness, fairness, transparency | Azure 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
/healthendpoint 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_tokensin config - Cache frequent AI responses with TTL-based semantic deduplication
- Set
costPerQueryguardrails infai-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_kfor 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:
| Value | Pillar |
|---|---|
security | Identity, network, data protection, AI security |
reliability | Retry, circuit breaker, health checks, degradation |
cost-optimization | Model routing, token budgets, right-sizing |
operational-excellence | CI/CD, observability, IaC, incidents |
performance-efficiency | Caching, streaming, async, optimization |
responsible-ai | Content 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