Skip to main content

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​

ProblemPlatform capability
Ad-hoc agent scriptsRegistered agent definitions with versioning
Tool sprawlCentral catalog with auth and schema
Runaway autonomyStep budget, token cap, timeout
Non-deterministic failuresDurable checkpoints; replay
ComplianceAudit every tool invocation
Human oversightHITL queues for high-risk actions
Multi-team reuseShared tools; tenant isolation
Quality regressionEval 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}/runs with 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.
AssumptionImplication
LLM is unreliable plannerValidate tool args; retry with bounds
Tools have side effectsIdempotency keys mandatory for mutators
Humans retain overrideKill switch per run and global
Eval sets exist per agentNo promotion without benchmark pass
Tenants isolatedSeparate tool creds and memory namespaces

5. Essential Terminology​

TermDefinition
Agent loopReason → tool select → execute → observe cycle
Tool / function callingStructured LLM output invoking API
ReActInterleaved reasoning and acting
Plan-and-executePlan phase then execution phase
MCPModel Context Protocol for tool servers
HITLHuman-in-the-loop approval gate
Durable executionWorkflow survives worker crash
CheckpointPersisted run state for resume
Tool gatewayPolicy-enforced tool invocation layer
Blast radiusMax damage from single compromised run
Eval harnessAutomated quality benchmark suite
Kill switchEmergency 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 typeIdempotencyAuth
Read searchOptionalRead scope
Create ticketRequired keyWrite scoped
Refund paymentRequired + HITLFinance role
Execute SQLDeny by defaultNever 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:

  1. Working: current run messages in orchestrator state.
  2. Session: Redis TTL 24h for returning user context.
  3. Organizational: RAG over approved knowledge—see RAG Architecture.

Promotion pipeline:

  1. Dev agent version passes unit tool mocks.
  2. Eval harness: 50 golden tasks, min 90% success.
  3. Shadow mode: 5% production traffic compare.
  4. ADR + Architecture Governance sign-off.

7. Step-by-Step Walkthrough​

7.1 IT support triage agent​

  1. Employee Slack message triggers run with session_id.
  2. Agent searches KB (read tool); drafts resolution.
  3. If needs ticket: create_ticket with idempotency key from run_id+step.
  4. Ticket created; agent replies with link; run COMPLETED.

7.2 Refund agent with HITL​

  1. Customer requests $500 refund; agent proposes issue_refund.
  2. Tool gateway risk_score=high → WAITING_HUMAN.
  3. Finance analyst approves in console; tool executes.
  4. Run resumes; customer notified.

7.3 Runaway loop containment​

  1. Agent repeatedly calls search without progress; step_count=20.
  2. Orchestrator terminates FAILED; alert to owner team.
  3. Post-incident: tighten system prompt; reduce max_steps.

7.4 Worker crash mid-run​

  1. Worker dies after tool result received before checkpoint.
  2. Temporal replays from last checkpoint; tool idempotency prevents duplicate ticket.
  3. Run completes without user-visible duplicate.

7.5 Compliance audit export​

  1. Regulator requests all agent actions affecting customer PII in 90-day window.
  2. Query trace backend: service.name=tool-gateway AND tool.name IN (...) with tenant_id filter.
  3. Join HITL approval records with trace span_id correlation.
  4. Redact prompt content; include tool args hash and approver identity.
  5. Principal: audit architecture designed before audit request—not ad hoc log grep.

7A. Safety Property Checklist​

PropertyEnforcement layer
Max stepsOrchestrator counter
Tool allowlistRegistry per agent version
Idempotent writesTool gateway dedup store
HITL for T3 toolsPolicy engine risk score
Kill switchControl API + gateway budget revoke
Trace completenessOTel SDK mandatory on tool path

8. Invariants and Guarantees​

PropertyTypeMechanism
Max steps enforcedSafetyCounter in orchestrator
Tool allowlistSafetyRegistry per agent version
Idempotent mutatorsSafetyIdempotency key required
HITL for high riskSafetyPolicy engine on tool gateway
Checkpoint durabilitySafetyWorkflow engine persistence
Run terminationLivenessTimeout + kill API

9. Failure Scenarios​

ScenarioMitigation
LLM hallucinates tool argsJSON schema reject; retry with error
Tool timeoutCompensating message; partial state in trace
HITL queue backlogSLA alert; auto-reject after 24h policy
MCP server compromiseTool signing; network policy; catalog review
Memory poisoningTenant-scoped retrieval; source citations
Duplicate run submitIdempotent run creation key
Eval regression on deployAutomated rollback of agent version
Global LLM outageQueue runs; degrade to template responses

10. Performance Characteristics​

5K concurrent runs
Orchestrator schedule: &lt;200 ms p99
Typical run: 5-15 LLM calls × 2-10s each = 30s-3min wall clock
Tool gateway overhead: &lt;50 ms p99 excluding backend
Checkpoint write: async every step—&lt;10 ms
HITL wait: human minutes-hours—exclude from automation SLO
Token cost dominates—gateway budgets per run_id header

