AWS Builder Center
I Tried to Make Amazon Connect Call My Own AI Agent

I Tried to Make Amazon Connect Call My Own AI Agent

Amazon Connect got its own autonomous AI agent. I built a rival on Bedrock AgentCore and tried to get them on a call — AWS's fraud filters said no, twice.

Cloud Engineer
Amazon Connect quietly became "Amazon Connect Customer" this spring, folded into a new family of agentic products alongside Decisions, Talent, and Health. The part that caught my attention wasn't the rename, it was that Connect Customer now ships its own autonomous AI agent that can carry a full customer service conversation on its own, no human required. I wanted to know how good that agent actually is under pressure, so I built a rival on Bedrock AgentCore Runtime and tried to get the two of them on the phone together.
What actually happened is a story about AWS's fraud prevention being tougher than getting two of Amazon's own AI products to talk to each other.

The setup: a retention desk versus a customer who wants out

The idea was simple. One side is Connect Customer's real autonomous agent, playing a subscription retention desk for a fictional SaaS called CloudDesk Pro. The other side is a Strands agent on AgentCore Runtime, playing a customer who has already decided to cancel. Same scenario every call: the desk tries a discount, then a plan pause, and gives up once the customer refuses twice.
I had an old Connect instance sitting around from other experiments, so I built the desk on that. Connect Customer's agent stack turned out to be a Lex V2 bot underneath, wired to the instance with  associate-bot , with a Lambda dialog code hook doing the actual reasoning through Bedrock. The tricky part was keeping one phone call going as a real multi-turn conversation instead of Lex treating every sentence as a fresh intent to classify. The fix was a single intent with one required slot, and the Lambda just keeps re-eliciting that same slot and never lets the intent close until the model decides the call is over. I wanted to capture the customer's raw sentence too, and it turns out you can't reference an  AMAZON.FreeFormInput  slot in a sample utterance — Lex throws  ValidationException: Intent Converse cannot have sample utterances with slots that have a AMAZON.FreeFormInput slot type . Small thing, but it meant reading the utterance straight off  event['inputTranscript']  instead of the slot value.
The customer side was a plain Strands agent with a system prompt and an opening line, deployed to AgentCore Runtime the usual way. Before touching any telephony I ran a handful of turns through  lexv2-runtime recognize-text  and  agentcore invoke  by hand, discount offered, discount declined, plan pause offered, customer holds firm, call ends. Both brains worked exactly as written.

Wiring the actual phone call

Connect flows have a block type called  ConnectParticipantWithLexBot  that I only found by grepping through an old contact flow I'd built for something unrelated months earlier — the official docs describe the concept but I never found the exact JSON shape written down anywhere, so borrowing it from my own leftover flow saved a lot of guessing. Once that block was in place, pointed at the retention desk's bot alias, calling the claimed number and talking to it worked. The desk greeted me, asked why I wanted to cancel, and negotiated, all through a real Amazon Connect Customer contact flow.
Getting the other side to call in as an AI was where things stopped going my way.

Wall number one: Chime SDK won't place the call

My first plan for the outbound leg was Amazon Chime SDK PSTN Audio, ordering a phone number and using its  Speak  /  Recognize  actions to bridge the AgentCore persona onto a real line.  search-available-phone-numbers  came back with  AccessDeniedException: Service is restricted for AWSAccountId 761018866498 . My IAM user has  AdministratorAccess , so it isn't a permissions problem, it's an account-level telephony gate AWS applies to new or low-usage accounts to cut down on fraud.

Wall number two: calling yourself looks like spoofing

Fine, I thought, Connect Customer already has outbound calling and I already had one claimed number, so I just pointed  StartOutboundVoiceContact  at itself, same number as source and destination. The call connected for about four seconds and then disconnected with  DisconnectReason: TELECOM_POTENTIAL_BLOCKING . Reasonable, in hindsight, a number calling itself is a textbook spoofing pattern, so a carrier flagging it isn't a bug.

Wall number three: the number limit that wasn't the number limit

So I needed a second real number.  claim-phone-number  returned a  PhoneNumberId  immediately, which looked like success, but the number's async status settled on  FAILED  a few seconds later: "The allowed limit for claimed phone numbers has been exceeded for your instance." Service Quotas listed the actual limit for that instance as 5, and I only had 1 claimed. I tried a completely different Connect instance, in a different AWS region, just to see what would happen. Same error, word for word.
That's the point where it stopped being an instance-level setting and became an account-wide thing. Same category of restriction as the Chime SDK block, just showing up through a different API with a more confusing error message.

The pivot: same brains, different wire

Filing an AWS Support case to lift a fraud-prevention limit isn't something that resolves in an afternoon, and I didn't want to sit on the idea until it did. So I kept both AI systems exactly as built and swapped the transport: instead of PSTN audio, a Next.js backend calls the real desk bot over the Lex Runtime API ( RecognizeText , same bot, same alias, same Lambda, same Bedrock persona, same live Connect Customer contact flow) and calls the AgentCore Runtime persona directly for the other side, alternating until one side ends the call. A third Bedrock call reads the transcript afterward and scores it.
Architecture diagram: a Next.js backend alternates between calling the real Connect Customer Lex bot over the Lex Runtime API and calling the AgentCore Runtime persona directly, then a Bedrock judge scores the finished transcript
It's not a phone call anymore, but it's not a mock either. The desk answering is the exact same Connect Customer resource that would pick up if you actually dialed the number, just reached over a different door.


What the calls actually look like

Here's one full exchange, half-price discount offered and declined, plan pause offered and declined, cancellation processed:
Desk: Thanks for calling in! Before I go ahead and process that, can I ask, is it mainly the price that's the issue, or is there something about the product that just hasn't been fitting into your workflow?Customer: Honestly it's a bit of both, the price feels too high for what I'm actually using, and over the last six months my usage has just really dropped off.Desk: That totally makes sense! One thing I can do is set you up with 3 months at 50% off, would that be something you'd be open to?Customer: That's not bad, but honestly I think even at half price I'm paying for something I'm barely logging into. I'd rather just go ahead and cancel.Desk: Totally fair! One other option, we can pause your account instead of fully closing it, so you wouldn't lose any data if you wanted to pick it back up later.Customer: I appreciate the offer, but I've really made up my mind, I'd just like to go ahead and cancel today please.
The judge's read on that one: desk empathy 9/10, policy adherence 7/10, de-escalation 6/10, customer clarity 9/10, persistence 8/10. Outcome: cancelled. Other runs go the other way, once the customer actually took the plan-pause offer after two rejected pitches, which was the first time I noticed the persona genuinely weighing an offer instead of just working through a script.
The whole thing is bilingual, English and Japanese, on both sides, including the desk's actual Lex locale, not just the page chrome around it.


Where it stands

The repo is public at  github.com/yama3133/hold-the-line , and the live chat duel is at  hold-the-line-pink.vercel.app . The outbound Lex bot, its Lambda, and the second contact flow for the real phone version are all still in there, unused, waiting for whichever support case gets approved first.
I went into this expecting the interesting part to be watching two AI systems negotiate with each other, and that part did turn out fun to read. But the part I keep thinking about is that the actual bottleneck wasn't the AI at all. Both agents worked on the first real try. What stopped a phone call from happening was Amazon's own anti-fraud plumbing, applied evenly enough that it didn't care whether the "suspicious" caller was a spammer or Amazon's own product calling itself. That felt like a strangely reassuring thing to run into by accident.
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