AI Agentic Handbook
Cheat sheet

Evals & LLMOps

One line per term, the default to reach for, and the number to remember. Print it or save it as a PDF.

Golden set

A fixed, version-controlled set of realistic questions with known-good answers, so every change gets scored the same way.

Default: 200–500 items sampled from production logs, stratified by intent, 10–15% unanswerable; two labellers on 20%+ of items with κ reported; JSONL in git with a schema and a version tag; 70/30 dev/holdout split; quarterly refresh from error-analysis clusters.

95% CI half-width: ±5.5 / ±3.5 / ±2.5 points (n = 200 / 500 / 1,000 at p ≈ 0.8)

Eval harness

The test runner for AI behaviour: run the golden set through the real pipeline, score it, and report what changed since last time.

Default: promptfoo or a thin in-house runner around the production service; pinned model snapshot ids for system and judge; response cache keyed by (stage, input hash, config hash); PR tier of 50–100 stratified items in < 5 min; nightly full run; results stored per run for trend charts.

PR-tier runtime: < 5 min (50–100 items, cached retrieval, parallelism 16–32)

Recall@k

Of all the documents that should have been found, how many made it into the top k. This is the ceiling on what your system can answer.

Default: Report recall@100 (first stage) and recall@k_final (what the prompt sees) on the golden set, per slice.

First-stage target: recall@100 ≥ 0.90 (before investing in reranking or prompts)

Precision

Of the results you returned, how many were actually relevant. Precision@5 of 0.4 means two of your five were useful.

Default: For retrieval: report precision@k at the final k alongside recall@k and nDCG@10.

Final-context precision target: ≥ 0.6 (5–8 chunks, single-hop Q&A)

nDCG

A ranking score for when some results are more relevant than others, and being near the top counts more. 1.0 is the perfect order.

Default: nDCG@10 with graded labels (0–3), linear gain unless you have a reason for exponential, computed with ranx or pytrec_eval; per-slice reporting; paired bootstrap (10k resamples) for system comparisons.

BEIR average nDCG@10: ~0.42 BM25, ~0.50–0.55 strong dense + rerank (zero-shot across BEIR datasets; approximate, varies by subset)

MRR (mean reciprocal rank)

How far down the list the first good result appears, averaged over all your questions. First place scores 1, second 1/2, third 1/3.

Default: MRR@10 for single-target retrieval (FAQ match, entity lookup, code definition), reported with hit@1, hit@10 and miss rate, per slice, with a paired bootstrap CI when comparing systems.

MS MARCO dev MRR@10: ~0.18 BM25, ~0.39–0.40 BERT-class cross-encoder (passage ranking; approximate published figures)

Faithfulness

How much of an answer is actually supported by the sources it was given. Measures grounding, not truth.

Default: Ragas faithfulness or an in-house claim-split + judge with a pinned model; claims checked against cited spans when citations exist; 150 human-labelled claims for calibration; report the mean and the share of answers below 0.8; slice by claim type (numbers, dates, entities, negations).

Production gate: ≥ 0.9 mean, < 5% of answers below 0.8 (customer-facing RAG)

Context precision

Of the chunks you gave the model, are the useful ones at the top? Noise sitting above the evidence costs more than noise below it.

Default: Ragas context_precision (reference-based when the golden set has reference answers), computed on the assembled context, not the first-stage list; reported with context recall and faithfulness as a triad, per slice.

Healthy range: ≥ 0.75 (5–8 chunk contexts after a cross-encoder reranker)

p50 / p95 / p99 latency

Speed at a percentile: p50 is the typical request, p95 and p99 are the slow tail. Targets use the tail, because averages hide the people waiting.

Default: OpenTelemetry spans per stage with exponential histograms; dashboards show p50, p95, p99 for end-to-end, TTFT and each stage; SLO on p95 for interactive endpoints; per-intent max_tokens; timeouts at 2–3× the stage p99 with fallbacks.

