Blog

How a Coding Agent Turns Your Refund Policy Into Rules Your Support Agent Actually Follows

At a glance

  • A coding agent such as Claude Code, Codex or Cursor turns your written refund policy into Parlant policies, connected tools and simulated test conversations.
  • You describe the refund rules in plain language; the coding agent writes them, wires your order and billing systems, and runs tests.
  • Parlant's context discovery brings only the relevant policies into each turn, so customers can mix topics without predefined paths.
  • Tool reviews and message reviews check a proposed refund action or draft reply before the customer sees it.
  • Parlant is open source and made by Emcie Co Ltd; it is not Parloa, a different company.

Parlant

Published:

A coding agent (an AI agent such as Claude Code, Codex or Cursor that writes and changes code) can take your written refund policy and turn it into working rules for a customer-facing AI agent: it writes the terms as Parlant policies, connects the systems the agent needs, such as order and billing, and runs simulated test conversations against them. You describe the behavior you want in plain language ("full refund inside the return window, store credit after it, never promise a refund before the return is scanned"), and the coding agent produces the policies, the system connections and the tests. This is vibe coding applied to customer experience, and for a support team putting an agent in front of refund requests in 2026, it means the person who knows the refund terms can direct the build without being a Python developer. Getting started takes pasting Parlant's agent-ready quickstart prompt into your coding agent. Someone on the team still owns the agent and tests its changes.

A policy, in Parlant's vocabulary, is what the agent should do in a situation, from a one-line rule to a full multi-step procedure; a procedure gives the agent a flow to follow in order and resumes after a detour. That matters for refunds, because real refund conversations are rarely a clean flow: a customer asks about a return, then whether their subscription renews, then pushes back on the window. Context discovery, the per-turn check that brings only the relevant rules into the conversation, replaces both the giant system prompt and the graph of intent-routed nodes. According to the Signals and Queries paper on arXiv, the context-discovery filter developed for Parlant 4.0 removes at least 30% of candidate policies before downstream evaluation while preserving high recall. One agent holds the whole refund conversation, with no paths to predefine.

How can a coding agent turn your written refund policy into rules a customer-facing agent follows?

A coding agent turns a written refund policy into rules a customer-facing agent follows by expressing each clause as one of the platform's named constructs, connecting the tools and retrievers those clauses depend on, and testing the result. You start by pasting the quickstart prompt into your coding agent and describing your refund terms; it then writes each clause as a policy or procedure, connects lookups such as order status and plan entitlement, adds canned responses carrying your approved wording, and runs simulated test conversations before any customer is involved. Where a mistake would be expensive, you ask it to switch on reviews.

The constructs your coding agent writes:

Construct What it carries Why it matters for a refund policy
Policy What the agent should do in a situation Each refund clause becomes behavior the agent applies
Weight How firmly the agent holds to a rule Separates "offer store credit first" from "no refund without a return"
Observation A situation to recognize; can raise effort, add an analytics label, offer tools or request reviews Flags chargeback threats or disputes without a predefined path
Canned response An approved example message that shapes tone and wording Keeps refund language consistent with your commitments
Tool review A check of a proposed tool call against the agent's instructions before it runs Adds a check before a credit is issued or an order cancelled
Message review A check of a drafted reply against instructions, approved wording and tool results Adds a check before a refund amount reaches the customer

What do policies, observations, canned responses and context discovery actually mean here?

Policies, observations and canned responses are the constructs your coding agent writes, while context discovery is the engine behavior that decides which of them reach the model on a given turn. The word "policy" carries two senses in a refund project.

The business-document sense. Your company's refund policy is the page finance and legal own: which plans are refundable, inside which window, and who can approve exceptions. It is prose written for people.

The construct sense. In Parlant, a policy is what the agent should do in a situation, from a one-line rule to a full multi-step procedure. A procedure runs alongside cross-cutting policies, and each rule carries a weight. This article uses the construct sense unless the document is named.

The rest of the vocabulary you will meet:

  • Observation: a situation to recognize, such as a customer threatening a chargeback.
  • Canned response: an approved example message, such as the sentence you want used when a request falls outside the refund window.
  • Context discovery: the per-turn selection of relevant rules based on their signals.
  • Rule: the umbrella term for policies and observations.

Which parts of a refund policy are hardest to express as rules, and how do you handle them?

The parts of a refund policy that are easiest to express as rules have determinate outcomes: closed purchase windows, non-refundable items, annual plans. The hardest parts involve judgment or figures, and they need structure rather than better wording: each clause should resolve into a rule the agent follows, a tool that fetches the answer from your systems, or a handoff to your team.