11. Scalability Limits​

LimitMitigation
Orchestrator history sizePrune old runs; archive to warehouse
Concurrent LLM callsQueue per tenant; priority tiers
Tool gateway QPSPool connections; bulkhead per tool
MCP server fanoutCache tool schemas; health checks
Trace volumeSample low-risk runs; full trace for HITL
Registry complexityNamespace 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​

SystemPattern
Temporal + custom agentsDurable workflows at scale
LangGraph PlatformState graph orchestration
Microsoft Copilot StudioEnterprise agent builder
Salesforce AgentforceCRM-integrated agents
Internal platformsCustom tool gateway + registry

16. Alternatives and Tradeoffs​

DecisionTradeoff
ReAct vs plan-and-executeFlexibility vs predictability
MCP vs bespoke toolsStandardization vs control
Sync vs async runsUX vs scale for long tasks
Strong HITL vs autonomySafety vs throughput
Multi-agent vs singleModularity vs coordination cost
Build vs buy orchestratorTime vs customization

17. Common Misconceptions​

MisconceptionReality
"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​

  1. Design enterprise agent platform. — Signals: orchestrator, tool gateway, HITL, eval. Red flags: script calling OpenAI.
  2. ReAct vs plan-and-execute? — Signals: use case fit. Follow-up: token cost.
  3. Tool idempotency why? — Signals: retry, replay. Red flags: ignore.
  4. HITL design for refunds? — Signals: risk score, queue, audit.
  5. MCP vs internal tools? — Signals: standardization, supply chain.
  6. Prevent infinite agent loop? — Signals: max steps, timeout, kill API.
  7. Durable execution need? — Signals: worker crash, replay. Red flags: in-memory only.
  8. Blast radius analysis? — Signals: tool privilege tiers.
  9. Multi-agent when? — Signals: specialization vs overhead.
  10. Prompt injection mitigation? — Signals: content boundaries, tool policy.
  11. Eval before production? — Signals: golden tasks, shadow mode.
  12. Cost control per run? — Signals: LLM gateway session budget.

22. Interview Follow-Ups​

  1. Tool returns 10MB JSON. — Truncate/summarize; schema max size.
  2. Two agents deadlock waiting each other. — Supervisor timeout; no circular delegation.
  3. 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:

StepAction
1–2Goal → model reasoning via gateway
3–4Tools only through policy gateway
StatePersist run; audit every tool

Production stack​

LayerChoiceRole
OrchestratorWorkflow / agent runtimeSteps, retries
LLMCentral gatewayQuotas, models
Tool GWAllowlist + schemasBlast radius
MemoryVector + KVSession
EvalOffline + onlineQuality
HumanApproval gatesHigh risk tools

API + schema​

POST /v1/agent/runs { goal, tools_allowed[] }
POST /v1/tools/{name}/invoke # via gateway only
GET /v1/agent/runs/{id}
EntityFields
runid, state, steps[], cost
tool_specname, json_schema, risk_tier
invocationrun_id, args_hash, result, policy

Happy-path sequence​

Failure — unsafe tool​

Observability + SLO​

SLIIdea
Task successEval harness
Cost / runCaps
Tool deny ratePolicy tuning
Unsafe attemptSec alert

22B. Game Day Playbooks​

Catalog​

IDDrillInjectSignal
GD-1Prompt injectionMalicious ticketTool deny
GD-2Tool runawayLoop invokesStep/budget cap
GD-3LLM outageGateway 503Degrade / queue
GD-4Schema driftBad tool argsValidation fail
GD-5Privilege escapeCross-tenant toolAuthz block
GD-6Human-gate bypassAttempt auto-approveImpossible

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.

PRACTICE interview answer map for tool gateway for 100 tools

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​

RequirementDesign
Scale to ~100 tools without chaosCentral registry + typed adapters
No silent privilege escalationPer-tool SA / scoped tokens; never shared god role
Safe under prompt injectionAllowlist + arg schema + egress allowlist
Mutating calls safe to retryIdempotency keys on writes
High-risk actions gatedHITL for money / PII / admin / irreversible
Debuggable / auditableOTel spans; redacted arg hashes
Kill switchDisable 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)​

AssumptionWhy it matters
Agents use ReAct / tool-calling LLMModel proposes; gateway decides
Mix of HTTP APIs, DBs, email, maybe code execDifferent sandboxes / adapters
At-least-once orchestration retriesIdempotency mandatory on mutators
Untrusted content in promptsInjection is the default adversary
MCP optional for some toolsStill 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)​

Tool gateway topology for 100 tools

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

Registry risk tiers and failure modes

Figure C: Each tool has schema + risk tier; L3 needs HITL; defend injection, confused deputy, secrets, schema drift.