Fan-out tail probability: 1 − 0.99^n (n parallel calls, each with 1% chance of p99 latency; 63% at n = 100)

QPS (queries per second)

Queries per second. For LLM apps it is only the starting number: you also need concurrency and tokens per second.

Default: Capacity sheet per endpoint: daily volume, peak-hour share, LLM calls per request, input and output tokens per call, end-to-end latency → peak QPS, concurrency, TPM, $/day.

Peak-to-average ratio: 2–4× (consumer and business-hours traffic; batch jobs excluded)

SLO & SLA

A written target for how well a service should behave: '99.5% of answers under 5 seconds, over 30 days'. The gap you are allowed to miss is the error budget.

Default: Per user-facing endpoint: availability SLO 99.5%, latency SLO on p95 total and TTFT, one sampled quality SLI; 28- or 30-day rolling window; multi-window burn-rate alerts (14.4×/1 h + 5 min page, 6×/6 h + 30 min page, 1×/3 d ticket); written error-budget policy agreed with product.

99.5% monthly budget: 3.6 hours (30-day window, full-outage equivalent)

Oracle experiment

Cheat on purpose: hand one stage perfect input and see how good the answer gets. The jump tells you which stage to fix.

Default: Four-arm run on the golden set every quarter and before any major investment: closed-book, production, oracle, oracle + distractors; same model, prompt and judge across arms; report gaps with paired bootstrap CIs.

Gold-evidence labelling: 4–8 min per question (domain-literate labeller marking supporting passages)

Error analysis

Read your actual failures, label why each happened, count the groups, fix the biggest. Unglamorous, and hard to beat.

Default: Weekly 60–90 minute session: sample 50–100 failures (thumbs-down, judge failures, golden misses) from a trace viewer (Langfuse, LangSmith, Braintrust, Phoenix); one-line note per trace on the first error; cluster into ≤ 12 categories; spreadsheet with counts, owner and a linked eval check per category.

Sample size: 50–100 traces (enough to see categories ≥ 5% reliably)

Drift

The slow slide where a system that scored well at launch gets worse, because users, documents, models or the right answers all moved.

Default: Pin dated model snapshots; daily 100-item regression run; weekly full golden set with per-slice trends; dashboards for intent mix (PSI), mean top reranker score, abstention rate, answer length and thumbs-down; index freshness and canary-query probes every 5–15 min; golden items carry an as_of date and are reviewed quarterly.

PSI alarm: > 0.2 (intent or length distribution vs 30-day baseline; 0.1–0.2 = watch)

Eval-driven development

Decide what number a change should move, build the cases that measure it, then change one thing and read the difference.

Default: A golden-set of 100–300 cases in version control (JSONL), sliced by intent; graders in order of cost: schema/regex/code checks, then a binary LLM judge validated to kappa ≥0.6 on 100 human-labelled cases.

95% CI half-width, 80% pass rate: ±12.4 pts at n=40; ±5.5 at n=200; ±2.5 at n=1,000 (normal approximation, independent cases)

Offline vs online evaluation

Offline eval scores a fixed test set before release. Online eval watches real users afterwards. Offline is the gate; online is the verdict.

Default: Offline: 200–500 case golden set, paired runs, per-slice CIs, in CI.

Explicit feedback rate: 0.5–3% of turns (thumbs buttons in chat UIs; skewed toward negative experiences)

Rubric

A written scoring guide: one observable criterion per line, a small scale, and an example anchoring each score.

Default: 3–6 binary criteria per task, each with one real passing and one real failing anchor; stored in git next to the judge prompt with a version id; judge returns JSON {criterion: {critique, pass}}; re-validated on 100 human-labelled cases after every edit.

Criteria per rubric: 3–6 (beyond ~6, split into separate judges or the judge starts conflating them)

Pairwise comparison

