Guardrails, permissions and governance for AI customer support agents
Permissions, approvals and rules for agents that refund orders, make promises and change customer accounts, with what the AI Act, the GDPR and the Air Canada chatbot ruling mean.
· 10 min read
Build guardrails for a customer support agent by sorting what it does by what it gives away. Reading tickets, drafting replies and adding notes run free. Refunds, credits, replacements and promises outside the written policy go through a person, or through a rule a person wrote in advance with an amount limit and a daily budget. Changes to who controls an account (email, phone, two-step sign-in, owner) wait for an identity check done outside the chat and a person’s approval. Deleting customers stays with people. The agent holds its own narrowly scoped keys, never an agent’s or admin’s login, and every action leaves a record of who allowed it.
Governance is that written down: the list of actions, who approves each, what the law expects of a company that answers customers with an AI, and evidence that the check ran every time. This page covers agents that answer chat and email or work a ticket queue in tools like Zendesk, Intercom, Gorgias or Freshdesk, with payments in Stripe or a shop backend. Agents that answer your own staff have their own page, and so do sales and marketing agents.
Sort every action by what it gives away
List every tool the agent can call, then ask of each one what a persuasive stranger could get out of it. A support agent is the one agent whose input is written by anyone on the internet, so assume some of them will try. A drafted reply gives them nothing. A refund gives them money, and an email change gives them the account.
| Option | Action name | What can go wrong | Guardrail |
|---|---|---|---|
| Read a ticket, add a note, draft a reply | Action nameticket.note, ticket.note_draft_reply | What can go wrongNone until a reply is sent. | GuardrailRuns free. Logged, not asked. |
| Reply to the customer on their own ticket | Action nameticket.reply | What can go wrongA wrong answer about policy can become a promise you have to keep. | GuardrailAsk during the first weeks, then allow by rule once the record shows replies are sound. Replies with a promise go as policy.exception. |
| Tag, route or close a ticket | Action nameticket.tag, ticket.close | What can go wrongSmall. A ticket closed too early is reopened. | GuardrailAllow. |
| Refund an order | Action namerefund.create | What can go wrongMoney leaves, and a manipulated chat can ask for it. | GuardrailAllow small amounts with a daily budget; ask above; deny very large. |
| Send a replacement | Action namereplacement.ship | What can go wrongGoods leave, sometimes to a new address. | GuardrailAsk, with the order and any earlier replacements. |
| Waive a fee, extend a warranty, promise a credit | Action namepolicy.exception | What can go wrongBinds the company to something no policy says. | GuardrailAsk the support lead, with the policy text and the exception. |
| Cancel a subscription | Action namesubscription.cancel | What can go wrongCancelling the wrong account; or a retention script that blocks a lawful cancellation. | GuardrailAllow when the signed-in account owner asks. Never make cancelling harder than signing up. |
| Change the email or phone on an account | Action nameaccount.contact.change_email, account.contact.change_phone | What can go wrongThe usual first step of an account takeover. | GuardrailAsk, with how identity was checked outside the chat. |
| Remove two-step sign-in or change the owner | Action nameaccount.recovery.reset_mfa, account.recovery.transfer_owner | What can go wrongHands the whole account to whoever is in the chat. | GuardrailAsk two people. |
| Export or erase a customer's data | Action nameprivacy.export, privacy.erase | What can go wrongPersonal data sent to the wrong person, or deleted for good. | GuardrailAsk, routed to the privacy lead. |
| Delete a customer or their history | Action namecustomer.delete, customer.delete_history | What can go wrongLoses the record of what was promised and refunded. | GuardrailNever. People only. |
One family per kind of effect lets one rule cover a family: account.contact.* for anything that changes how the account is reached, account.recovery.* for anything that hands it over. More on that in naming agent actions. The tool risk checker sorts a list of tools into tiers like these.
Give the agent its own narrow access
- Its own credentials in every system. A bot user in the help desk and its own key in the payment system, never a team lead’s login. Help desks show who did what; that only helps if the agent is recorded as itself.
- The narrowest scope offered. Zendesk lets an OAuth token be limited to a resource, such as
tickets:read. Stripe recommends restricted keys for AI agents, with each resource set to None, Read or Write; a support agent needs Write on refunds, not on payouts or customers’ payment methods. - One approval key per agent. The chat agent and the email triage agent ask with different keys, so a rule written for one cannot be used by the other. A key can also be scoped to the actions it may ask about, such as
ticket.*,refund.*,policy.*andaccount.contact.*for the chat agent; anything outside its scope is refused before anyone is asked. - No tool for what nobody should automate. If the agent has no reason to delete customers, it gets no call that does. Rules are the second line, not the first.
The chat cannot prove who the customer is
Account takeovers can start in support: someone who knows a name and an order number asks to “update my email”. A model is easy to talk round, and a ticket can carry instructions written for the model rather than for you. Treat every message as untrusted text. Identity is a fact your systems record, such as a signed-in session or a code sent to the phone already on file, never something the model concludes from the conversation. The email sample below refuses to ask at all until that record exists, and puts the method and time in the request.
VariantGate’s summary check helps from the other side: it compares the summary a person reads with the amount and details the action runs on, and holds a request where they disagree, such as “Refund €20” over an amount of €200.
The laws and rulings that shape the answers
These are the ones that most often decide what must ask and what must never happen in support. They are a starting point, not legal advice: check the details for your markets with your counsel.
What the agent says, the company has said
In Moffatt v. Air Canada (2024 BCCRT 149), British Columbia’s Civil Resolution Tribunal held the airline liable after its website chatbot told a customer he could claim a bereavement fare after travelling, which the airline’s own policy page did not allow. Air Canada argued that the chatbot was responsible for its own words. The tribunal rejected that, found the airline had not taken reasonable care that the chatbot was accurate, and ordered it to pay the difference. It is one small-claims decision in one province, but its point is hard to argue with: a customer cannot be expected to know which part of your website is the accurate one.
For the agent: anything that reads as a promise outside the written policy, such as a refund the policy does not cover, a waived fee or a longer warranty, is an action of its own, policy.exception, and a person approves it before the reply goes out. Give the request the policy text next to the exception, so the reviewer sees both.
Telling people they are talking to an AI
Article 50(1) of the EU AI Act requires providers of AI systems meant to interact directly with people to design them so the people are told they are dealing with an AI system, unless that is obvious from the context. It has applied since 2 August 2026. The Digital Omnibus on AI, Regulation (EU) 2026/1744, gave providers of generative systems already on the market until 2 December 2026 for machine-readable marking of generated content (Article 50(2)), but did not move Article 50(1). In California, the bot disclosure law (Business and Professions Code section 17941, in force since 1 July 2019) makes it unlawful to use a bot online to mislead someone about its artificial identity in order to encourage a purchase or sale in a commercial transaction, or to influence a vote, unless it discloses that it is a bot clearly and conspicuously.
For the agent: say it is an AI at the start of the chat, keep the way to a person one step away, and never let the prompt tell it to claim to be human.
Requests about personal data
Customers use the support channel for privacy requests, whatever the privacy page says. Under the GDPR they have a right of access (Article 15) and to erasure in the cases Article 17 lists. The controller must answer without undue delay and within one month, which can be extended by two further months where necessary (Article 12(3)). Where there is reasonable doubt about who is asking, the controller may ask for more information to confirm their identity (Article 12(6)).
For the agent: it recognises the request, logs it under privacy.* and routes it to the privacy lead, which starts the clock in a place someone watches. It never sends an export to an address that is not already on the account, and never erases anything itself.
Cancelling online in the EU
Directive (EU) 2023/2673 added Article 11a to the Consumer Rights Directive. Since 19 June 2026, traders who conclude distance contracts through an online interface must offer a withdrawal function on that interface, so a consumer can use the right of withdrawal (usually 14 days) there, with a clearly labelled function and a confirmation of receipt. It covers withdrawal, not every later cancellation, which national law governs. Member states had to transpose it into national law, and not all did so on time, so check the national rules for your markets.
For the agent: a retention offer is fine, a retention loop is not. When the signed-in account owner asks to cancel or withdraw, the agent does it or points to the function that does, and never asks a person whether the customer may leave.
The pattern in code
Each risky tool asks, waits, and acts only when allowed is true. Pending, denied, expired and withdrawn all mean no, and so does an approval while agents are paused. One helper holds that logic, with the TypeScript SDK:
import { ApprovalClient } from "@variantgate/agent";
import { describe } from "@variantgate/agent/errors";
import type { ApprovalRequest, Decision, Outcome } from "@variantgate/agent/types";
// One client per agent, each with its own key, so a rule for one never covers another.
const approvals = new ApprovalClient({
agent: "support-agent",
apiUrl: process.env.VARIANTGATE_API_URL ?? "https://api.variantgate.com",
key: process.env.VARIANTGATE_KEY ?? "",
});
type Answer = { go: true; decision: Decision } | { go: false; why: string };
/** Asks and waits. Only an approval without changes lets the agent act. */
export async function askAndWait(request: ApprovalRequest): Promise<Answer> {
let asked: Decision | undefined;
try {
asked = await approvals.ask(request, 30);
const decision = await approvals.waitForDecision(asked);
if (!decision.allowed) {
// Denied, expired, withdrawn, still pending at the end, or approved while paused.
return { go: false, why: `the request is ${describe(decision)}` };
}
if (decision.changed) {
// A person changed it before approving. This code can only do what it asked.
await report(decision.id, "failed", "not done: the approval changed the request");
return { go: false, why: "it was approved only with changes" };
}
return { go: true, decision };
} catch {
// No answer is not a yes. Take the request back so nobody approves it later.
if (asked) await approvals.withdraw(asked.id).catch(() => undefined);
return { go: false, why: "no answer could be had" };
}
}
/** Reports how it went. Best effort: a failed report never undoes or repeats the action. */
export function report(id: string, outcome: Outcome, note?: string) {
return approvals.reportOutcome(id, outcome, note).then(() => true, () => false);
}
/** The error's class only. Messages from other APIs can carry tokens and addresses. */
export const kindOf = (error: unknown) => (error instanceof Error ? error.name : "error");The refund tool checks the order belongs to the customer on the ticket before it asks, states the refund as the amount so the rules can compare it, and reads the order again after the approval: if someone refunded it meanwhile, it stops. The idempotency key comes from the order’s state, not the approval, so a retry of the same refund is one refund. Stripe may prune a key once it is 24 hours old, and refuses a reused key with different parameters. Once the refund call has run, the tool never throws, since an exception invites the model to try again.
/** Refunds part or all of one order. The amount is what the refund rules read. */
export async function refundOrder(ticket: Ticket, orderId: string, cents: number) {
// Read the order once and keep it: the approval is for this order in this state.
const order = await shop.getOrder(orderId);
if (order.customerId !== ticket.customerId) return "That order is not this customer's.";
const money = (c: number) => (c / 100).toFixed(2);
const refundable = order.paidCents - order.refundedCents;
if (cents <= 0 || cents > refundable) return `At most ${money(refundable)} can be refunded.`;
// The rules are in euros and refuse other currencies, so other orders go to a person.
if (order.currency !== "EUR") return "Not refunded: a person handles this currency.";
const answer = await askAndWait({
action: "refund.create",
summary: `Refund ${money(cents)} EUR on order ${order.number}`,
amount: money(cents),
currency: "EUR",
details: {
ticket: ticket.url,
reason: ticket.reasonCode, // a code from the form, not the customer's words
paid: money(order.paidCents),
"already refunded": money(order.refundedCents),
"refunds on this account, 90 days": await shop.refundCount(order.customerId, 90),
customer: order.customerId, // an id, not a name or an email
},
ttlSeconds: 2 * 60 * 60,
});
if (!answer.go) return `No refund: ${answer.why}. Tell the customer a person will look at it.`;
// Someone may have refunded this order while the request waited. Then stop.
const now = await shop.getOrder(orderId);
if (now.refundedCents !== order.refundedCents) {
await report(answer.decision.id, "failed", "not done: the order was refunded meanwhile");
return "No refund: the order changed while waiting. Read it again before asking.";
}
// Keyed on the order's state, so a retry cannot pay the same refund twice.
const idempotencyKey = `refund-${order.id}-${order.refundedCents}-${cents}`;
try {
await stripe.refunds.create({ payment_intent: order.paymentIntentId, amount: cents }, { idempotencyKey });
} catch (error) {
await report(answer.decision.id, "failed", `may have gone through: ${kindOf(error)}`);
return "The refund may or may not have gone through. Hand the ticket to a person; do not try again.";
}
await report(answer.decision.id, "succeeded");
return `Refunded ${money(cents)} EUR. Tell the customer it can take a few days to arrive.`;
}The email change tool asks only after an identity check recorded by the system, masks both addresses in the request, and tells the old address about the change, which is often how a takeover is noticed in time.
// Proof that only the system can record. Nothing the customer types in the chat counts.
const ACCEPTED_PROOF = ["signed-in-session", "link-to-current-email", "code-to-phone-on-file"];
const PROOF_VALID_MINUTES = 20;
/** Changes the sign-in email of the customer on this ticket, after an identity check. */
export async function changeAccountEmail(ticket: Ticket, newEmail: string): Promise<string> {
const proof = await identity.latestCheck(ticket.id); // written by the check, never by the model
const fresh = proof && Date.now() - proof.passedAt < PROOF_VALID_MINUTES * 60_000;
if (!proof || !ACCEPTED_PROOF.includes(proof.method) || !fresh) {
await identity.sendCheck(ticket.id); // a link to the address already on the account
return "Not changed yet. A check was sent to the current email; wait for the customer to pass it.";
}
const account = await accounts.get(ticket.customerId);
const answer = await askAndWait({
action: "account.contact.change_email",
summary: `Change the sign-in email of account ${account.id} from ${maskEmail(account.email)} to ${maskEmail(newEmail)}`,
details: {
ticket: ticket.url,
"identity check": `${proof.method}, ${new Date(proof.passedAt).toISOString()}`,
"contact changes, 30 days": account.contactChanges30d,
"two-step sign-in": account.mfaEnabled ? "on" : "off",
},
ttlSeconds: 60 * 60,
});
if (!answer.go) return `Email unchanged: ${answer.why}. Do not change it another way.`;
// The approval was for the account as read above. Any edit since then voids it.
if ((await accounts.get(account.id)).version !== account.version) {
await report(answer.decision.id, "failed", "not done: the account changed while waiting");
return "Email unchanged: the account changed while waiting. Hand the ticket to a person.";
}
try {
await accounts.setEmail(account.id, newEmail, { notifyPrevious: true });
} catch (error) {
await report(answer.decision.id, "failed", `may have gone through: ${kindOf(error)}`);
return "The change may have been saved. Hand the ticket to a person; do not repeat it.";
}
await report(answer.decision.id, "succeeded");
return "Email changed. A notice went to the old address too.";
}Outcome notes carry the error’s class, never its message, since payment and help desk APIs can put names and addresses in theirs. The full refund setup, including what the approver sees, is in the support refunds guide.
Standing rules for a support workspace
Asking about everything wears people out, and customers wait while they do. Standing rules answer the routine requests at once and leave people what needs judgement:
- Always allow ticket.note*, for support-agentInternal notes and drafted replies reach no customer, so they run at once and still leave a line in the record.
- Always allow refund.create up to €40, €400 a day, for support-agentSmall refunds in euros go through at once until €400 has been refunded by rule today. Only the support agent's key gets this.
- Always ask about refund.create above €40, for the support lead, anyone after 30 minutesLarger refunds, and any refund with no amount in euros, wait for the support lead (workspace owners can always decide too). After half an hour any member may decide, so the customer is not left waiting overnight. The refund tool asks with a two-hour time limit, so the request is still open when it escalates.
- Never allow refund.* above €750Refunds that large go through finance. A refund that states no amount in euros is refused here too, so this sample only refunds euro orders.
- Always ask about policy.exception, for the support lead, anyone after 2 hoursA promise outside the written policy, such as a waived fee or a longer warranty, binds the company. A person makes it. Ask with a time limit longer than two hours, or the request expires before it escalates.
- Always ask about account.contact.*, for the support leadA changed email or phone number is how an account is taken over. Someone checks the identity proof before it happens.
- Always ask about account.recovery.*, two people, for the support lead and securityRemoving two-step sign-in or handing an account to a new owner needs two different people. Workspace owners can always decide a routed request too, so keep owners few if security must be one of the two. One denial stops it.
- Always ask about privacy.*, for the privacy leadAccess and erasure requests have legal deadlines and identity checks. The agent can log one; the privacy lead answers it.
- Never allow customer.delete*Deleting a customer or their history is done by people, through the erasure process, never from a chat.
The same rules as API bodies
# POST /v1/workspaces/{workspace_id}/rules, one call per rule
{
"action": "ticket.note*",
"agent_key_id": "SUPPORT_AGENT_KEY_ID",
"effect": "allow"
}
{
"action": "refund.create",
"agent_key_id": "SUPPORT_AGENT_KEY_ID",
"budget_amount": "400.00",
"budget_currency": "EUR",
"budget_period": "day",
"effect": "allow",
"limit_amount": "40.00",
"limit_currency": "EUR"
}
{
"action": "refund.create",
"deciders": [
"USER_ID_OF_SUPPORT_LEAD"
],
"effect": "ask",
"escalate_after_seconds": 1800,
"limit_amount": "40.00",
"limit_currency": "EUR"
}
{
"action": "refund.*",
"effect": "deny",
"limit_amount": "750.00",
"limit_currency": "EUR"
}
{
"action": "policy.exception",
"deciders": [
"USER_ID_OF_SUPPORT_LEAD"
],
"effect": "ask",
"escalate_after_seconds": 7200
}
{
"action": "account.contact.*",
"deciders": [
"USER_ID_OF_SUPPORT_LEAD"
],
"effect": "ask"
}
{
"action": "account.recovery.*",
"approvals": 2,
"deciders": [
"USER_ID_OF_SUPPORT_LEAD",
"USER_ID_OF_SECURITY_LEAD"
],
"effect": "ask"
}
{
"action": "privacy.*",
"deciders": [
"USER_ID_OF_PRIVACY_LEAD"
],
"effect": "ask"
}
{
"action": "customer.delete*",
"effect": "deny"
}Owners write rules under Rules in the app, or post these bodies while signed in. Replace the ids in capitals with your own.
When rules disagree the most cautious wins, so the “never” on refunds above €750 holds whatever else is allowed. Amount limits only work in the cautious direction: a refund in another currency, or with no amount, is not allowed by the small-refunds rule, and the deny rule refuses it outright. The daily budget stops a run of €39 refunds: once €400 has gone out by rule today, every refund waits for a person. Rules match on the agent’s key, never on the name it gives itself. Writing rules needs Pro, two-person approval needs Team, and routing and escalation need Business. Every option is in the rules reference, and the approval policy generator can draft a first set for you.
Who approves what
- Refunds and replacements above the rule: the support lead, with the order, earlier refunds and the reason code in the request. Escalation lets any member decide after half an hour, so a customer is not left waiting because one person is at lunch.
- Policy exceptions: the support lead, with the policy text and the exception side by side.
- Account contact and recovery: the support lead for an email or phone change; two different people, from the support lead, the security lead and the workspace owners, for removing two-step sign-in or changing the owner. See two-person approval.
- Privacy requests: the privacy lead, who owns the deadline. The data deletion and GDPR guide covers the rest of that process.
Notice what is missing: nobody approves a refusal. The agent can grant a small refund on its own, but it cannot turn a customer down; a “no” that matters goes to a person with the ticket. That keeps the decisions customers care most about with people, and it stops a model from inventing a policy in the other direction.
What to measure
Three numbers show whether the guardrails fit. The approval rate per action: a refund size that is approved every time is a candidate for a higher rule limit. Time to approve: support has customers waiting, so a refund that waits all afternoon is a failure of the setup, not of the customer’s patience. And denials by reason: if most denied refunds are on accounts with many earlier refunds, put that count first in the request. VariantGate’s Insights shows the median time to decide, the share answered by rules and the requests nobody answered. More in approval fatigue and standing rules.
If an agent starts going wrong, for example after a prompt injection in a ticket, any member can pause every agent from the inbox at once. While paused nothing is allowed, whatever was approved, and only an owner can resume. Customers still need answers, so keep a plain fallback, such as “a person will reply”, for while it is paused.
Checklist
- List every tool each support agent can call.
- Mark each: stays inside, moves money or goods, makes a promise, or changes who controls an account.
- Give each agent its own credentials and the narrowest scopes; remove tools it has no reason to use.
- Make every risky tool ask in code, and act only on
allowed: truewithout changes. - Allow small refunds with a daily budget; ask above; deny very large.
- Give promises outside policy their own action and route them to the support lead.
- Require a system-recorded identity check before any account change; two people for recovery.
- Tell customers they are talking to an AI, and route privacy requests to their owner.
- Review approval rate, time to approve and denials every month.
To see the inbox side first, send a refund in the playground. The wider set of controls is in guardrails for AI agents.
Sources
- Civil Resolution Tribunal (British Columbia): Moffatt v. Air Canada, 2024 BCCRT 149
- Regulation (EU) 2024/1689 (AI Act), Article 50: transparency obligations, and Article 113: dates of application
- Regulation (EU) 2026/1744 (Digital Omnibus on AI), amending Article 113. EUR-Lex.
- Goodwin: Not Delayed, Not Deferred: EU AI Act Transparency Obligations Are Now in Force (August 2026)
- California Legislative Information: Business and Professions Code section 17941 (bot disclosure)
- Regulation (EU) 2016/679 (GDPR), Article 12 (time limits and identity), Article 15 (access) and Article 17 (erasure)
- Directive (EU) 2023/2673, amending Directive 2011/83/EU: Article 11a, the withdrawal function
- Stripe Docs: Restricted API keys
- Stripe API reference: Idempotent requests
- Zendesk Developer Docs: OAuth tokens for grant types, scopes
Try it without signing up
Both open in your browser with this case filled in. Nothing is sent anywhere.
- PlaygroundSend this request as the agentSee which rule answers it, decide it yourself, or pause every agent and watch the answer change.
- Policy generatorWrite this up as your team’s policyStarts from this page’s choices. Change the names and limits, then copy the policy, its rules and the agent code.
Give your agents somewhere to ask.
Free for 100 requests a month. Sign in with your email and have a first request waiting a few minutes from now.
Start free