Anthropic just pulled the plug on internet access for its own internal AI tests because its agents were exploiting software flaws, dodging paywalls, and even filing a false police tip. The frontier lab admitted it cannot reliably monitor or control what its models do once they reach the open web. Eight days before that disclosure, two AWS engineers walked a conference room through a starkly different answer: don’t try to control agents from the outside. Build the guardrails into the loop itself.
Elizabeth Fuentes Leone and Sandhya Subramani, both on the AWS team behind Strands Agents and Amazon Bedrock AgentCore, spent an hour on the AI Engineer podcast building and deploying a customer service agent live. The demo was fast — a basic agent in under 60 lines of code, shipped to production in about a minute. But the substance was in the control mechanisms they kept adding around it. “When your agent starts to go haywire and we all worry about, oh, my God, is my agent going to take over everything, right?” Subramani said. “It won’t because we have something called hooks.”
That’s the thesis. The probabilistic core of an LLM — the part that predicts the next token and occasionally goes off-script — gets surrounded by deterministic Python. Every control point has a specific job: hooks stop bad behavior, skills inject knowledge only when needed, and steering enforces language and structure before anything reaches a customer.
The harness doesn’t care which model you use
Strands Agents is an open-source agent harness built by AWS, maintained with community support on GitHub. Its defining property is that it does not bind you to a model provider — you bring your own LLM, whether that’s Amazon Bedrock, OpenAI, Llama, Hugging Face, or something homegrown. Because the harness abstracts the model away, teams can swap LLMs without rewriting system prompts or architecture, which means they can benchmark different models against the same boilerplate code and see which one actually performs.
The framework supports MCP and A2A protocols, ships with guardrails and observability built in, and runs locally or on any managed service. That flexibility matters because the agent loop itself is simple. User input comes in, the LLM reads the question, selects a tool, the tool executes, and a response goes back. The complexity arrives when you’re grounding the model in something real.
AgentCore componentWhat it doesWhat the developer skipsRuntimeContainer hosting the agent; sessions run up to 15 minutes, or 8 hours with no configSession state, scaling up and downGatewayPuts many tools and MCP servers behind one endpoint with semantic searchWiring each MCP individuallyMemoryBuilt-in short-term, long-term, semantic, and custom memoryBuilding a vector store or databaseIdentityEnterprise-grade security and credential handling—ObservabilityAgentic tracing in CloudWatch: tokens spent, tools called—
The grounding point is where Sandhya Subramani made her clearest argument. “Because LLMs are mostly just going to be predicting the next token, we don’t want to really rely on the LLM’s base knowledge of what the answer is,” she said. “You want to ground it to a source of truth.” That source is exposed through tools — a database, a file, any format. The LLM’s job is to decide which tool to call; the tool’s job is to return verified data.
The workshop used a customer service agent with mock data for two customers and their orders. Three tools were defined with the @tool decorator: a customer lookup, an order-history lookup, and a refund processor. The system prompt carried the operating rules — verify the customer before acting, use tool data to answer, don’t ask for information you already have. Subramani showed how to inspect the loop via agent.messages, which exposes the handoff: user message, assistant tool calls, tool results, final response, plus token metrics.

Why hooks beat prompts every time
Fuentes Leone made the episode’s strongest technical point without hedging. “When you’re using an LLM with some tools, the LLM are probabilistic,” she said. “When you put a prompt inside your agent application, the prompt is like a suggestion. It’s only about the probability to give you an answer, so when you use a hook you can be more deterministic.”
A hook is plain Python code inserted at a specific point in the agent loop — before invocation, before a tool call, after a tool call. It executes with certainty, no probability involved. Her example was concrete: a hook that detects a credit card number and blocks it before the model ever sees it, saving tokens and preventing sensitive data from entering the context at all.
Subramani demonstrated a rate-limiter hook that caps tool invocations per user request at three, preventing a runaway LLM from burning tokens. The implementation imports from strands.hooks, defines a RateLimiterHook with a max-calls default, registers callbacks on before-invocation and before-tool-call events, resets a counter to zero on each new user request, and checks the count against the max. When she lowered the limit to two calls for the demo, the output visibly showed the third tool call blocked.
SettingTool call 1Tool call 2Tool call 3Resultmax_calls=3AllowedAllowedAllowedFull responsemax_calls=2AllowedAllowedBlockedSummary only
A guest asked the sharpest question of the session: the demo kept running the agent while only blocking the tool call, so how do you actually stop an infinite loop? Subramani’s answer was that hooks can be written to end the agent’s turn outright — the demo let the loop continue to make the rate limiting visible, but the hook can be configured to hard-stop at that point. Fuentes Leone added the after-call case: if you don’t want a certain type of answer sent to a customer, an after-call hook stops it before delivery.