Catalog fieldWhy
name, versionStable identity; pin per agent release
JSON Schema for argsReject garbage / injection-shaped payloads
Risk tier L1/L2/L3Auto vs limited vs HITL
Auth scope / SALeast privilege
Timeout, retry, idempotent?Reliability contract
Egress allowlistNo arbitrary SSRF
Owner + on-callOperations

Risk tiers (example):

TierExamplesControls
L1 readsearch docs, get order statusAllowlist, rate limit, cache
L2 mutateupdate ticket, send emailIdempotency, quotas, audit
L3 highrefund, delete user, prod deployHITL, dual control, stricter authz

I — Invariants (safety)​

"Non-negotiable:

  1. No tool call bypasses the gateway—including 'internal' HTTP.
  2. Per-agent allowlist from registry version—not 'all 100 tools.'
  3. Schema validation before execution.
  4. Mutators require idempotency keys (e.g. run_id + tool + fingerprint).
  5. L3 → HITL before side effect.
  6. Secrets stay in vault—gateway injects creds; model never sees raw keys.
  7. Every invocation audited with tenant/agent/tool/decision."

C — Constraints (second C)​

ConstraintDesign response
Prompt injection → tool abuseAllowlist + schema + output size limits; never concatenate untrusted into system policy
Confused deputyPer-tool SA; pass user/tenant context into authz
MCP supply chainSigned manifests; catalog review; network policy
Schema driftVersion tools; contract tests in CI
Runaway loopsmax_steps, per-tool rate limits, global kill switch
Multi-tenant leakageTenant on every authz check; no cross-tenant tool memory

E — Evolution (prove it)​

Phased delivery:

PhaseDeliverable
M1Gateway + registry MVP; migrate tools behind facade
M2Risk tiers + HITL for L3; idempotency store
M3OTel audit; rate limits; circuit breakers
M4MCP registration via signed catalog (optional)
M5Eval suite: injection corpus + refund/tool abuse cases
M6Chaos: kill switch, deny-by-default new tools

Failure modes:

FailureMitigation
LangChain functions in-processForce gateway
One shared cloud rolePer-tool SA
"MCP is secure enough"Gateway policy still required
Retry doubles refundIdempotency
Unclassified destructive toolDefault 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​

StrongWeak / red flag
Gateway as sole path + registry"LangChain Python functions as tools"
Risk tiers + HITLNo blast-radius thinking
Schema + allowlist + idempotencyTrust model output
Per-tool least privilegeShared god credentials
Audit + kill switchNo 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​

  1. Build minimal orchestrator loop with max_steps=5.
  2. Tool gateway with JSON schema validation and idempotency store.
  3. Integrate LLM gateway for completions with tool calling.
  4. Simulate worker crash; verify replay does not duplicate write.
  5. Extension: HITL webhook approval flow.
  6. Extension: Eval harness with 10 golden tasks and pass threshold.

26. Knowledge Check​

  1. Agent loop steps?
  2. Why checkpoint after each tool call?
  3. MCP purpose?
  4. HITL trigger examples?
  5. Idempotency key source for tool?
  6. Kill switch scope options?
  7. ReAct weakness?
  8. Memory tier differences?
  9. Eval shadow mode?
  10. Tool gateway vs LLM gateway boundary?
  11. Blast radius document contents?
  12. When deny SQL tool entirely?

26A. Extended Knowledge Check​

  1. What span attributes prove HITL approval occurred?
  2. How does Temporal replay interact with idempotent tools?
  3. When is multi-agent architecture justified over single agent?
  4. What kills an upstream LLM stream on run cancel?
  5. Eval shadow mode purpose before full promotion?
  6. MCP supply chain risk mitigations?

27. Flashcards​

FrontBack
Agent loopReason, tool, observe cycle
Tool gatewayPolicy-enforced tool execution
HITLHuman approval for risky actions
CheckpointDurable run state snapshot
MCPStandard tool server protocol
max_stepsLoop iteration cap
Idempotency keyPrevents duplicate side effects
Eval harnessQuality gate for promotion
Kill switchEmergency run termination
ReActInterleaved reasoning acting
Blast radiusMax damage from one run
TemporalDurable 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​

TierExamplesControls
T0 ReadSearch KB, get order statusSchema validate; rate limit
T1 Low writeCreate draft ticketIdempotency key
T2 Medium writeUpdate customer profileHITL if PII change
T3 High writeIssue refund, delete resourceMandatory HITL + dual approval
T4 ForbiddenRaw SQL, shell exec on prodDeny at gateway

Principal whiteboard: draw tier table before any agent diagram—interviewers weight governance over clever prompts.

Durable execution comparison​

EngineStrengthAgent fit
TemporalLong-running, saga, visibilityProduction default for mutating agents
LangGraphLLM-native state graphsRapid prototyping; verify durability
Step FunctionsAWS-nativeLimited loop complexity
In-memory loopSimpleUnacceptable 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​

PatternWhenRisk
SupervisorSpecialist agents per domainSupervisor bottleneck
Peer handoffSequential expertiseContext loss between agents
Parallel fan-outIndependent subtasksMerge 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.

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.