AWS Builder Center

Your Agents Aren't Microservices: A Framework for Peak-Hour Deployments of Agentic Systems

How to safely update your agentic AI systems in production without disrupting active users. This post explains what framework to follow when considering peak hour deployments.

You've built the agent. It reasons, it calls tools, it orchestrates sub-agents, it delivers value. Now your PM asks: "Can we push the updated prompt to production today? We have a customer demo at 2 PM."
And suddenly you realize — you have no idea how to do this without potentially breaking the 47 active conversations running through the system right now.
If your instinct is "just do a blue/green deployment," I have bad news. The patterns that work beautifully for stateless microservices fall apart the moment your deployment unit includes an LLM runtime, a prompt, a session store, three MCP servers, and a knowledge base — some of which your team owns, some belong to another team, and some are third-party subscriptions. I watched a team take down their customer-facing agent for 20 minutes because they updated a prompt that assumed a tool response schema that the MCP team hadn't shipped yet. The prompt went green. The tool was still blue. Chaos.
Here's a framework for thinking about it — born from those failures.

The Core Problem: What Exactly Are You Deploying?

An agent isn't a single binary. It's a constellation of components spanning three layers:
Ingress — The request lands here. API Gateway or ALB routing, session affinity rules, authentication, rate limiting. This layer decides which version of your agent handles the request.
Agent-Internal — The brain. System prompts, orchestration logic, guardrails, session state schema, short-term memory. These are tightly coupled to each other — you can't run a new orchestration flow against an old prompt format without courting undefined behavior.
Egress — Everything the agent reaches out to. Tool integrations, MCP servers, databases, knowledge bases, external APIs. Some you own, some you subscribe to within your organization, some come from vendors who deploy on their schedule, not yours.
The first question before designing your deployment strategy: which of these move together, and which move independently? Get this wrong and you'll be debugging version skew at 2 AM.

The Ownership Model: Own, Subscribe, Depend

