Seu agente quebra em produção (notebook ≠ real customers)
Agente funciona no notebook? Quebra em produção (sessions, state, auth). Amazon Bedrock AgentCore: production infrastructure.
Equipe OpenClaw · Time de Engenharia & Produto
A Equipe OpenClaw é formada por engenheiros, designers e especialistas em IA dedicados a construir a melhor plataforma de agentes conversacionais para negócios brasileiros. Combinamos expertise…
Seu agente quebra em produção (notebook ≠ real customers)
Você é founder/CEO de SaaS.
Seu SaaS: agente IA (atendimento, vendas, suporte).
Sua atual situação de agente:
- Development: Agente funciona perfeitamente no notebook (Jupyter, Google Colab)
- Architecture: Simple prompt loop → LLM → tool calls → repeat
- State management: Dictionary em memória (session_state = {})
- User isolation: Manual (if customer_id != current_customer: return error)
- Authentication: Hardcoded token (API_KEY = "secret123")
- Scaling: Single process (works for 1-2 concurrent users)
- Assumption: "When we ship to production, it will just work"
- Reality: "Agente crashes on day 1 (multi-user + state + auth chaos)"
Amazon Bedrock AgentCore warning (AWS blog, September 2026):
AWS quote: "An agent that works in a notebook isn't an agent in production. After real users arrive, you own work that has nothing to do with your agent's reasoning."
Translation: Your notebook agente is 10% done. Production agente requires 90% infrastructure work (unrelated to LLM reasoning).
O problema (notebook → production = death valley)
Scenario 1: Your agente in notebook (development)
Current architecture: python
Notebook agente (works perfectly)
from anthropic import Anthropic
client = Anthropic() conversation_history = [] # State in memory
def agent_loop(user_message): conversation_history.append({ "role": "user", "content": user_message })
response = client.messages.create(
model="claude-3-5-sonnet",
max_tokens=1024,
system="You are a helpful support agent.",
messages=conversation_history
)
agent_response = response.content[0].text
conversation_history.append({
"role": "assistant",
"content": agent_response
})
return agent_response
Usage:
response1 = agent_loop("Help me reset my password") # Works response2 = agent_loop("What was my previous question?") # Works (history in memory)
Result: Perfect agente (for 1 user)
Why it works:
- Single user (you)
- Single process (notebook kernel)
- State in memory (conversation_history list)
- No auth needed (you're logged in)
- No scaling (just you)
Result: Agente works great (for development)
Scenario 2: Your agente in production (day 1)
What happens when you ship:
Customer 1 (João) starts conversation:
- Request: "Help me reset my password"
- Your agente loop processes request
- State: conversation_history = [{"role": "user", "content": "Help..."}]
- Response: "Sure, I'll help you reset your password."
Customer 2 (Maria) starts conversation at same time:
- Request: "What's my order status?"
- Your agente loop processes request
- Problem: Same conversation_history (shared state)
- State: conversation_history = [ {"role": "user", "content": "Help me reset..."}, # João's message {"role": "assistant", "content": "Sure..."}, # João's response {"role": "user", "content": "What's my order..."}, # Maria's message (mixed!) ]
- LLM sees: "João asked for password reset, now asking about order status"
- LLM response: "Your order is XYZ... and here's your password reset link"
- Result: João gets Maria's order info, Maria gets João's password reset link
Outcome:
- Data leak (customers see each other's data)
- Security breach (passwords/info exposed)
- Customer trust destroyed
- Your SaaS is dead (reputation destroyed)
What AWS actually means:
Notebook agente = 10% of production agente:
- Agent reasoning loop (LLM logic) = 10% (you did this)
- User isolation (session management) = 20% (YOU DIDN'T)
- State persistence (database + cache) = 20% (YOU DIDN'T)
- Authentication (per-user + per-tool) = 20% (YOU DIDN'T)
- Monitoring + observability = 15% (YOU DIDN'T)
- Error handling + recovery = 10% (YOU DIDN'T)
- Scaling + load balancing = 5% (YOU DIDN'T)
Total production infrastructure: 90% (you did 10% = agente reasoning)
The 10 operational burdens (AWS lists them)
AWS Bedrock AgentCore blog identifies 10 operational burdens:
-
Session isolation (keep one user's session out of another's)
- Problem: Shared state = data mixing
- Solution: Per-user session storage
- Effort: Medium (requires database)
-
State persistence across turns (hold state when user closes chat)
- Problem: Refresh page = lose conversation history
- Solution: Persist state to database
- Effort: Medium (requires DB schema)
-
State persistence across days (user returns next day)
- Problem: Conversation lost after 24 hours
- Solution: Long-term storage + retrieval
- Effort: High (requires archival strategy)
-
Authentication for every tool (auth sits in your code)
- Problem: Agent calls tool → no auth → unauthorized action
- Solution: Per-user auth tokens + validation before tool call
- Effort: High (security-critical)
-
Operating system patching (security updates)
- Problem: Server needs OS patches → downtime
- Solution: Rolling deploys + zero-downtime updates
- Effort: Medium (requires infrastructure)
-
Guardrails (prevent agent from doing bad things) (Amazon Bedrock Guardrails)
- Problem: Agent hallucinates → calls wrong tool → breaks customer data
- Solution: Output validation + tool filtering
- Effort: High (domain-specific)
-
Monitoring (track agent behavior) (observability)
- Problem: Agent breaks in production → you don't notice → customers suffer
- Solution: Logging + metrics + alerting
- Effort: Medium (requires instrumentation)
-
Error handling (agent fails gracefully) (fallbacks + recovery)
- Problem: LLM times out → agente hangs → customer sees spinning wheel
- Solution: Timeouts + fallback logic + retry logic
- Effort: Medium (requires robust error handling)
-
Rate limiting (prevent abuse) (per-customer limits)
- Problem: Customer runs 1000 requests/second → costs explode
- Solution: Per-customer rate limits + billing
- Effort: Medium (requires quota tracking)
-
Scaling (handle 1000s of concurrent users) (infrastructure)
- Problem: Single process can't handle 1000 concurrent sessions
- Solution: Load balancing + horizontal scaling
- Effort: High (requires distributed infrastructure)
Cost of implementing these:
Manual implementation (you build everything):
- Session isolation: 2-4 weeks, 1-2 engineers
- State persistence: 2-4 weeks, 1-2 engineers
- Authentication: 2-4 weeks, 1 security engineer
- Guardrails: 4-8 weeks, 1-2 engineers
- Monitoring: 2-4 weeks, 1 engineer
- Error handling: 2-4 weeks, 1 engineer
- Rate limiting: 1-2 weeks, 1 engineer
- Scaling infrastructure: 4-8 weeks, 1 infrastructure engineer
Total: 24-40 weeks (6-10 months), 6-10 engineers Cost: R$ 1.2M-2.4M (engineering + infrastructure) Risk: 80% chance of bugs in production (multi-user is hard) Time to market: 6-10 months (vs 1 month with Bedrock AgentCore)
A solução (Amazon Bedrock AgentCore = production infrastructure ready)
What is Bedrock AgentCore?
AWS service that provides production infrastructure for agents:
Bedrock AgentCore = Manages all 10 operational burdens for you:
- Session isolation ✓ (built-in)
- State persistence ✓ (built-in)
- Auth per tool ✓ (built-in)
- OS patching ✓ (AWS managed)
- Guardrails ✓ (integrated)
- Monitoring ✓ (CloudWatch)
- Error handling ✓ (built-in)
- Rate limiting ✓ (API Gateway integration)
- Scaling ✓ (AWS auto-scaling)
- Multi-user ✓ (session isolation)
Your job: Just define agent logic (prompt + tools) Bedrock AgentCore: Handles everything else
Architecture comparison
Before Bedrock AgentCore (manual):
Your code: ├─ Agent loop (LLM reasoning) ├─ Session management (custom) ├─ State persistence (custom DB) ├─ User auth (custom) ├─ Tool auth (custom) ├─ Guardrails (custom validation) ├─ Error handling (custom) ├─ Monitoring (custom logging) ├─ Rate limiting (custom) └─ Scaling (custom load balancer)
Result: 90% infrastructure, 10% agent logic Time to market: 6-10 months Cost: R$ 1.2M-2.4M Bug risk: 80%
With Bedrock AgentCore:
Your code: └─ Agent logic (prompt + tools) [20 lines of code]
Bedrock AgentCore (AWS managed): ├─ Session management ✓ ├─ State persistence ✓ ├─ User auth ✓ ├─ Tool auth ✓ ├─ Guardrails ✓ ├─ Error handling ✓ ├─ Monitoring ✓ ├─ Rate limiting ✓ └─ Scaling ✓
Result: 90% done (by AWS), 10% agent logic Time to market: 2-4 weeks Cost: R$ 5-15K (Bedrock usage) Bug risk: 5% (AWS handles infra)
Implementation path (Bedrock AgentCore)
Week 1: Setup + define agent logic python
Define your agent in Bedrock
agent_config = { "name": "support-agent", "model": "claude-3-5-sonnet", "system_prompt": "You are a support agent. Help customers with issues.", "tools": [ { "name": "reset_password", "description": "Reset customer password", "auth": "customer_id in session", # Bedrock handles auth "api_endpoint": "https://your-api.com/reset-password" }, { "name": "get_order_status", "description": "Get customer order status", "auth": "customer_id in session", # Bedrock handles auth "api_endpoint": "https://your-api.com/orders" } ], "guardrails": { "blocked_actions": ["delete_account", "charge_customer"], # Prevent dangerous actions "user_isolation": True # Bedrock enforces session isolation } }
Time: 1 week (just define logic, no infrastructure)
Week 2-3: Deploy + test
- Deploy agent to Bedrock AgentCore
- Test with multi-user scenario (João + Maria simultaneously)
- Verify session isolation (data doesn't mix)
- Verify auth (tools only called with correct permissions)
- Verify state persistence (conversation survives refresh)
Result: Production-ready agente (weeks 2-3)
Week 4: Monitor + optimize
- Bedrock CloudWatch integration (automatic monitoring)
- Review error logs (find bugs)
- Optimize guardrails (based on user feedback)
- Scale as needed (Bedrock handles auto-scaling)
Result: Live agente (week 4)
Total: 4 weeks to production (vs 24-40 weeks manual)
Cost comparison
Manual infrastructure (your code):
Engineering: R$ 1.2M-2.4M (6-10 engineers × 6-10 months) Infrastructure: R$ 200K-500K/year (servers, databases, load balancers) Ops team: R$ 400K-800K/year (monitoring, on-call) Bug fixes: R$ 200K-400K/year (multi-user data loss fixes) Total Year 1: R$ 2M-4.1M Total Year 2+: R$ 800K-1.7M/year
Bedrock AgentCore (AWS managed):
Engineering: R$ 50K-100K (1-2 engineers × 4 weeks) Bedrock usage: R$ 10K-50K/month (based on requests) Infrastructure: R$ 0 (AWS managed) Ops team: R$ 50K/year (minimal monitoring) Bug fixes: R$ 0 (AWS handles infra bugs) Total Year 1: R$ 200K-750K Total Year 2+: R$ 170K-650K/year Savings Year 1: R$ 1.25M-3.9M (vs manual)
Seu roadmap (4 semanas, R$ 50-100K = agente production-ready)
Phase 1 (Week 1): Define agent + tools
- Write system prompt (what agente should do)
- Define tools (password reset, order status, etc)
- Plan guardrails (prevent dangerous actions)
- Cost: R$ 10-20K
- Result: Agent config ready for deployment
Phase 2 (Week 2): Deploy to Bedrock AgentCore
- Create Bedrock agent
- Connect your backend APIs (tools)
- Setup auth (customer_id from session)
- Deploy to AWS
- Cost: R$ 10-20K (infrastructure setup)
- Result: Agente deployed (not live yet)
Phase 3 (Week 3): Testing + multi-user scenarios
- Test session isolation (2 simultaneous users)
- Test state persistence (refresh page)
- Test auth (tool calls respect permissions)
- Test guardrails (blocked actions don't execute)
- Fix issues
- Cost: R$ 10-20K
- Result: Production-ready agente
Phase 4 (Week 4): Go live + monitoring
- Enable monitoring (CloudWatch dashboards)
- Setup alerts (errors, timeouts)
- Gradual rollout (10% → 50% → 100% customers)
- Monitor first week closely
- Cost: R$ 10-20K
- Result: Live agente with 99.9% uptime
Total: 4 weeks, R$ 50-100K engineering + R$ 10-50K/month Bedrock usage
vs 24-40 weeks, R$ 1.2M-2.4M manual + bugs + downtime
Conclusão: Agente notebook ≠ agente production
Signal (Amazon Bedrock AgentCore = AWS acknowledging production is hard):
- Notebook agente = only 10% of production agente
- Production agente = 90% infrastructure (session, state, auth, guardrails, scaling, monitoring)
- Building manually = 6-10 months, R$ 1.2M-2.4M, 80% bug risk
- Using Bedrock AgentCore = 4 weeks, R$ 50-100K, 5% bug risk
Your exposure:
- Your agente works in notebook (you tested it)
- When you ship to customers = data leaks, security holes, crashes
- Multi-user = session mixing = customer data exposed
- No guardrails = agente does dangerous things
- No monitoring = you don't notice when it breaks
- No auth = unauthorized tool calls
Suas opções:
Opção 1: Build infrastructure manually (traditional)
- Timeline: 24-40 weeks (6-10 months)
- Cost: R$ 1.2M-2.4M (engineering)
- Infrastructure: R$ 200K-500K/year (servers, DB, load balancers)
- Bug risk: 80% (multi-user is hard)
- Outcome: Eventually production (after many bugs/rewrites)
- Time advantage: You lose 6-10 months vs Bedrock users
Opção 2: Use Bedrock AgentCore NOW (fast path) - 4 weeks, R$ 50-100K
- Timeline: 4 weeks to production
- Cost: R$ 50-100K (engineering) + R$ 10-50K/month (Bedrock usage)
- Infrastructure: R$ 0 (AWS managed)
- Bug risk: 5% (AWS handles multi-user, scaling, auth)
- Outcome: Production-ready agente in 4 weeks
- Time advantage: 6-9 months faster than manual
- Revenue advantage: 6-9 months earlier launch = early customer capture
- Cost advantage: R$ 1.1M-2.3M saved (vs manual infrastructure)
Your decision window: THIS WEEK
If you use Bedrock AgentCore NOW: Launch in 4 weeks (early mover advantage)
If you build manually: Launch in 6-10 months (competitors beat you)
If you ignore: Agente crashes in production (data leak, customer churn)
At OpenClaw, ajudamos SaaS agentes deploy on Bedrock AgentCore:
- AGENT DESIGN: Define prompts + tools + guardrails
- BEDROCK SETUP: Create agent, configure auth, connect APIs
- MULTI-USER TESTING: Verify session isolation, state persistence
- GUARDRAILS: Prevent dangerous agent actions
- MONITORING: CloudWatch dashboards + alerting
- GRADUAL ROLLOUT: 10% → 50% → 100% traffic
- PRODUCTION SUPPORT: On-call during launch week
Result: Seu agente ships in 4 weeks (not 6-10 months). Production-ready (session isolation, state persistence, auth, guardrails, scaling). Zero multi-user data leaks. 99.9% uptime from day 1. Customer trust maintained. Revenue captured 6-9 months earlier than competitors.
Seu agente funciona no notebook?
Quer shipping em 4 semanas (não 6-10 meses)?
Medo de agente quebrar em produção (multi-user chaos)?
Quer usar Bedrock AgentCore + deploy seguro?
Se não sabe por onde começar:
Publicado em 3 de setembro de 2026