Build an Agent Harness You Control End to End

... PLUS: Accurate STT Is Not Enough for Reliable Voice Agents

In today’s newsletter:

  • Accurate STT Is Not Enough for Reliable Voice Agents

  • Build an Agent Harness You Control End to End

Reading time: 5 minutes.

Modern speech-to-text is already very good at handling things like traffic, keyboards, air conditioning, and other background noise.

Another human voice is a different problem.

If someone nearby starts talking while you are speaking, the STT model is no longer trying to separate speech from noise. It is receiving two valid speech signals and has to decide which one actually belongs to the user.

For a voice agent, that can become much more than a transcription error.

The wrong speaker can change the perceived intent, trigger a turn the user never intended, or influence what the agent does next.

What the Benchmark Shows

We went through Krisp's public Voice Isolation benchmark to see how much difference the audio layer makes before anything reaches the STT model.

Across 265 real recordings and 11 STT configurations, pooled word error rate dropped from 23.2% on raw audio to 6.2% after Voice Isolation.

The environment breakdown makes the result more useful:

  • Work: 31.8% → 6.3% WER

  • Call Center: 23.8% → 6.9% WER

  • Phone Calls: 3.5% → 3.9% WER

That last one matters.

When there is very little competing speech, Voice Isolation does not magically improve everything. In some cases it can slightly hurt transcription.

The gains show up where the second-speaker problem actually exists.

The Right Words From the Right Person

That is the more important point for voice agents. There are really two questions:

  • Did we transcribe the words correctly?

  • Did we transcribe the right person?

For a voice agent that can call tools, update memory, retrieve information, or take actions, the second one can be just as important as the first.

The Pipeline Starts Before STT

The pipeline really starts before STT:

Microphone → Voice Isolation → Speech-to-Text → Turn Detection → Agent → Tools → Response

A stronger LLM later in the stack cannot recover the user's original intent if the wrong speaker already made it into the transcript.

Build an Agent Harness You Control End to End

Every agent starts as the same loop. Call the model, run the tool it asked for, feed the result back, repeat until it answers.

Then it meets real traffic.

A bad task runs forever, so you add a turn limit. A user hits stop, so you add cancellation. An API flakes, so you add retries. The agent wants to send an email, so you add an approval step. Something breaks at 2am, so you add logging around every call.

Each one lands as another branch inside a loop you now own forever.

Strands Agents gives you that loop with the controls already in it. It's an open-source SDK for Python and TypeScript that runs inside your own process, with no hosted service in between, and works with Bedrock, Anthropic, OpenAI, Gemini, Ollama, and more.

Let's go through the loop it gives you, the hooks that let you change any step of it, and the controls you'd otherwise build yourself.

The Loop You Start With

Underneath, the loop does what yours would. It calls the model, runs any tool it requests, appends the result, and goes again.

A tool that fails with an error doesn't crash the run. The error goes back to the model as a result, so it can try something else. And every run ends with an explicit stop reason, such as end_turn, tool_use, cancelled, max_tokens, or guardrail_intervention, so your code knows why it stopped instead of guessing.

Every Step Is a Hook

The loop fires events before and after each invocation, each model call, and each tool call. You attach a function to any of them.

Here's a hook that blocks a dangerous tool:

The tool never runs, and the model gets your message back instead of a crash.

Hooks don't stop at reading events. From a hook you can:

  • Cancel a tool call with a message to the model

  • Swap in a different tool, like a sandboxed version of a risky one

  • Rewrite the arguments before the tool sees them

  • Change the result after it runs

  • Retry a failed model call or tool call

That covers most of what a hand-written loop accumulates over a few months. Here, each control is one function, and the loop stays untouched.

Pause for Approval

Some actions need a human before they happen. A hook can pause the run instead of blocking it:

The agent returns with stop_reason == "interrupt". You show the request to a person, then resume the same run with their answer. The agent picks up where it stopped, with the tool call still pending.

Stop It From the Outside

When a user closes the tab or a job hits its time budget, agent.cancel() stops the run from another thread:

It checks for the cancel signal while the model is streaming and before each tool runs. Pending tool calls get error results instead of disappearing, so the conversation history stays valid and the same agent is ready for the next request.

Cancel ends the run. An interrupt pauses it so it can resume.

The Rest Is Already There

The pieces most teams build next come with it:

  • MCP tools and structured output

  • Multi-agent patterns, including graphs and swarms, with their own hooks per node

  • Sessions and memory across conversations

  • Streaming, guardrails, tracing, and evals

So when the next production problem shows up, you add a hook for it. The loop itself stays the same.

It's open source under Apache 2.0.

That’s all for today. Thank you for reading today’s edition. See you in the next issue with more AI Engineering insights.

PS: We curate this AI Engineering content for free, and your support means everything. If you find value in what you read, consider sharing it with a friend or two.

Your feedback is valuable: If there’s a topic you’re stuck on or curious about, reply to this email. We’re building this for you, and your feedback helps shape what we send.

WORK WITH US

Looking to promote your company, product, or service to 200K+ AI developers? Get in touch today by replying to this email.