Grade by asking which of two answers is better, rather than scoring each alone. More reliable for subjective quality — if you swap the order.

Default: Judge from a third model family, both orders, ties allowed, explicit 'length is not quality' instruction, 300–500 prompts, report win rate excluding ties with a Wilson CI, plus a verbosity check by length bucket.

Strong judge agreement with human preference: >80% (GPT-4 on MT-Bench pairs, Zheng et al. 2023; similar to human–human agreement)

Human annotation

People labelling model outputs against a rubric. The ground truth every AI judge is measured against — and the most expensive data you own.

Default: Engineers label the first 100 traces themselves (fastest way to learn the failure modes).

Labelling throughput: 20–60 items/hour (binary criteria; ~25/h for expert review of long clinical or legal outputs, 60/h for short answers)

Inter-annotator agreement

How often two graders agree beyond luck, usually Cohen's kappa. Below about 0.6, your labels — and any judge checked against them — cannot be trusted.

Default: Cohen's kappa for two graders (sklearn.metrics.cohen_kappa_score), Krippendorff's alpha for 3+ or missing labels, reported with a bootstrap 95% CI on ≥100 items, alongside judge recall on the fail class.

Minimum kappa to trust labels: ≥0.6 (substantial from 0.61) (Landis & Koch bands; ≥0.7 if the judge gates releases)

Benchmark

A public, fixed test and scoring rule — MMLU, GPQA, SWE-bench — for comparing models. A coarse filter, never a stand-in for your own test set.

Default: Shortlist with task-matched public results (independent re-runs where available), then decide on your own 200–500 case eval run through the same harness for every candidate.

GPQA Diamond size: 198 questions → ±6.4 pts at 70% (95% normal-approximation CI)

Benchmark contamination

When test questions, or close paraphrases, were in a model's training data — so the score measures memory rather than skill.

Default: A private held-out slice (20–30% of the golden set) that never goes into prompts, fine-tuning or synthetic-data seeds; a canary GUID in every eval file; MinHash dedupe (datasketch, Jaccard ≥0.8) of any training or few-shot data against eval data; time-split cases created after the candidate model's cutoff.

Score drop on a fresh parallel maths set: up to 8 points (GSM8K → GSM1k, some model families, Zhang et al. 2024)

Eval gate (CI)

A CI check that runs your evals on every prompt, model or config change and blocks the rollout if quality drops beyond the noise.

Default: GitHub Actions or GitLab CI job running promptfoo, Inspect or a pytest harness; 100-case smoke slice per PR, full 300–500 cases nightly and before release; 3 samples per case for both baseline and candidate; paired bootstrap or McNemar on the delta; block if CI lower bound < −2 points or any safety/PII deterministic check regresses; cache baseline results keyed by (prompt version, model snapshot, retriever config, judge version).

Paired vs unpaired 95% CI on a delta: ±3.6 vs ±6.4 pts (300 cases, 80% pass rate, 10% discordant pairs)

A/B test

Randomly split live users between the current version and the new one, then compare an outcome you chose in advance.

Default: User-level randomisation through a feature-flag service (GrowthBook, Statsig, LaunchDarkly + warehouse), 50/50 split, fixed 14-day horizon, one decision metric plus latency, cost and complaint guardrails, SRM check daily, CUPED where pre-period data exists.

Users per arm for a 1-pt change on a 10% rate: ≈ 14,400 (80% power, α=0.05, two-sided)

Statistical significance

Whether the difference you're looking at is bigger than the random wobble. Report confidence intervals, and pick your sample size before you run.

Default: Report every eval score as rate ± 95% CI (Wilson for rates near 0 or 1).

95% CI half-width at 80% pass: ±12.4 (n=40), ±7.8 (n=100), ±5.5 (n=200), ±2.5 (n=1,000) (normal approximation, independent cases)

Synthetic data

Inputs, labels or conversations written by a model to fill gaps. Quick to produce, trustworthy only after filtering, de-duping and human spot checks.

