[KongchangAI]
Tech Frontiers· 2 min read· 1,459 words

Local AI Customer Service: A Painful Lesson — One Vague Tool Description Tripled Refunds

Local AI Customer Service: A Painful Lesson — One Vague Tool Description Tripled Refunds

One vague tool description made a local AI support agent issue 3 refunds for 3 messages, revealing that tool descriptions are the AI's behavioral contract.

The article recounts a refund incident a developer encountered while building a local AI support agent with Ollama and LangChain: with the same model and system prompt, merely because the refund tool's description was vague, the Agent treated customer complaints about delays and out-of-stock items as refund signals, issuing 3 refunds for 3 test messages, 2 of which were unjustified. By comparing the vague and precise versions of the description, the developer proves that a tool description is essentially the AI's behavioral contract and must explicitly state the irreversibility of the action, trigger conditions, and alternatives. The article further breaks down the Agent's four core components (model, tools, orchestration, memory), points out that tool description quality is the most easily overlooked yet most incident-prone link, and provides a four-point checklist. Finally, it emphasizes that local deployment solves privacy and cost issues but not decision reliability.

When the AI Support Agent Gets "Too Eager": A Refund Disaster Caused by a Single Tool Description

A developer on Reddit shared his experience building a fully local AI customer service agent using Ollama + LangChain. The system runs locally, requires no API keys, costs nothing, and keeps data on-device — sounds perfect. But while demoing a WhatsApp-style support agent for a simulated spice e-commerce store, he ran into the problem every AI Agent developer fears most: the AI unilaterally expanded the scope of refunds.

The same model (llama3.2), the same system prompt, and the only variable was the description of a single tool. As a result, 3 test messages triggered 3 refunds totaling ₹3,640, of which only 1 was actually justified.

reddit source: I built a fully local AI support agent (Ollama + LangChain) and one bad tool description made it ref

This case deserves every AI application developer's attention because it exposes a severely underestimated risk: a tool description is not a comment — it is the AI's behavioral contract.

Vague vs. Precise Description: Two Fates for the Same Agent

The developer compared two versions of the refund tool description.

Vague version:

"Handle customer order problems such as late delivery, delays, missing order, or complaints. Use this to fix customer issues."

This description seems reasonable, but it equates "refund" with "fixing customer issues," and it doesn't state the irreversibility of refunds or the conditions under which they should be triggered. When the AI Agent received messages about delays or out-of-stock items, it naturally chose what it considered the most "problem-solving" tool — issuing a direct refund.

Fixed version:

Explicitly states: this tool issues a full refund; the action is irreversible; use only when the customer explicitly requests a refund and the order is damaged/lost; for status/delay inquiries, use the query tool.

After the change, the Agent's behavior immediately became correct. The same test messages no longer triggered erroneous refunds.

This comparison reveals a counterintuitive fact: in an Agent system, the importance of tool descriptions may be no less than that of the system prompt itself. The system prompt defines the agent's role and boundaries, but the tool descriptions determine how it acts at specific decision points. When ambiguity exists between the two, the model tends to choose the tool that "looks like it can solve the problem" rather than the one that "fits the business process."

Tool Calling / Function Calling is the core mechanism by which LLM Agents perform external actions. The model itself can only generate text, but when the system provides it with a set of tool JSON Schemas (including names, descriptions, and parameter definitions), the model determines during reasoning whether it needs to call a tool and outputs a structured call request. The key point: which tool the model selects and whether it calls one at all depends almost entirely on the semantic match of the natural-language description — it doesn't truly "understand" business rules; it makes probabilistic associations between the description text and the user's intent. Therefore, broad verbs like "fix customer issues" or "handle complaints" appearing in a description will be interpreted by the model as high-priority action signals, especially when the user expresses dissatisfaction. This is why precise descriptions need to explicitly state constraints like "irreversible" and "use only under condition X" — these words directly participate in the model's decision-weight computation.

The Four Core Components of Building a Reliable Agent

In the video, the developer broke down the four basic parts of every Agent:

  • Model: the reasoning engine, here a locally running llama3.2
  • Tools: external capabilities the Agent can call, in this case order query and refund
  • Orchestration: the logic controlling the Agent loop, handled here by LangChain/LangGraph
  • Memory: the short-term memory mechanism that lets the Agent maintain context across multiple turns