Not all components have the same deployment lifecycle. Classify them:
OWN — Your team builds and controls these. Prompts, orchestration logic, local tool implementations, session schema. These must be tightly coupled — versioned and deployed as a single atomic unit. When you change the prompt to use a new tool-calling pattern, the orchestration that interprets it ships at the same time. No exceptions.
SUBSCRIBE-ORG — Shared resources within your organization. The knowledge base the data team maintains, a shared MCP server for CRM access, a company-wide tool registry. These are loosely coupled — they version independently behind stable interface contracts. Your deployment doesn't touch them; their deployment doesn't break you (if you've tested against their contract).
SUBSCRIBE-EXTERNAL — Third-party APIs, public MCP servers, vendor services. You don't control their schedule. Pin to specific API versions. Build fallback paths. Assume they will break at the worst possible time.
The deployment unit is your OWN tier. Everything else is a dependency you interface with through versioned contracts.

A Concrete Example: AgentCore Runtime + Gateway A/B Testing

Let me make this tangible. Say you've built a customer service agent on AgentCore Runtime. Here's what the deployment actually looks like:
Setup:
  • Your agent is deployed on AgentCore Runtime. You create two endpoints: prod-blue pointing to agent version v2 (current production) and prod-green pointing to v3 (the new version with updated prompts and a new escalation tool).
  • Both endpoints run the same runtime image but with different configuration bundles — each bundle includes the system prompt, orchestration config, and tool registry manifest versioned together as a single artifact in S3.
  • Register prod-blue and prod-green as AgentCore Gateway targets (a target is just a runtime ARN + endpoint qualifier). Then stand up a Gateway A/B test whose two variants point at those targets. The Gateway handles the traffic split for you, so your agent code doesn't change.
Traffic flow:
  • New sessions hit weighted targets: 90% → Blue, 10% → Green initially.
  • Routing is sticky by runtime session ID: a given session always lands on the same variant for its entire conversation.
  • Your tightly coupled resources (prompt v3, new escalation tool Lambda) are deployed only behind the Green endpoint. The shared MCP servers (CRM lookup, knowledge base search) remain at their stable interface versions and serve both Blue and Green.
The cutover sequence:
  1. Green at 10% — monitor tool call success rate, task completion, latency for 30 minutes.
  2. Green at 50% — check token cost per request hasn't spiked (a new prompt with more chain-of-thought reasoning will cost more).
  3. Green at 100% — all new sessions go to Green. Blue drains naturally.
  4. After 4 hours (your average session lifetime + buffer), decommission Blue.
If at any stage your metrics breach thresholds, dial the Green variant weight back to 0%. Active Green sessions either complete or get a graceful "session expired, please restart" — depending on your tolerance.

The Data Layer: Keep It Outside the Boundary

Blue and green should point at the same data store — long-term memory, the knowledge base, etc. Don't stand up a duplicate data layer per variant. If you do, a rollback strands every conversation that ran on green: those sessions saved their data into green's store, but once you roll back, blue only reads its own store, so to the user, their conversation has vanished.
What you version is the schema, not the store. The store stays single and shared; the schema goes through backward-compatible, overlapping stages so both v2 and v3 in the above example can read the same data during the overlap:
  • Expand first — add new fields/entities, keep the old ones. Make the change additive so the old version still works, and make sure your code tolerates fields it doesn't recognize instead of erroring.
  • Contract last — only after blue is fully drained and gone, remove the now-unused fields.
This is what lets you flip or roll back instantly, with no data migration on the critical path. The rule of thumb: if a rollback would orphan data, your data layer is inside the boundary when it shouldn't be.

Patterns by Topology

Singleton Agent + Local Tools

Everything ships as one bundle. Standard blue/green with the variant pattern above. Your container or Lambda deployment includes the agent runtime, prompts, and all tool implementations. Simple, predictable, easy to reason about.

Singleton Agent + Remote MCPs/Tools

The agent ships independently from its MCP servers. You need contract testing in CI — spin up a mock MCP with the current production schema, run your new agent against it, verify all tool calls parse correctly. When the MCP team ships a breaking change, they coordinate with you (or you handle it through graceful degradation and a schema version header).

Multi-Agent Systems

Here's where it gets genuinely hard. Each sub-agent may be owned by a different team. The rule: the orchestrator must be backward-compatible across at least one sub-agent version. Deploy the orchestrator first, verify it works with existing sub-agents, then roll out sub-agent updates independently. Think of it like API gateway versioning — the router handles multiple downstream versions simultaneously.

Discovering Shared Components: AWS Agent Registry

All three topologies above lean on a quiet assumption: that you can actually find the shared MCP servers, sub-agents, and tools you depend on and trust their contracts. At one or two components that's easy. Across an org with dozens of teams, it's where the SUBSCRIBE-ORG tier quietly falls apart: teams re-build tools that already exist simply because they couldn't discover them.
This is where the AWS Agent Registry comes in. It's a managed, searchable catalogue where teams publish and discover MCP servers, A2A agents, and tools behind an approval/curation workflow. It's how the SUBSCRIBE-ORG tier stays discoverable and governed rather than siloed, with curators controlling what's approved for others to consume.
Note that the Registry is a discovery and governance layer so it helps you locate the curated shared MCP server and it is not a deployment or traffic-routing mechanism. Deprecating a registry record stops people finding a resource but it doesn't shift a live request away from it.

The Shared Responsibility Model

Platform provides (AgentCore Runtime / EKS / ECS):
  • Endpoint management and version aliasing
  • Weighted traffic shifting between target groups (EKS/ECS target groups, or AgentCore Runtime endpoints as AgentCore Gateway A/B targets)
  • Health checks (liveness + agent-specific readiness probes)
  • Connection draining with configurable timeout
  • Auto-scaling based on concurrent session count
Builder provides:
  • Configuration bundles (prompt + orchestration + tool manifest) versioned in S3/git
  • Contract compatibility test suite in CI (mock MCP responses, schema validation)
  • Eval gates: shadow testing → canary metrics → full promotion
  • Kill switch: a single API call or config toggle that sets the Green variant weight to 0
  • Custom CloudWatch metrics: tool call success, task completion, hallucination rate
The gap most teams miss: the platform can shift traffic perfectly, but it doesn't know if your agent is doing its job correctly. A healthy container returning 200s while hallucinating is invisible to infrastructure health checks. You need agent-level evaluation metrics — and you need automated triggers on them.

The Kill Switch: Non-Negotiable

Every production agent needs a sub-5-minute disable mechanism that doesn't require a code deployment:
  • Variant weight flip: One API call to set the Green variant weight to 0 (or stop the A/B test) and all new sessions route back to Blue. Active Green sessions get drained (or forcibly expired, your call).
  • Feature flag at the gateway: API Gateway stage variable or Lambda environment variable that short-circuits to a fallback response.
  • AgentCore endpoint alias revert: Point the production alias back to the previous agent version.
If your only rollback path is "revert the commit, rebuild the container, push to ECR, update the task definition, and wait for ECS to roll" — that's 15 minutes minimum. Not acceptable for an agent that might be making wrong decisions right now.

What Metrics Tell You It's Failing

Traditional HTTP error rates are necessary but insufficient. For agents, instrument:
  • Tool call success rate — the agent calls 5 tools per turn; if success drops from 98% to 85%, something's wrong with tool/schema compatibility.
  • Task completion rate — is the agent actually resolving user intents end-to-end? This is your north star.
  • P99 latency — did the new prompt trigger more reasoning steps? Users won't wait 45 seconds.
  • Token cost per request — the new chain-of-thought prompt might be 3x more expensive. You should know before it hits 100%.
  • Hallucination/refusal rate — monitor via sampling + automated eval. A guardrail change that's too aggressive will refuse valid requests.
Set CloudWatch Alarms on these with a composite alarm that triggers the kill switch. Don't wait for a human to notice on a dashboard.

Bottom Line

Five rules:
  1. Map your components. Tight coupling (ships together) vs. loose coupling (interfaces independently). If you can't draw this diagram for your agent, you're not ready to deploy it.
  2. Topology dictates pattern. A singleton agent with bundled tools is straightforward. A multi-agent system with shared MCPs requires coordination protocols.
  3. Sessions, not requests. Route at the session level. A multi-turn conversation that switches agent versions mid-flow will produce incoherent results.
  4. Platform gives mechanics, you give intelligence. The platform shifts traffic flawlessly — but it can't tell you your agent is hallucinating. That's on you.
  5. Kill switches are non-negotiable. Sub-5-minute disable. No code deploy. No exceptions.
The teams that get this right aren't the ones with the most sophisticated CI/CD pipelines. They're the ones who spent a Wednesday afternoon drawing the component diagram, arguing about what's tightly coupled, and decided — before writing a single line of deployment config — what their deployment unit actually is.
Your agents aren't microservices. They're stateful, multi-component, non-deterministic systems with external dependencies and real-time user expectations. Deploy them like it.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article