Default: Generator: a frontier model different from the system under test; explicit axis grid; seeds from real documents or de-identified traces; MinHash (datasketch) plus embedding-similarity dedupe; validator pass for answerability; 10% human review; tag every case source: synthetic and report its slice separately.

Keep rate after filtering: 30–60% (dedupe + validator + human sample; above 90% usually means filters are too loose)

Data flywheel

The weekly loop that turns production traces into labelled failures, new test cases and fixes — so each week of traffic makes the system better.

Default: Tracing with OpenTelemetry GenAI conventions into Langfuse, Arize Phoenix, Braintrust or LangSmith; PII redaction at capture; a saved query for thumbs-down, escalations and low judge scores; a 1–2% random sample; a 60–90 minute weekly review with a named owner; a failure taxonomy in a shared sheet; new cases committed to the golden set within the same week.

Traces read per weekly session: 50–100 (two engineers plus one domain owner, 60–90 minutes)

Red teaming

Attacking your own AI on purpose — jailbreaks, injections, data extraction, unsafe tool calls — to find the failures before anyone else does.

Default: Written threat model mapped to the OWASP LLM Top 10; 1–2 day manual red-team before launch with domain experts; garak or PyRIT plus promptfoo red-team runs in CI nightly; ASR per category judged by a validated classifier (e.g., Llama Guard 4 12B or a tuned judge); successful attacks added to a zero-tolerance safety slice in the eval gate.

Public human red-team dataset: ~39k attacks (Ganguli et al. 2022 (Anthropic))

Jailbreak

An input crafted to talk a model out of its own rules: role-play, encoded text, long fake conversations, odd suffixes.

Default: Provider moderation or Llama Guard 4 (12B) on inputs and outputs for open-ended chat; Prompt Guard 86M as a cheap pre-filter; no credentials or confidential rules in prompts; regex and entropy scanners for secrets on outputs; jailbreak suite (garak probes + public datasets + your own finds) in the nightly red-team run.

Many-shot jailbreak scaling: effectiveness rises with shot count, tested up to 256 shots (Anil et al. / Anthropic 2024)

PII redaction

Finding and masking personal data — names, emails, IDs, health details — before it reaches a model, a log or a vendor.

Default: Microsoft Presidio (regex + checksum recognisers, spaCy en_core_web_lg or a transformer NER) at the gateway and at trace capture; per-region recognisers for national IDs and phone formats; deterministic per-conversation placeholders with a short-lived encrypted vault for re-insertion; irreversible masking in logs; 30–90 day log retention; per-entity recall measured on 500 labelled samples from your traffic.

Recall target, structured IDs: ≥0.99 (email, phone, card (Luhn), IBAN via regex + checksum)

LLM gateway

One service every app calls instead of calling model providers directly: keys, routing, fallback, limits, budgets, caching, redaction and logs in one place.

Default: LiteLLM proxy (or Portkey / Envoy AI Gateway) as a stateless deployment, ≥2 replicas per region, Redis for rate-limit and budget counters, Postgres for keys and spend; model aliases per use case; virtual keys per team with monthly budgets and per-minute token limits; per-route timeouts; streaming passthrough; OpenTelemetry export with team, alias, model, prompt version and cost on every span.

Added latency budget: ≤10 ms p99 in-region (excluding redaction; measure with streaming on)

Rate limiting

Capping requests and tokens per key, customer or user per time window, so one caller cannot drink the shared quota.

Default: Token buckets in Redis (atomic Lua) at the gateway, keyed per tenant and per user, on both requests and estimated tokens; tenant ceilings summing to ≤80% of provider limits; separate queue for batch and eval traffic via the provider Batch API; honour retry-after, else exponential backoff with full jitter, max 3 retries; per-agent-task token and step budgets.

