Building a Secure E-Commerce Chat Agent with Stored Procedures
dev.to·5d·
Discuss: DEV
💬Prompt Engineering
Preview
Report Post

Background

Recently, I tried to build a GPT-like chat agent for a specific e-commerce platform.

Not a generic chatbot. Not a demo.

A real product-facing agent that could answer questions like:

  • "Where is my order?"
  • "Can I get a refund?"
  • "Show me my last purchase"

To do this, the agent had to access real production data — orders, shipments, payments.

That’s when I hit an important problem.


The Problem I Faced

As soon as an agent needs database access, a tempting idea appears:

“Why not just let the LLM generate SQL from the user’s question?”

It sounds simple. It works in demos.

But in a real e-commerce system, it quickly becomes dangerous.


Scenario

You are building a chat application for a specific e-commerce platform.

The ch…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help