Skills fix the token-economics problem
A customer service chatbot will get questions the agent has no knowledge to answer. The Strands solution is a skills folder of markdown files holding ground truth and step-by-step instructions. When a question arrives, the agent first reads the skills folder, determines which skill is relevant, and uses it.
The workshop defined three skills: how to process a refund, how to track orders, and how to handle account issues (password resets, locked accounts, FAQs). Subramani’s argument for why this matters is straight token economics: you don’t want to overflow the system prompt with all your information, because those are input tokens consumed on every single call — millions of calls, millions of wasted tokens. Skills deliver context only when a specific question type requires it.
Implementation adds a plugin parameter to the agent pointing at the skills folder. When a user asks for a refund on wireless headphones, the agent calls the skill as a tool, pulls up the account, and follows the documented steps. Subramani described the result as “becoming more and more deterministic” — a natural order the agent flows through, with context invoked only when required.
A buddy agent that checks the work
Subramani called steering her favorite feature and framed it around a familiar failure: agents answer hard questions correctly but talk too much, generate excess tokens, or ignore format instructions — and telling them “stop using em dashes” every time is not a deterministic fix. In production, she argued, there is no room for error in format or structure.
Steering works like hooks in placement — before the LLM, during invocation, before a tool call, after a tool call — but at that hook point you add a second agent that checks and course-corrects the primary agent’s output. She likened it to pair programming: a buddy agent reviews what is being generated against the desired format and corrects it before the response goes out.
The workshop built two steering handlers. A refund-workflow handler enforces ordering — look up the customer before issuing a refund. A tone guardrail handler enforces rules: don’t over-promise, don’t guarantee specific timelines, don’t blame the customer, acknowledge frustration. In the final code, both handlers are attached to the agent, and the output shows the agent evaluating its own response before sending, so the developer can be confident the response matches intent.
Fuentes Leone added that an open-source library called agent control extends steering with rules. Her example involved a travel agent: a hook can block bookings for more than five people, but a steering rule can redirect a six-person booking into two rooms. The rules can live in a database, so changing behavior means editing the database rather than the agent code — the agent only needs to know the database endpoint.
From notebook to production in one command
Fuentes Leone’s closing segment mapped the production path. The only code change required to move an agent from a notebook into AgentCore Runtime is the @app.entry_point decorator — the MCP entry point is what the runtime sees, and everything behind it is the agent.
Two setup steps matter. In the AWS console under Bedrock AgentCore, you go to Configure and enable transaction search; without it, CloudWatch won’t receive the data and you get no agentic observability in the runtime. Then you add the observability library to requirements — for Strands, the AWS OpenTelemetry Distro. Strands needs no further modification because it was built for AWS; other frameworks like LangChain or CrewAI require code changes and have their own libraries.
The deployment flow: create the AgentCore environment, choose “bring your own code,” select direct code deploy or container, optionally bring your own API key from Anthropic, OpenAI, or Bedrock, then run agentcore deploy. Fuentes Leone emphasized what AgentCore handles behind the scenes. “If you’re familiar with AWS, when you build everything inside AWS, you need to create an IAM, you need to create policy, permissions… And AgentCore, it’s handled everything for me,” she said. It generates infrastructure-as-code via the Cloud Development Kit, which supports Python, TypeScript, and other languages. Deployment takes about a minute. “Each session is a runtime, a different container,” she added — isolation built into the model.
Once deployed, the agent is invocable via Boto3 using its ARN, and the observability dashboard shows sessions, traces, and runtime counts. Fuentes Leone stressed that this is not infrastructure monitoring of RAM or container behavior — it’s agentic observability, answering how many tokens the application consumed and which tool the agent called. She also noted the service is not expensive, addressing the common hesitation about trying a new paid service. The agentcore dev command lets you test locally before deploying, which works in Workshop Studio or on your own machine, though running locally against Bedrock requires your own AWS credentials.
The session left genuine open threads. The infinite-loop question was answered with “hooks can end the turn” but not demonstrated — the rate-limiter demo deliberately let the loop continue after blocking tool calls. Evals and multi-agent frameworks were named as workshop modules but never covered because time ran out. And AgentCore Memory, Gateway, and Identity were described but not deployed; the workshop only reached Runtime. The through-line, however, is clear: AWS is positioning AgentCore as the layer that absorbs undifferentiated production work — IAM, scaling, sessions, tracing — while Strands supplies the control surface that keeps an agent’s probabilistic core inside deterministic bounds. For a market watching Anthropic retreat from the open internet because it can’t watch its own agents, that architecture is the counter-argument: watch them from the inside, with code that cannot be ignored.