Anthropic Start tier, Sonnet-class (Oct 2026): 1,000 RPM, 2M ITPM, 400k OTPM (per model class; higher tiers raise all three)

Model fallback & routing

Routing to a backup model or provider when the primary errors out, times out or is overloaded. Only safe if the backup passed the same evals.

Default: Fallback chains defined per alias in the gateway (LiteLLM fallbacks, Portkey configs); same model on a second provider first; per-provider circuit breakers; route-specific TTFT timeouts (e.g., 8 s chat, 30 s long documents); retry budget ≤10%; every fallback model × prompt pair in the eval gate; weekly forced-failover drill on 1% of traffic; served-model id logged on every response.

Circuit breaker open threshold: ~20% errors over 30 s, or 5 consecutive failures (per provider × model; half-open probe every 30 s)

Prompt versioning

Treating prompts as numbered, unchangeable bundles pinned to a model snapshot and logged on every call, so any output traces back to what produced it.

Default: Prompt bundle (template, few-shots, tool schemas, output schema, pinned model snapshot, retrieval params) in git or a registry (Langfuse prompt management, Braintrust); content hash as version id; labels production / canary resolved at runtime with a short TTL cache; every change through the eval gate; version hash on every trace span.

Rollback time with label-based release: < 1 minute (label move + runtime cache TTL of 30–60 s)

Cost per query

What it really costs to answer one request: input, cache writes and reads, output, hidden reasoning, retrieval, reranking, tool calls and retries.

Default: Gateway logs per call: input, cache-write, cache-read, output and reasoning tokens, model, and computed cost; dashboards of p50/p95 cost per query and per successful task by route; prompt caching on stable prefixes; thinking budgets set per route from evals; max_tokens set; reranker to top 5; Batch API for offline jobs.

Cache multipliers (Anthropic): write 1.25× (5 min) or 2× (1 h); read 0.1× base input (Oct 2026 pricing docs)

Model deprecation & upgrades

A provider retiring a model on a set date. Every prompt, eval and fallback that depends on it needs migrating and re-checking before requests start failing.

Default: Pinned snapshots in prompt bundles; a deprecation calendar fed by provider deprecation pages and email notices; a gateway query listing usage by snapshot; a standing migration checklist: gate → prompt fix → judge re-validation → shadow → canary → cut-over, finishing ≥3 weeks before retirement; quarterly capacity reserved for migrations; open-weights fallback for routes that cannot tolerate forced changes.

