Agentic AI Platform Design
1. Executive Summary
An agentic AI platform enables organizations to build, deploy, and govern autonomous LLM workflows that plan, invoke tools, maintain state, and complete multi-step tasks within explicit policy bounds. Unlike a single chat endpoint, agent platforms provide orchestration runtimes (state machines, durable workflows), tool registries with schema validation and least-privilege credentials, memory tiers (session, episodic, organizational knowledge), human-in-the-loop (HITL) escalation, and observability with per-step traces.
Principal architects design agent platforms as distributed control systems: bounded loops, idempotent tools, blast-radius limits, and kill switches—not "GPT with plugins." This chapter extends Agent Platform Architecture with enterprise system-design depth: multi-tenant platform serving 200+ agent definitions, 5K concurrent runs, integration with LLM Gateway for model access, and eval-gated promotion to production.
Safety: agents cannot invoke destructive tools without policy match and optional human approval. Liveness: every run terminates, escalates, or hits wall-clock timeout—no infinite loops.
2. Why This Topic Matters
Agent failures are action failures, not slow pages:
- Unbounded tool loops rack up inference cost and corrupt data.
- Over-privileged tools let compromised prompts drop databases.
- Non-idempotent tools double-charge or duplicate tickets on retry.
- Missing traces make agent incidents undebuggable.
2025–2026 principal interviews probe ReAct vs plan-and-execute, Model Context Protocol (MCP) standardization, durable execution with Temporal, and organizational governance. Candidates who only demo LangChain notebooks without blast-radius analysis fail senior bars.
3. Problems Being Solved
| Problem | Platform capability |
|---|---|
| Ad-hoc agent scripts | Registered agent definitions with versioning |
| Tool sprawl | Central catalog with auth and schema |
| Runaway autonomy | Step budget, token cap, timeout |
| Non-deterministic failures | Durable checkpoints; replay |
| Compliance | Audit every tool invocation |
| Human oversight | HITL queues for high-risk actions |
| Multi-team reuse | Shared tools; tenant isolation |
| Quality regression | Eval harness before promotion |
4. Assumptions and System Model
Functional
- Register agent: system prompt, tool allowlist, max_steps=20, timeout=10m.
- Execute run:
POST /agents/{id}/runswith input + optional session_id. - Tool gateway validates JSON schema; executes with service credentials.
- HITL: pause run when tool risk_score > threshold; resume on approval.
- Memory: session context in Redis; long-term in vector store (optional).
- MCP servers register as tool providers.
Non-functional
- Orchestrator availability 99.9%.
- P99 scheduling latency < 200 ms (excluding LLM/tool time).
- 5K concurrent runs; horizontal worker scale.
- Trace completeness: 100% of tool calls span-exported.
| Assumption | Implication |
|---|---|
| LLM is unreliable planner | Validate tool args; retry with bounds |
| Tools have side effects | Idempotency keys mandatory for mutators |
| Humans retain override | Kill switch per run and global |
| Eval sets exist per agent | No promotion without benchmark pass |
| Tenants isolated | Separate tool creds and memory namespaces |
5. Essential Terminology
| Term | Definition |
|---|---|
| Agent loop | Reason → tool select → execute → observe cycle |
| Tool / function calling | Structured LLM output invoking API |
| ReAct | Interleaved reasoning and acting |
| Plan-and-execute | Plan phase then execution phase |
| MCP | Model Context Protocol for tool servers |
| HITL | Human-in-the-loop approval gate |
| Durable execution | Workflow survives worker crash |
| Checkpoint | Persisted run state for resume |
| Tool gateway | Policy-enforced tool invocation layer |
| Blast radius | Max damage from single compromised run |
| Eval harness | Automated quality benchmark suite |
| Kill switch | Emergency run termination API |
6. Core Mechanism
6.1 Platform architecture
Figure 1: Agent platform—orchestrator coordinates LLM and tool gateway; registry and eval gate promotions.
6.2 Agent run loop
Figure 2: Single loop iteration with optional HITL gate on risky tools.
6.3 Run state machine
Figure 3: Durable run states—checkpoints survive worker restarts.
6.4 Deep dives
Tool design standards:
| Tool type | Idempotency | Auth |
|---|---|---|
| Read search | Optional | Read scope |
| Create ticket | Required key | Write scoped |
| Refund payment | Required + HITL | Finance role |
| Execute SQL | Deny by default | Never raw SQL agent |
Orchestration patterns:
- ReAct: flexible; higher token cost; good for exploratory tasks.
- Plan-and-execute: plan JSON validated before tools; better for SOP-following.
- Supervisor multi-agent: router delegates to specialist agents—adds coordination overhead.
Memory tiers:
- Working: current run messages in orchestrator state.
- Session: Redis TTL 24h for returning user context.
- Organizational: RAG over approved knowledge—see RAG Architecture.
Promotion pipeline:
- Dev agent version passes unit tool mocks.
- Eval harness: 50 golden tasks, min 90% success.
- Shadow mode: 5% production traffic compare.
- ADR + Architecture Governance sign-off.
7. Step-by-Step Walkthrough
7.1 IT support triage agent
- Employee Slack message triggers run with
session_id. - Agent searches KB (read tool); drafts resolution.
- If needs ticket:
create_ticketwith idempotency key from run_id+step. - Ticket created; agent replies with link; run COMPLETED.
7.2 Refund agent with HITL
- Customer requests $500 refund; agent proposes
issue_refund. - Tool gateway risk_score=high → WAITING_HUMAN.
- Finance analyst approves in console; tool executes.
- Run resumes; customer notified.
7.3 Runaway loop containment
- Agent repeatedly calls search without progress; step_count=20.
- Orchestrator terminates FAILED; alert to owner team.
- Post-incident: tighten system prompt; reduce max_steps.
7.4 Worker crash mid-run
- Worker dies after tool result received before checkpoint.
- Temporal replays from last checkpoint; tool idempotency prevents duplicate ticket.
- Run completes without user-visible duplicate.
7.5 Compliance audit export
- Regulator requests all agent actions affecting customer PII in 90-day window.
- Query trace backend:
service.name=tool-gateway AND tool.name IN (...)withtenant_idfilter. - Join HITL approval records with trace
span_idcorrelation. - Redact prompt content; include tool args hash and approver identity.
- Principal: audit architecture designed before audit request—not ad hoc log grep.
7A. Safety Property Checklist
| Property | Enforcement layer |
|---|---|
| Max steps | Orchestrator counter |
| Tool allowlist | Registry per agent version |
| Idempotent writes | Tool gateway dedup store |
| HITL for T3 tools | Policy engine risk score |
| Kill switch | Control API + gateway budget revoke |
| Trace completeness | OTel SDK mandatory on tool path |
8. Invariants and Guarantees
| Property | Type | Mechanism |
|---|---|---|
| Max steps enforced | Safety | Counter in orchestrator |
| Tool allowlist | Safety | Registry per agent version |
| Idempotent mutators | Safety | Idempotency key required |
| HITL for high risk | Safety | Policy engine on tool gateway |
| Checkpoint durability | Safety | Workflow engine persistence |
| Run termination | Liveness | Timeout + kill API |
9. Failure Scenarios
| Scenario | Mitigation |
|---|---|
| LLM hallucinates tool args | JSON schema reject; retry with error |
| Tool timeout | Compensating message; partial state in trace |
| HITL queue backlog | SLA alert; auto-reject after 24h policy |
| MCP server compromise | Tool signing; network policy; catalog review |
| Memory poisoning | Tenant-scoped retrieval; source citations |
| Duplicate run submit | Idempotent run creation key |
| Eval regression on deploy | Automated rollback of agent version |
| Global LLM outage | Queue runs; degrade to template responses |
10. Performance Characteristics
5K concurrent runs
Orchestrator schedule: <200 ms p99
Typical run: 5-15 LLM calls × 2-10s each = 30s-3min wall clock
Tool gateway overhead: <50 ms p99 excluding backend
Checkpoint write: async every step—<10 ms
HITL wait: human minutes-hours—exclude from automation SLO
Token cost dominates—gateway budgets per run_id header
11. Scalability Limits
| Limit | Mitigation |
|---|---|
| Orchestrator history size | Prune old runs; archive to warehouse |
| Concurrent LLM calls | Queue per tenant; priority tiers |
| Tool gateway QPS | Pool connections; bulkhead per tool |
| MCP server fanout | Cache tool schemas; health checks |
| Trace volume | Sample low-risk runs; full trace for HITL |
| Registry complexity | Namespace per business unit |
12. Operational Considerations
- SLO: 99.9% orchestrator; agent success rate per eval baseline.
- Dashboards: runs/hour, step distribution, HITL queue depth, tool error rate.
- Runbooks: kill all runs for agent version; rotate MCP credentials.
- Weekly eval regression on production sample (shadow scoring).
- On-call: P1 if destructive tool without HITL; P2 orchestrator backlog.
13. Security Considerations
- Tool credentials via Secrets Management Platform—never in prompts.
- Prompt injection defense: separate instructions from untrusted content markers.
- Sandboxed code execution isolated VMs if code tool enabled.
- MCP supply chain: signed server bundles; allowlist registry.
- Audit immutable: who approved HITL, what tool args.
- Align with Agent Governance and Safety.
14. Cost Considerations
Token spend often 10–100× traditional API costs for agent runs. Platform must surface cost per run in UI. Cheaper models for planning, expensive for final synthesis—router integration with LLM gateway. Durable execution storage (Temporal) has retention cost—TTL policies.
15. Production Implementations
| System | Pattern |
|---|---|
| Temporal + custom agents | Durable workflows at scale |
| LangGraph Platform | State graph orchestration |
| Microsoft Copilot Studio | Enterprise agent builder |
| Salesforce Agentforce | CRM-integrated agents |
| Internal platforms | Custom tool gateway + registry |
16. Alternatives and Tradeoffs
| Decision | Tradeoff |
|---|---|
| ReAct vs plan-and-execute | Flexibility vs predictability |
| MCP vs bespoke tools | Standardization vs control |
| Sync vs async runs | UX vs scale for long tasks |
| Strong HITL vs autonomy | Safety vs throughput |
| Multi-agent vs single | Modularity vs coordination cost |
| Build vs buy orchestrator | Time vs customization |
17. Common Misconceptions
| Misconception | Reality |
|---|---|
| "Agents replace workflows" | Deterministic ETL still needs workflow engine |
| "More tools = better" | Tool confusion hurts LLM accuracy |
| "Retries are safe" | Mutators need idempotency |
| "Tracing optional" | Tool audit is compliance requirement |
| "Demo accuracy = prod ready" | Eval harness on real tasks required |
| "MCP solves security" | Still need gateway policy |
18. Principal Architect Perspective
- Tool gateway is the trust boundary—not the LLM.
- Design for failure of the planner—validate everything.
- HITL is a feature, not admission of defeat.
- Agent versioning like API versioning—rollback path required.
- Blast radius document per agent before production.
- Executive narrative: control plane investment, not chatbot feature.
19. Architecture Review Exercise
Scenario: Team gives agent direct production DB write credentials for "speed."
Review: Unbounded blast radius; prompt injection → data loss. Mandate read-only tools, stored procedures with HITL, or ticket-based human execution.
20. Whiteboard Explanation
"Applications trigger registered agents on our orchestrator—Temporal for durability. Each turn calls the LLM gateway with tool schemas. The model may emit tool calls; our tool gateway validates schema, checks allowlist, enforces idempotency on writes, and routes high-risk actions to human approval. State checkpoints every step. Runs have max steps and wall timeout. MCP servers register tools into the catalog. Eval suite gates version promotion. Every tool call is traced and audited. Kill switch stops runaway loops. Memory is tenant-scoped with optional RAG over approved docs."
21. Interview Questions
- Design enterprise agent platform. — Signals: orchestrator, tool gateway, HITL, eval. Red flags: script calling OpenAI.
- ReAct vs plan-and-execute? — Signals: use case fit. Follow-up: token cost.
- Tool idempotency why? — Signals: retry, replay. Red flags: ignore.
- HITL design for refunds? — Signals: risk score, queue, audit.
- MCP vs internal tools? — Signals: standardization, supply chain.
- Prevent infinite agent loop? — Signals: max steps, timeout, kill API.
- Durable execution need? — Signals: worker crash, replay. Red flags: in-memory only.
- Blast radius analysis? — Signals: tool privilege tiers.
- Multi-agent when? — Signals: specialization vs overhead.
- Prompt injection mitigation? — Signals: content boundaries, tool policy.
- Eval before production? — Signals: golden tasks, shadow mode.
- Cost control per run? — Signals: LLM gateway session budget.
22. Interview Follow-Ups
- Tool returns 10MB JSON. — Truncate/summarize; schema max size.
- Two agents deadlock waiting each other. — Supervisor timeout; no circular delegation.
- Regulatory audit of agent decision. — Export trace + HITL approval chain.
22A. Production Low-Level Design (Interview + Game Day)
Agentic platform LLD: orchestrator + tool gateway policy facade; model calls via LLM gateway.
Context diagram
Step-by-step flow:
| Step | Action |
|---|---|
| 1–2 | Goal → model reasoning via gateway |
| 3–4 | Tools only through policy gateway |
| State | Persist run; audit every tool |
Production stack
| Layer | Choice | Role |
|---|---|---|
| Orchestrator | Workflow / agent runtime | Steps, retries |
| LLM | Central gateway | Quotas, models |
| Tool GW | Allowlist + schemas | Blast radius |
| Memory | Vector + KV | Session |
| Eval | Offline + online | Quality |
| Human | Approval gates | High risk tools |
API + schema
POST /v1/agent/runs { goal, tools_allowed[] }
POST /v1/tools/{name}/invoke # via gateway only
GET /v1/agent/runs/{id}
| Entity | Fields |
|---|---|
run | id, state, steps[], cost |
tool_spec | name, json_schema, risk_tier |
invocation | run_id, args_hash, result, policy |
Happy-path sequence
Failure — unsafe tool
Observability + SLO
| SLI | Idea |
|---|---|
| Task success | Eval harness |
| Cost / run | Caps |
| Tool deny rate | Policy tuning |
| Unsafe attempt | Sec alert |
22B. Game Day Playbooks
Catalog
| ID | Drill | Inject | Signal |
|---|---|---|---|
| GD-1 | Prompt injection | Malicious ticket | Tool deny |
| GD-2 | Tool runaway | Loop invokes | Step/budget cap |
| GD-3 | LLM outage | Gateway 503 | Degrade / queue |
| GD-4 | Schema drift | Bad tool args | Validation fail |
| GD-5 | Privilege escape | Cross-tenant tool | Authz block |
| GD-6 | Human-gate bypass | Attempt auto-approve | Impossible |
GD-1 — Prompt injection (detailed)
GD-2 — Tool runaway (detailed)
Pass criteria: spend capped; no production mutating tool without policy; traces complete.
23. Strong Answer Example
Question: "How design tool gateway for 100 tools?"
Answer this as a 45-minute design discussion using the PRACTICE framework. Below is how a strong student sounds aloud—one policy facade, not 100 free Python functions in the agent process.

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.
Student interview script (PRACTICE)
P — Problem framing
"With 100 tools, the failure mode isn't 'can the LLM call APIs?'—it's blast radius: prompt injection driving a refund tool, confused-deputy calls with the agent's cloud role, secret leakage into prompts, unbounded retries, and no audit trail.
A tool gateway is the only path from agent runtimes to backends. It owns catalog, authz, schema validation, risk tiers / HITL, timeouts, idempotency, egress, and audit. MCP servers or internal adapters register into that catalog—they don't bypass the gateway.
Short answer: Registry of 100 versioned tool descriptors → gateway enforces allowlist per agent version → policy on
agent_id + tool + args→ L1 auto / L2 limited mutate / L3 HITL → least-privilege service accounts → traces for every call."
R — Requirements
| Requirement | Design |
|---|---|
| Scale to ~100 tools without chaos | Central registry + typed adapters |
| No silent privilege escalation | Per-tool SA / scoped tokens; never shared god role |
| Safe under prompt injection | Allowlist + arg schema + egress allowlist |
| Mutating calls safe to retry | Idempotency keys on writes |
| High-risk actions gated | HITL for money / PII / admin / irreversible |
| Debuggable / auditable | OTel spans; redacted arg hashes |
| Kill switch | Disable tool or agent version instantly |
"I'd ask: which tools are read-only vs money-moving? Multi-tenant? MCP vs bespoke?"
A — Assumptions (state aloud)
| Assumption | Why it matters |
|---|---|
| Agents use ReAct / tool-calling LLM | Model proposes; gateway decides |
| Mix of HTTP APIs, DBs, email, maybe code exec | Different sandboxes / adapters |
| At-least-once orchestration retries | Idempotency mandatory on mutators |
| Untrusted content in prompts | Injection is the default adversary |
| MCP optional for some tools | Still must register through catalog |
"I'd say out loud: MCP standardizes discovery—it does not replace gateway policy."
C — Capacity
100 tools → catalog + health checks; not 100 peer meshes
QPS → rate limit per tool and per agent/tenant
Schema cache → avoid refetching MCP manifests every turn
HITL queue → human SLA; don't block all agents on one approval backlog
Timeouts → per-tool; circuit-break slow backends
"I'd keep hot read tools cheap and aggressively timeout / circuit-break flaky ones so one tool can't stall the fleet."
T — Topology (draw this)