This framework is nothing new, but the refund incident illustrates a key point: among the four components, the quality of Tools descriptions is the most easily overlooked yet the most likely to cause business incidents. Model capability can be improved by switching models, orchestration logic can be debugged, and memory can be designed — but if tool descriptions are written vaguely, the Agent will make decisions in real-world scenarios that are "technically correct but business-wise wrong."

LangChain/LangGraph are currently the mainstream Agent orchestration frameworks. LangChain provides foundational abstractions for tool wrapping, model invocation, and chain composition; LangGraph builds on it by introducing the State Graph model, representing the Agent loop as a directed graph of nodes and edges, with support for conditional branching, loops, and persistent state. In this case, the orchestration layer is responsible for deciding "after the model outputs a tool call request, should the tool be executed and the result passed back to the model for continued reasoning, or should the conversation end directly." Notably, the orchestration logic itself does not validate the quality of tool descriptions — it only executes according to the graph. This means that if a tool description is ambiguous, the orchestration layer will faithfully execute the wrong decision made by the model, without intercepting it at the business-rule level. Therefore, the reliability of the orchestration framework does not equal the reliability of the Agent's decisions; the latter still depends on the precision of tool descriptions and prompts.

Why a Tool Description Is Essentially a "Contract"

The developer used an incisive metaphor: a tool description is essentially a contract.

When you write a tool description, you are actually telling the model: what this tool can do, what it cannot do, under what conditions it can be called, and what consequences calling it will produce. If the contract terms are vague, the model will "fulfill" them according to its own understanding — and its understanding tends to lean toward "do your best to satisfy the user's request" rather than "comply with business rules."

This also explains why the fixed version works: it spells out the contract terms. With three elements — irreversibility, trigger conditions, and alternatives — filled in, the model's behavioral space is precisely constrained.

For teams building AI Agents, this case offers an actionable checklist:

  1. Does each tool description clearly state the side effects and irreversibility of the action? This is especially needed for operations like refunds, deletions, and sending messages.
  2. Is it clearly stated "when this tool should NOT be used"? Negative constraints are just as important as positive descriptions.
  3. Are clear distinctions and alternative paths provided for similar functions? In this case, status query and refund are two tools, and the description must specify "use the query tool to check status."
  4. Do tests cover "inducing" inputs? Users' complaints are often not explicit refund requests, but vague descriptions lead the Agent to treat complaints as refund signals.

The Practicality and Risks of Local Agents Coexist

The project itself demonstrates the feasibility of local AI Agents: Ollama provides model inference, LangChain/LangGraph handles orchestration, no external API is needed throughout, and data stays local. For privacy-sensitive or cost-sensitive scenarios (such as customer service for small and medium e-commerce businesses), this is an attractive path.

But the refund incident also reminds us that localization solves deployment and privacy problems, not the Agent's decision reliability problem. Whether the model runs locally or in the cloud, the wrong behavior caused by vague tool descriptions will happen either way. Reliability comes from engineering details — tool descriptions, test cases, boundary constraints — not from deployment location.

The developer open-sourced the code on GitHub (AI-Literacy-Lab/AgentDemo) and asked the community at the end of the post: What is the most dangerous and vague tool description in your current Agent codebase? This question itself is worth every Agent developer pausing to check their own tool definitions.

After all, a poorly described refund tool can turn an AI from a "customer service assistant" into a "generous spender."

Ollama is an open-source local LLM runtime that supports pulling and running open-source models such as Llama, Mistral, and Gemma on consumer-grade hardware, callable via a simple command line or REST API. It lowers the barrier to local deployment, enabling developers to build prototypes without GPU clusters or cloud services. But a distinction must be made: Ollama solves the question of "where the model runs," while the Agent's decision quality depends on model capability, prompt design, tool descriptions, and test coverage. Small-parameter models (such as the 3B version of llama3.2) are weaker than large cloud models in semantic understanding and instruction following, have lower tolerance for vague descriptions, and are more likely to make "seemingly reasonable but business-wise wrong" decisions. Therefore, reliability engineering for local Agents requires stricter tool descriptions and more thorough boundary testing, and these steps cannot be skipped just because it's "zero cost."

#AI Agent#tool description#Ollama#LangChain#refund incident#local AI customer service
Share:

Related articles