Anthropic notice before retirement: ≥60 days (publicly released models, per Anthropic's deprecation policy (Oct 2026))

Calibration

Whether stated confidence means anything: of the answers given 80% confidence, about 80% should be right.

Default: Confidence signal = agreement across 3–5 samples and/or a verifier score (not verbalised confidence); isotonic regression (sklearn IsotonicRegression) fitted on 500–1,000 labelled production examples; reliability diagram and ECE with 10 bins in the eval report; thresholds chosen from the coverage–accuracy curve and the cost ratio of errors to reviews; recalibration in the eval gate on every model or prompt change.

Labelled examples for a stable 10-bin ECE: ~1,000 (500 minimum) (fewer leaves bins with too few points)

Idempotency

Doing something twice leaves things exactly as doing it once. This is the property that makes retries safe.

Default: Caller-minted Idempotency-Key (UUIDv7) on every mutating API; Postgres table idempotency_keys(account_id, key, request_hash, response, created_at) with a unique index on (account_id, key), written in the same transaction as the side effect; 24 h retention for synchronous APIs, retention ≥ queue retention for consumers.

Stripe idempotency-key retention: 24 hours (keys can be pruned after that; a retry later is treated as new)

Backpressure

How a busy system tells its callers to slow down — bounded queues and honest 429s, instead of buffering until everything falls over at once.

Default: Gateway token bucket per provider at 90% of the published TPM/RPM limit; bounded queue per dependency (size = Little's-law concurrency × 1.5); max queue wait 10 s for interactive, minutes for batch; 429 + Retry-After on overflow; priority classes interactive > batch > eval; deadlines propagated via request headers.

Latency multiplier at 90% utilisation: 10× service time (M/M/1 approximation; real tails are worse with bursty LLM traffic)

Dead-letter queue (DLQ)

A parking spot for messages your workers keep failing on, so one bad item stops blocking everything behind it.

Default: SQS redrive policy with maxReceiveCount=4, DLQ retention 14 days (source 4 days), CloudWatch alarm on ApproximateNumberOfMessagesVisible >0 for customer-facing queues; for Kafka, a <topic>.dlq topic with error/attempt/offset headers; error classifier that sends schema/validation errors straight to the DLQ.

maxReceiveCount: 3–5 (with exponential backoff between attempts; higher only for known-transient dependencies)

Exponential backoff

Wait longer after each failed retry — 1s, 2s, 4s — plus a little randomness, so a struggling service isn't hammered by everyone at once.

Default: Full jitter, base 1 s, cap 30 s, max 4 retries, bounded by the request deadline; honour Retry-After; retry at the SDK layer only (disable UI and gateway retries); circuit breaker opens after 50% errors over 20 requests; retry budget 10% of requests.

Calls from layered retries: 3 × 3 × 3 = 27 (three layers each retrying 3 times for one user action)

Blue-green deployment

Run the new version beside the old one, check it on real infrastructure, switch all traffic at once, and keep the old one warm for an instant rollback.

Default: Switch via load-balancer target groups (ALB weighted), Kubernetes Service selector, Argo Rollouts blueGreen strategy, or an Elasticsearch/OpenSearch/Qdrant alias; dual-write during overlap; automated smoke + golden-set check before flip; blue kept warm 24 h for stateless, 7 days for indexes.

Infra during overlap: 2× serving cost (both colours at full capacity; vector indexes also 2× storage)

Dual-write

Writing the same change into two stores. Done the obvious way it drifts apart; the outbox pattern plus change data capture makes it stick.

Default: Postgres transactional outbox; Debezium Postgres connector (pgoutput) → Kafka topic keyed by entity id; idempotent upsert consumer with version check (WHERE incoming_version > stored_version); nightly reconciliation by content hash; outbox rows deleted after 7 days.

Typical CDC end-to-end lag: 1–5 s (Debezium + Kafka at moderate load, excluding embedding time)

Shadow traffic

Send a copy of real requests to the new version, show nobody the results, and compare outputs, latency and cost before risking live traffic.

Default: Gateway-level async mirror at 5% (Envoy/Istio mirrorPercentage or app fork), separate API key and concurrency pool, side-effecting tools stubbed with recorded responses, outputs logged with the primary's to a comparison table, nightly pairwise judge run with position randomisation, 7–14 day window.

Sample rate: 1–10% (enough for ≥1,000 paired comparisons per key intent)

Canary & ramped rollout

Release to a small slice of real traffic first — 1%, then 5%, then 25% — compare against the old version, and roll back if anything gets worse.

Default: Flag-driven split by hashed user/tenant id; concurrent control slice of equal size; steps 1/5/25/50/100; gates on 5xx, p95 latency, refusal rate, citation validity and thumbs-down; automated rollback (Argo Rollouts/Flagger analysis or flag guardrails); bake ≥1 h at 1–5%, ≥24 h before 100% for prompt or model changes.

Samples at 1% of 50k req/day: 500/day (detects a 5xx spike; cannot detect a 0.2% quality regression)

Feature flag

A switch outside the code that turns a path, model or prompt on or off — per user, per customer, per percentage — with no redeploy.

Default: LaunchDarkly, Unleash, Flagsmith or Statsig behind the OpenFeature SDK; local evaluation with streamed rules; safe default coded for every flag; separate flags for model id, prompt version and tool enablement; bucketing by tenant id for B2B; 90-day expiry lint on release flags; flag changes logged to the audit trail.

Flag evaluation latency: <1 ms (local) (SDK evaluates cached rules in-process; remote evaluation adds a network hop)

Index alias

A nickname that points at a real index, so you can build a new one and repoint every reader in a single step.

Default: Read alias + write alias per logical index; physical names encode embedding model, dimension, chunker and version; swaps via Elasticsearch/OpenSearch _aliases or Qdrant change_aliases; config-row emulation for pgvector; old index retained 7 days then deleted by a scheduled job.

Alias swap time: <1 s (single atomic cluster-state update in Elasticsearch/OpenSearch)

Compaction & soft delete

The background tidy-up that rewrites an index without its deleted entries, winning back space and speed.

Default: Leave engine optimizers on (Qdrant deleted_threshold 0.2, Milvus auto-compaction, Elasticsearch tiered merge); per-table autovacuum tuning for pgvector (vacuum_scale_factor 0.02–0.05); heavy force-merge or REINDEX only off-peak and only on cold indexes; rebuild + alias swap when weekly churn >30%.

Qdrant vacuum trigger: 20% deleted (default optimizer `deleted_threshold` per segment)

Observability & traces

Being able to work out why production did something, without shipping new code to find out.

Default: OpenTelemetry SDK with GenAI semantic conventions (pinned version); OTLP to Langfuse, Phoenix, Honeycomb or Datadog; spans for retrieval, rerank, generation, each tool; attributes for model, prompt version, tokens, cost, tenant id; content capture redacted, 100% of errors and negative feedback + 5% sample; content retention 30 days, metrics 13 months.

Content capture rate: 100% errors/negative feedback, 5–10% otherwise (keeps storage and PII exposure bounded)

TTL & cache invalidation

Time to live: how long a stored or cached item stays valid. Too long serves stale answers; too short throws the savings away.

Default: Redis with SET key value EX <ttl> and ±10% jitter; cache keys include corpus/prompt version; CDC-driven invalidation by tag; single-flight on misses; DynamoDB TTL with an expires_at filter in reads; retention TTLs enforced in the store (S3 lifecycle rules, index ILM).

Anthropic prompt cache TTL: 5 min default, 1 h option (1-hour writes cost 2× base input vs 1.25× for 5-minute; reads 0.1×)

Reconciliation job

A scheduled audit comparing the source of truth with everything derived from it — index, cache, permissions — and repairing the gaps.

Default: Nightly job (Temporal workflow or Kubernetes CronJob) comparing registry vs index on (doc_id, content_hash, acl_hash, model_version); 1,024 hash buckets; repairs enqueued to the normal ingestion queue at a capped rate; delete circuit breaker at 1% of corpus; ACL-only sync every 15 minutes for permissioned sources; report emitted as metrics.

Delete circuit breaker: abort if >1% would be deleted (guards against empty or truncated source reads)

Graceful degradation & load shedding

When a dependency dies, serve something smaller but still useful — a lighter model, a cached answer, the sources alone — instead of an error page.

Default: Ladder defined per feature in config; circuit breaker per provider (open at 50% errors over 20 calls or p95 >2× SLO); fallback provider through an LLM gateway (LiteLLM, Portkey, or in-house); 1–5% of traffic routed to the fallback continuously to keep it warm and evaluated; rung recorded on traces; user-visible degraded banner.

Keep-warm traffic to fallback: 1–5% (proves the fallback works and keeps its eval current)

Postmortem

The blameless write-up after an incident: timeline, impact, causes, what went well, and owned actions with dates.

Default: Shared template (summary, impact, timeline, contributing factors, went well, actions); triggers written into the on-call policy; draft within 5 business days; review meeting; actions as tickets with P0/P1/P2 and owners; monthly audit of open actions; quality incidents (wrong answers) count as incidents.

Draft deadline: ≤5 business days (memory and logs fade fast)