Figure B: Agent → Tool Gateway (policy, validate, limit, audit) → Registry → adapters/MCP; vault and HITL on the side.

Figure C: Each tool has schema + risk tier; L3 needs HITL; defend injection, confused deputy, secrets, schema drift.
| Catalog field | Why |
|---|---|
name, version | Stable identity; pin per agent release |
| JSON Schema for args | Reject garbage / injection-shaped payloads |
| Risk tier L1/L2/L3 | Auto vs limited vs HITL |
| Auth scope / SA | Least privilege |
| Timeout, retry, idempotent? | Reliability contract |
| Egress allowlist | No arbitrary SSRF |
| Owner + on-call | Operations |
Risk tiers (example):
| Tier | Examples | Controls |
|---|---|---|
| L1 read | search docs, get order status | Allowlist, rate limit, cache |
| L2 mutate | update ticket, send email | Idempotency, quotas, audit |
| L3 high | refund, delete user, prod deploy | HITL, dual control, stricter authz |
I — Invariants (safety)
"Non-negotiable:
- No tool call bypasses the gateway—including 'internal' HTTP.
- Per-agent allowlist from registry version—not 'all 100 tools.'
- Schema validation before execution.
- Mutators require idempotency keys (e.g.
run_id + tool + fingerprint).- L3 → HITL before side effect.
- Secrets stay in vault—gateway injects creds; model never sees raw keys.
- Every invocation audited with tenant/agent/tool/decision."
C — Constraints (second C)
| Constraint | Design response |
|---|---|
| Prompt injection → tool abuse | Allowlist + schema + output size limits; never concatenate untrusted into system policy |
| Confused deputy | Per-tool SA; pass user/tenant context into authz |
| MCP supply chain | Signed manifests; catalog review; network policy |
| Schema drift | Version tools; contract tests in CI |
| Runaway loops | max_steps, per-tool rate limits, global kill switch |
| Multi-tenant leakage | Tenant on every authz check; no cross-tenant tool memory |
E — Evolution (prove it)
Phased delivery:
| Phase | Deliverable |
|---|---|
| M1 | Gateway + registry MVP; migrate tools behind facade |
| M2 | Risk tiers + HITL for L3; idempotency store |
| M3 | OTel audit; rate limits; circuit breakers |
| M4 | MCP registration via signed catalog (optional) |
| M5 | Eval suite: injection corpus + refund/tool abuse cases |
| M6 | Chaos: kill switch, deny-by-default new tools |
Failure modes:
| Failure | Mitigation |
|---|---|
| LangChain functions in-process | Force gateway |
| One shared cloud role | Per-tool SA |
| "MCP is secure enough" | Gateway policy still required |
| Retry doubles refund | Idempotency |
| Unclassified destructive tool | Default L3 until reviewed |
Observability: invokes/sec per tool, deny rate, HITL lag, p99 latency, error/circuit state, idempotent hits, kill-switch events.
Closing line (interview)
"So for 100 tools, I'd build a tool gateway as the sole egress: a versioned registry with JSON schemas and risk tiers, allowlists per agent, policy checks, idempotency on writes, HITL for L3, least-privilege credentials from a vault, and full audit spans. MCP can feed the catalog, but it doesn't replace the gateway. I'd prove safety with injection evals and a kill switch—not by letting the model call arbitrary Python."
Scoring signals
| Strong | Weak / red flag |
|---|---|
| Gateway as sole path + registry | "LangChain Python functions as tools" |
| Risk tiers + HITL | No blast-radius thinking |
| Schema + allowlist + idempotency | Trust model output |
| Per-tool least privilege | Shared god credentials |
| Audit + kill switch | No ops/security story |
| MCP ≠ security | "MCP solves security" |
Compact outline (if time-boxed to 2 minutes)
"Sole tool gateway. Registry of 100 versioned tools with schemas and L1/L2/L3 risk. Per-agent allowlist, policy, idempotent mutators, HITL for high risk, vault-injected creds, audit spans. MCP registers into catalog—doesn't bypass. Kill switch + injection evals."
24. Weak Answer Example
Question: "How design tool gateway for 100 tools?"
"Use LangChain agents with Python functions as tools."
Why weak / red flags: No gateway/policy boundary, no HITL/risk tiers, no idempotency, no least-privilege or audit, no kill switch—unbounded blast radius under prompt injection.
25. Hands-On Exercise
- Build minimal orchestrator loop with max_steps=5.
- Tool gateway with JSON schema validation and idempotency store.
- Integrate LLM gateway for completions with tool calling.
- Simulate worker crash; verify replay does not duplicate write.
- Extension: HITL webhook approval flow.
- Extension: Eval harness with 10 golden tasks and pass threshold.
26. Knowledge Check
- Agent loop steps?
- Why checkpoint after each tool call?
- MCP purpose?
- HITL trigger examples?
- Idempotency key source for tool?
- Kill switch scope options?
- ReAct weakness?
- Memory tier differences?
- Eval shadow mode?
- Tool gateway vs LLM gateway boundary?
- Blast radius document contents?
- When deny SQL tool entirely?
26A. Extended Knowledge Check
- What span attributes prove HITL approval occurred?
- How does Temporal replay interact with idempotent tools?
- When is multi-agent architecture justified over single agent?
- What kills an upstream LLM stream on run cancel?
- Eval shadow mode purpose before full promotion?
- MCP supply chain risk mitigations?
27. Flashcards
| Front | Back |
|---|---|
| Agent loop | Reason, tool, observe cycle |
| Tool gateway | Policy-enforced tool execution |
| HITL | Human approval for risky actions |
| Checkpoint | Durable run state snapshot |
| MCP | Standard tool server protocol |
| max_steps | Loop iteration cap |
| Idempotency key | Prevents duplicate side effects |
| Eval harness | Quality gate for promotion |
| Kill switch | Emergency run termination |
| ReAct | Interleaved reasoning acting |
| Blast radius | Max damage from one run |
| Temporal | Durable workflow engine example |
28. Cheat Sheet
COMPONENTS: registry, orchestrator, tool gateway, LLM gateway, memory, HITL
RUN: queued → running → tool/human waits → completed/failed
LIMITS: max_steps, timeout, token budget per run
TOOLS: schema validate, allowlist, idempotency on writes, risk tiers
MCP: signed catalog registration
DURABLE: checkpoint each step; replay safe
SAFETY: HITL high-risk; kill switch; audit all tools
PROMOTION: eval → shadow → ADR
OBSERVE: full trace; cost per run
NEVER: raw prod DB creds in agent
28A. Principal Interview Deep Dive
Tool risk tiering rubric
| Tier | Examples | Controls |
|---|---|---|
| T0 Read | Search KB, get order status | Schema validate; rate limit |
| T1 Low write | Create draft ticket | Idempotency key |
| T2 Medium write | Update customer profile | HITL if PII change |
| T3 High write | Issue refund, delete resource | Mandatory HITL + dual approval |
| T4 Forbidden | Raw SQL, shell exec on prod | Deny at gateway |
Principal whiteboard: draw tier table before any agent diagram—interviewers weight governance over clever prompts.
Durable execution comparison
| Engine | Strength | Agent fit |
|---|---|---|
| Temporal | Long-running, saga, visibility | Production default for mutating agents |
| LangGraph | LLM-native state graphs | Rapid prototyping; verify durability |
| Step Functions | AWS-native | Limited loop complexity |
| In-memory loop | Simple | Unacceptable for prod side effects |
Safety: Checkpoint before external side effect. Liveness: Activity timeout returns control to orchestrator for escalation.
Eval harness architecture
Golden tasks: 50+ realistic scenarios with expected tool sequence
Metrics: task success rate, wrong-tool rate, avg steps, cost per task
Regression gate: new agent version must be ≥ baseline - 2% on success
Shadow mode: run new version parallel without executing tools (dry-run trace)
Human review queue: sample 5% of prod runs for quality scoring
Connect eval failures to Architecture Governance—block promotion without green eval.
Multi-agent coordination patterns
| Pattern | When | Risk |
|---|---|---|
| Supervisor | Specialist agents per domain | Supervisor bottleneck |
| Peer handoff | Sequential expertise | Context loss between agents |
| Parallel fan-out | Independent subtasks | Merge logic complexity |
Default recommendation: single agent with curated tools until proven insufficient—multi-agent adds coordination failure modes.
Incident: agent issued 200 duplicate tickets
Contributing factors: missing idempotency on create_ticket; retry after timeout; no step budget. Corrective actions: mandatory idempotency key run_id:step; gateway dedup store; max_steps=15; postmortem links Failure Analysis Methodology.
29. Related Concepts
- Agent Platform Architecture
- Agent Governance and Safety
- LLM Gateway
- RAG Architecture
- Event-Driven Architecture
- Distributed Tracing
- Failure Analysis Methodology
19A. Extended Review Scenario
Scenario B: Agent workflow calls delete_user tool after prompt injection in support ticket body.
Review: Tool tier misclassification—destructive action without HITL. Untrusted content not sandboxed in prompt template. Fix: mark delete_user as T3 with mandatory human approval; separate system instructions from ticket content with delimiters; input classifier scores injection patterns; deny tool if confidence high. Add eval case with known injection corpus. Kill switch tested quarterly.
23A. Additional Strong Answer
Q: Compare Temporal vs in-memory LangGraph for production agents.
Outline: In-memory loses state on worker crash—unacceptable when tools mutate tickets, refunds, or infra. Temporal provides durable timers, retry policies, visibility UI, and saga compensation patterns. LangGraph excels for rapid graph iteration—can run on Temporal for production. Principal recommendation: LangGraph or equivalent for agent logic definition; Temporal (or similar) for durability when side effects exist. For read-only research agents, in-memory may suffice with session TTL. Decision ADR documents tradeoff per agent risk tier.
28B. Extended BOE Walkthrough (Interview Script)
Interviewer: "Build agent platform for IT support automation."
Strong candidate:
"IT support is good fit with HITL for destructive actions—not autonomous prod shell.
Orchestrator: Temporal for durable runs—checkpoint each tool call. Max 20 steps, 10-minute wall timeout, kill switch API.
Tool gateway: schema validate, idempotency on create_ticket, risk tier T3 for account deletion → human approval queue.
LLM via LLM Gateway with per-run token budget.
Tools: read KB, search tickets, create ticket—no raw database credentials.
MCP servers register in signed catalog—supply chain reviewed.
Eval: 50 golden tickets; 90% success gate before promotion; shadow mode 5% traffic.
Traces: span per tool with redacted args hash—audit for compliance.
Memory: session Redis 24h; RAG over approved KB only—prompt injection boundaries in template.
Blast radius doc required before prod—principal signs off with security."
30. References
- Model Context Protocol specification — tool connectivity standard.
- Temporal documentation — durable workflow execution (implementation).
- ReAct paper (Yao et al.) — reasoning and acting interleaving (research).
- OWASP LLM Top 10 — agent and tool risks.
- NIST AI RMF — organizational governance framing.
Distinction: Academic agent loop patterns describe behavior; production safety properties require platform enforcement layers not present in research prototypes.
30A. Further reading paths
Essential: Agent Governance and Safety, Event-Driven Architecture for async tool results, Transactional Outbox if tools trigger domain events. Build a one-page blast-radius doc template for agent definitions—interviewers reward governance artifacts alongside architecture diagrams.
Lab: Simulate runaway loop hitting max_steps; verify kill switch terminates upstream LLM stream. Interview drill: design tool gateway policy for issue_refund—risk tier, HITL queue, idempotency key schema, audit span attributes, and FinOps cost attribution in one coherent narrative.