Guardrails, permissions and governance for AI marketing agents
Permissions, approvals and rules for agents that send campaigns, publish posts, change ad budgets and edit the CRM: drafts run free, anything that reaches people, spends money or changes who may be mailed asks.
· 9 min read
Build guardrails for a marketing agent by sorting what it does by what each action touches. Drafts and internal changes run free. Anything that reaches people (a send, a post, a public reply), spends money (ad budgets, bids, boosts) or changes who hears from you (list imports, consent and suppression changes, deletions) goes through a person, or through a rule a person wrote in advance. Give each agent its own credentials with the narrowest scopes the tools offer, never a person’s login, and keep a record of who allowed what.
Governance is the same idea written down: a list of actions, who may approve each, which laws shape the answer, and evidence that the check ran every time. This page goes through each part for campaigns, social, ads, content and audiences. For a sales agent sending one-to-one email and updating the CRM, the email and CRM guide has the rules and code.
Sort every action by what it touches
Start with an inventory of every tool the agent can call, then mark each one. A useful test is whether a person outside the company would notice if the agent got it wrong. A bad draft is noticed by nobody; a bad send is noticed by thousands, and it cannot be unsent.
| Option | Action name | What can go wrong | Guardrail |
|---|---|---|---|
| Write a draft email, post or ad | Action namecontent.draft_email, content.draft_post, content.draft_ad | What can go wrongNone until someone sends it. | GuardrailRuns free. Logged, not asked. |
| Edit CRM fields | Action namecrm.update, crm.update_bulk | What can go wrongA bulk edit can break segments and lead scoring. | GuardrailAllow crm.update (one record); ask on crm.update_bulk. A rule reads the action name, not the details, so bulk edits need their own name. |
| Send one email to one contact | Action nameemail.send | What can go wrongSmall. A wrong word reaches one person. | GuardrailAllow rule, once the record shows it is safe. Mail to anyone not yet a contact is a different action, asked. |
| Send a campaign to a segment | Action nameemail.campaign.send | What can go wrongThousands of people at once, and it cannot be unsent. | GuardrailAsk, routed to the campaign owner, with audience size, subject and first lines. |
| Publish a blog or social post | Action namecontent.publish_post, content.publish_article, content.publish_regulated | What can go wrongPublic, quoted and screenshotted. Claims need evidence. | GuardrailAsk the editor; regulated claims go as content.publish_regulated, two people. |
| Reply in public on social | Action namecontent.publish_reply | What can go wrongSpeaks for the brand in a thread you do not control. | GuardrailAsk. |
| Raise an ad budget or bid | Action nameads.budget.increase | What can go wrongSpends money every hour until someone notices. | GuardrailAllow small steps with a daily budget; ask above; deny huge. |
| Create a new ad campaign | Action nameads.campaign.create | What can go wrongNew spend, new audience, new claims. | GuardrailAsk, with targeting, budget and the creative. |
| Import a list or add contacts to marketing | Action nameaudience.import | What can go wrongMailing people who never agreed to it. | GuardrailAsk, with where the list came from. |
| Change consent or lift a suppression | Action nameaudience.consent.* | What can go wrongMailing someone who said no. | GuardrailNever. People only. |
| Delete contacts or segments | Action nameaudience.delete, audience.delete_segment | What can go wrongCan lose the record that someone unsubscribed. | GuardrailNever. People only. |
The names follow one family per kind of effect, so one rule can cover a family: content.draft* for everything that stays inside, audience.consent.* for everything that changes who may be mailed. There is more on that in naming agent actions, and the tool risk checker sorts a list of tools into tiers like these.
Permissions: one agent, one key, the smallest scope
Approval only means something if the agent cannot go around it. That starts with what the agent holds.
- Its own credentials for each platform. Never a marketer’s login or a shared admin token. An agent acting as a person makes its actions look like theirs, and the access leaves with them when they do.
- The narrowest scope each platform offers. An agent that reports on ads needs read access, not the right to change them. Meta’s Marketing API, for example, separates
ads_read(reporting) fromads_management(creating and changing campaigns). Where an email or social platform only offers all-or-nothing keys, keep the sending key out of the agent’s reach and let it call a small service of yours that asks first. - One approval key per agent. The content agent and the ads agent ask with different keys, so a rule written for one cannot be used by the other. In VariantGate a key can also be scoped to the actions it may ask about: the content agent’s key to
content.*, the campaign agent’s toemail.*,audience.*andcrm.*, the ads agent’s toads.*. - No tool for what nobody should automate. If the agent has no reason to delete contacts, do not give it the call. A rule is the second line, not the first.
The laws that shape the answers
Marketing has more written rules than most work an agent does. These are the ones that most often decide what must ask and what must never happen. They are a starting point, not legal advice: check the details for your markets with your counsel.
Consent for marketing email in the EU
The ePrivacy Directive (Article 13) allows marketing email only to people who gave prior consent, with one exception: a business may email its own customers about its own similar products, if they were offered an easy way to object when their address was collected and are offered it again in every message. Under the GDPR every use of personal data needs a lawful basis (Article 6); where that is consent, you must be able to show it was given (Article 7(1)), and withdrawing it must be as easy as giving it (Article 7(3)).
For the agent: an import asks, with where the list came from and what the people agreed to; consent changes and removals from the suppression list are never the agent’s to make; and it never adds back an address that unsubscribed.
CAN-SPAM in the United States
The FTC’s guide lists the requirements for commercial email: no false or misleading header information, no deceptive subject lines, identify the message as an ad, include a valid physical postal address, tell people how to opt out, and honour an opt-out within 10 business days. It also says to monitor what others do on your behalf, and penalties are counted per email. An agent sending for you is acting on your behalf.
For the agent: the campaign request shows the subject line and the first lines, so the reviewer can see whether they match what the email says, and the template holds the address and the unsubscribe link where the agent cannot edit them.
Claims in ads and posts
In the US, the FTC expects advertisers to have a reasonable basis for objective claims before they are published. In the EU, the Unfair Commercial Practices Directive treats false or deceiving information as misleading (Article 6), and lets authorities ask a trader for evidence of a factual claim and treat it as inaccurate without it (Article 12). A model writes fluent claims it cannot back up. Every factual claim in a request needs its source next to it, and a claim without one does not go out.
Reviews and testimonials
The FTC’s rule on consumer reviews and testimonials (16 CFR Part 465), in force since 21 October 2024, prohibits creating, buying or spreading fake reviews and testimonials, including ones attributed to someone who does not exist, such as AI-generated reviews. It also covers insider reviews that hide the connection and fake social media followers or views. An agent must never write reviews or testimonials. Give it no tool that posts them, and deny the action family, such as review.*, so a workaround is refused rather than asked about.
Disclosing AI-generated content in the EU
Article 50(4) of the EU AI Act has applied since 2 August 2026. It requires those who use AI to make a deep fake, meaning image, audio or video that resembles real people, objects, places or events and would falsely appear authentic, to disclose that it was generated or manipulated. It also covers AI-generated text published to inform the public on matters of public interest, unless a person reviewed it and someone holds editorial responsibility. Most product copy is not that kind of text, but a generated video of a real person or place in an ad can be a deep fake. A named editor approving each publish is the kind of review the exception describes; whether it is enough for a given publication is a question for counsel.
The pattern in code
Each risky tool asks before it acts, waits for the answer, 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 for every tool, 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 per agent: the ads agent has its own copy of this file, with its own name and key.
const approvals = new ApprovalClient({
agent: "campaign-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 reworded or narrowed it. 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");A person can approve a changed version, such as a reworded summary. The campaign tool can only send the campaign it described, so it treats a changed approval as a no and says so in the record. Outcome notes carry the error’s class, never its message, since other APIs put tokens and email addresses in theirs.
The campaign tool freezes the segment before asking, so the number the person approved is the list that gets mailed, and it puts the claims and their sources in the request. After the send runs it never throws: an exception there would invite the model to try again.
/** The tool the model calls to send a campaign. Returns what the model should read. */
export async function sendCampaign(campaign: Campaign): Promise<string> {
// Freeze the segment first, so the people approved are the people mailed.
const list = await esp.snapshotSegment(campaign.segmentId);
const answer = await askAndWait({
action: "email.campaign.send",
summary: `Send "${campaign.subject}" to ${list.count} contacts in ${campaign.segmentName}`,
details: {
segment: campaign.segmentName,
audience: list.count,
subject: campaign.subject,
"first lines": campaign.bodyText.slice(0, 300), // the body, not the preheader
preheader: campaign.previewText,
"send at": campaign.sendAt,
"claims and sources": campaign.claimSources,
},
ttlSeconds: 4 * 60 * 60,
});
if (!answer.go) return `Not sent: ${answer.why}. Do not send it another way.`;
const { id } = answer.decision;
let sendId: string;
try {
sendId = await esp.sendToList(campaign.id, list.id, campaign.sendAt);
} catch (error) {
await report(id, "failed", `may have gone through: ${kindOf(error)}`);
return "The send failed. Tell a person; do not retry on your own.";
}
// The send ran. Nothing below throws, so the model has no reason to send again.
await report(id, "succeeded", `send ${sendId}`);
return `Sent to ${list.count} contacts.`;
}The ad budget tool states the increase per day as the amount, in the campaign’s currency. That is what lets an amount limit and a daily budget apply to it. See spending limits for AI agents for more on limits.
/** Raises one campaign's daily budget. The increase is the amount the rules read. */
export async function raiseDailyBudget(campaign: AdCampaign, newDailyCents: number) {
const increaseCents = newDailyCents - campaign.dailyBudgetCents;
if (increaseCents <= 0) return "Use lowerDailyBudget to spend less.";
// The rules are in euros and refuse any other currency, so this tool handles euros only.
if (campaign.currency !== "EUR") return "Budget unchanged: ask a person.";
const euros = (cents: number) => (cents / 100).toFixed(2);
const answer = await askAndWait({
action: "ads.budget.increase",
summary: `Raise the daily budget of ${campaign.name} by ${euros(increaseCents)} ${campaign.currency}`,
amount: euros(increaseCents),
currency: campaign.currency,
details: {
campaign: campaign.name,
"daily budget now": euros(campaign.dailyBudgetCents),
"daily budget after": euros(newDailyCents),
"spent today": euros(campaign.spentTodayCents),
"cost per conversion, 7 days": campaign.costPerConversion7d,
},
});
if (!answer.go) return `Budget unchanged: ${answer.why}.`;
// Approved was the increase from the budget read above. If it moved while waiting, stop.
if ((await ads.getDailyBudgetCents(campaign.id)) !== campaign.dailyBudgetCents) {
await report(answer.decision.id, "failed", "not done: the budget changed while waiting");
return "Budget unchanged: it changed while waiting. Read it again and ask again.";
}
try {
await ads.setDailyBudget(campaign.id, newDailyCents);
} catch (error) {
await report(answer.decision.id, "failed", `may have gone through: ${kindOf(error)}`);
// It may still have gone through, so the model is told to check, not to retry.
return "The change may not have gone through. Tell a person; do not retry on your own.";
}
await report(answer.decision.id, "succeeded");
return `Daily budget is now ${euros(newDailyCents)} ${campaign.currency}.`;
}No-code agents get the same check from the n8n and Zapier steps, which stop the workflow unless the answer is yes.
Standing rules for a marketing workspace
Asking about everything wears people out. Standing rules answer the routine requests at once, so only the ones that need judgement wait. A set for the riskiest rows of the inventory above; add allow rules for the routine ones, such as single emails and CRM edits, once the record shows they are safe:
- Always allow content.draft*, for content-agentDrafts reach nobody, so they run at once and still leave a line in the record.
- Always ask about email.campaign.send, for the campaign owner, anyone after 2 hoursEvery campaign send waits for the person who owns campaigns. The agent asks for four hours, so escalation has time to happen.
- Always ask about content.publish*, for the editorBlog posts, social posts and public replies go to whoever answers for the brand.
- Always allow ads.budget.increase up to €50, €150 a day, for ads-agentSmall daily budget increases run at once, until €150 of increases have been approved by rule today. A larger step waits for a person.
- Never allow ads.budget.increase above €500A jump that large is made by a person in the ad platform. An increase that states no amount in euros is refused too.
- Always ask about content.publish_regulated, two people, for the editor and legalHealth, finance and other regulated claims need two people, routed to the editor and legal (workspace owners can always decide routed requests too). One denial stops it.
- Never allow review.*An agent never writes, buys or posts reviews or testimonials, so a workaround is refused, not asked about.
- Always ask about audience.importSomeone has to know where the addresses came from and what the people agreed to.
- Never allow audience.consent.*Changing consent or lifting a suppression is done by people, from the person's own request.
- Never allow audience.delete*Deleting contacts or segments stays with people, and so does the erasure process.
The same rules as API bodies
# POST /v1/workspaces/{workspace_id}/rules, one call per rule
{
"action": "content.draft*",
"agent_key_id": "CONTENT_AGENT_KEY_ID",
"effect": "allow"
}
{
"action": "email.campaign.send",
"deciders": [
"USER_ID_OF_CAMPAIGN_OWNER"
],
"effect": "ask",
"escalate_after_seconds": 7200
}
{
"action": "content.publish*",
"deciders": [
"USER_ID_OF_EDITOR"
],
"effect": "ask"
}
{
"action": "ads.budget.increase",
"agent_key_id": "ADS_AGENT_KEY_ID",
"budget_amount": "150.00",
"budget_currency": "EUR",
"budget_period": "day",
"effect": "allow",
"limit_amount": "50.00",
"limit_currency": "EUR"
}
{
"action": "ads.budget.increase",
"effect": "deny",
"limit_amount": "500.00",
"limit_currency": "EUR"
}
{
"action": "content.publish_regulated",
"approvals": 2,
"deciders": [
"USER_ID_OF_EDITOR",
"USER_ID_OF_LEGAL"
],
"effect": "ask"
}
{
"action": "review.*",
"effect": "deny"
}
{
"action": "audience.import",
"effect": "ask"
}
{
"action": "audience.consent.*",
"effect": "deny"
}
{
"action": "audience.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 budget jumps above €500 holds whatever else is allowed. Amount limits only ever work in the cautious direction: an increase stated in another currency, or with no amount, is not allowed by the small-steps rule, and the “never” rule refuses it. So with these rules a budget increase in any currency but the euro is refused outright, and the sample below only handles euro accounts. The daily budget is what stops an agent from raising a budget by €50 ten times in an afternoon. 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. The approval policy generator writes a first set from a checklist, and the rules reference has every option.
Who approves what
Route each kind of request to the person who already answers for it, not to whoever is online.
- Campaign sends: the campaign owner, who knows the segment and the calendar. Escalation lets anyone decide after a set time, so a send is not lost because one person is on holiday.
- Posts and public replies: the editor or social lead, who answers for tone and for what the brand says in public.
- Regulated claims: in finance, health, alcohol and other regulated fields, require two people, such as the editor and someone from legal or compliance. A rule reads the action name, not the text, so give regulated content its own action,
content.publish_regulated, with a two-person rule; one denial stops it. The tool’s code picks that name, by channel, product or a list of terms, never the model. See two-person approval. - Ad spend above the routine: the person who owns the budget, with the spend so far and the cost per conversion in the request.
Ask the agent to list every factual claim with its source in the request. A reviewer can check five links in a minute; finding the claims in a 900-word post takes much longer, and the list is what you will want if a claim is ever questioned.
What to measure, and how to keep approvals few
Three numbers show whether the guardrails fit the work. The approval rate per action: one that is approved every time is a candidate for a rule. Edits before approval: if reviewers keep rewording posts, fix the prompt or the brief, not the reviewer. And time to approve: a campaign that waits all afternoon for a yes teaches people to work around the check. VariantGate’s Insights shows the median time to decide, the share answered by rules and the requests nobody answered. More in measuring human in the loop.
When approving becomes a reflex, it stops being a check. Move routine asks into rules, keep the request short with the facts that matter first, and leave people only what needs judgement. See approval fatigue and standing rules.
If an agent starts going wrong, 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. A pause does not reach a send the email platform has already scheduled or started: stop that in the platform itself.
Checklist
- List every tool each marketing agent can call.
- Mark each: stays inside, reaches people, spends money, or changes who hears from you.
- Give each agent its own credentials and the narrowest platform scopes; remove tools it has no reason to use.
- Make every risky tool ask in code, and act only on
allowed: true. - Write rules: allow drafts, ask on sends and posts, cap spend; add allow rules for routine edits once the record shows they are safe.
- Deny consent changes, suppression removals and deletions.
- Route each request to its owner; two people for regulated claims.
- Never let an agent write reviews or testimonials; check where AI content must be disclosed.
- Review approval rate, edits and time to approve every month.
To see the inbox side before wiring anything up, try a request in the playground. The wider set of controls is in guardrails for AI agents, and data subject requests are covered in the data deletion and GDPR guide.
Sources
- Directive 2002/58/EC (ePrivacy Directive), Article 13: unsolicited communications
- Regulation (EU) 2016/679 (GDPR), Article 6 (lawful basis) and Article 7 (conditions for consent)
- FTC: CAN-SPAM Act, a compliance guide for business
- FTC: Policy Statement Regarding Advertising Substantiation
- Directive 2005/29/EC (Unfair Commercial Practices Directive), Articles 6 and 12
- FTC: Trade Regulation Rule on the Use of Consumer Reviews and Testimonials, 16 CFR Part 465 (Federal Register, 22 August 2024)
- FTC: Federal Trade Commission Announces Final Rule Banning Fake Reviews and Testimonials (14 August 2024)
- Regulation (EU) 2024/1689 (AI Act), Article 50: transparency obligations, and Article 113: dates of application
- Meta for Developers: Permissions reference, ads_read and ads_management