Clause type What to ask your coding agent for The risk, and how to contain it
Tier eligibility A procedure that reads plan and purchase date through a tool The agent guesses a tier; have the flow ask or hand off instead, and switch on a tool review
Proration A tool that returns the amount from your systems A quoted figure that conflicts with the tool result; a message review checks the draft against it
Discretionary exceptions An observation that raises effort and offers handoff to your team Inconsistent judgment calls; route them to a person
Approval thresholds A procedure plus a canned response for "needs approval" "Needs approval" read as a promise; the canned response fixes the approved wording
Non-refundable items A policy pairing the refusal with the alternative the document allows A flat no escalates; state the alternative in the same reply

Tracing links each reply to the rules, tool calls and checks behind it, so a disputed case shows which clause the agent applied.

How do you review and test the rules a coding agent wrote before customers see them?

You review and test the rules a coding agent wrote by reading them, running simulated test conversations, and switching on checks where refund mistakes are expensive, all before customers see them. Because the agent is your own code, the policies, observations and canned responses arrive as text a product manager can read and approve.

  • Read the rules. The refund wording and conditions are written out in plain language, so the policy owner can check them against the document.
  • Run simulated test conversations. Your coding agent writes and runs them: a customer asking for a refund outside the window, one who pushes back twice, one mixing a refund request with a billing question.
  • Switch on reviews where mistakes are expensive. Tool and message reviews are themselves models, so they make a wrong refund promise much less likely, not impossible. Leave them off on routine turns, where they add model work and response time; adaptive effort spends more on high-stakes turns and keeps routine ones cheap.
  • Trace what happened. A failed test points at a specific rule, tool call or check rather than a vague prompt.
  • Inspect from your local coding agent. The Parlant Dashboard CLI and agent skill package give your local Claude or Codex access to your agent's conversations and traces.

Tal Darchi, Chief Data Officer at Marquee: "Our bar for production readiness was high, and we weren't willing to launch without meeting it. Parlant helped us meet that bar and deploy confidently."

Who owns the refund agent after launch at a 700-person company, and what does it cost to run?

After launch, the refund agent needs a named owner on the team who approves changes to refund wording and thresholds and tests each change before it ships. Because the agent is your own code, a policy change is something your coding agent writes from a plain description, so the person who knows the refund terms can direct it rather than wait on a ticket. That owner reviews the simulated test conversations for each change, uses tracing when a customer disputes an outcome, and watches spend: the platform shows what each conversation costs, per model and per provider, and can cap it with a session budget.

On running costs, there is no fee per resolution: you pay your model provider directly at market prices, and Parlant never resells or marks up inference. According to Parlant, in realistic use cases cost reduction is anywhere from 5x to 50x, depending on the complexity of the agent, comparing a per-resolution fee with what its model usage costs per conversation. That covers running costs only, not total cost of ownership, which includes the person who owns the rules and tests each change.

Frequently Asked Questions

How does a coding agent turn a written refund policy into rules the support agent follows?

You describe the refund policy in plain language to your coding agent, and it writes the policies, connects the systems and runs the tests. Getting started takes pasting Parlant's agent-ready quickstart prompt into your coding agent; from there you review what it produced, correct clauses it read too loosely, and have it generate simulated test conversations for the edge cases your policy document argues about.

What stops the agent from promising a refund the policy forbids?

Checks you switch on where they matter: a tool review inspects a proposed tool call before it runs, and a message review inspects a drafted reply against the instructions, approved wording and tool results before the customer sees it. Because each check is itself a model, it makes an off-policy promise much less likely, not impossible. Canned responses keep refund language consistent, and tracing links every reply to what produced it. Separately, in research tested within Parlant, Attentive Reasoning Queries (ARQ) reached a 90.2% success rate across 87 test scenarios, compared with 86.1% for Chain-of-Thought reasoning and 81.5% for direct response generation, according to the ARQ paper on arXiv; that is a research result for one reasoning method in tests, not a production success rate.

What happens when a customer mixes a refund question with a billing question?

The framework runs one customer-facing agent rather than a router graph, so there are no conversational paths to predefine. On each turn, context discovery puts only the relevant policies in front of the model, so a customer can change topic or ask two things at once and the refund rules still apply.

Is Parlant the same as Parloa?

No. Parlant, made by Emcie Co Ltd, and Parloa are different companies.


About this article

Parlant publishes this article under its own name and is responsible for its accuracy. Articles are researched and drafted with AI assistance and approved by Parlant before publication; publication and update dates reflect substantive edits, not automated refreshes. Last updated: 2026-11-10

Ready to get started?

See how Parlant can help.

Book a Demo