Most “AI runs your ads” pitches fall apart the moment you ask what the AI actually touches. Either it just writes copy, or it quietly burns budget on autopilot with no one watching. Neither is how a serious account should run. What we describe here is different: a Claude Code agent that does the real operational work on a Meta Ads account, builds campaigns, reads performance data, drafts creative, proposes changes, while a senior strategist approves every decision that spends money.
Claude Code is Anthropic’s agentic tool. It can reason over a problem, read data from connected systems, call external tools, and run multi-step tasks on its own. That capability is useful and also exactly why it needs guardrails. An agent with API access to a live ad account can do a week of work in an hour, including a week of damage. This walkthrough shows how we wire it up so the speed is real and the risk is contained.
We run this model daily inside our AI Meta Ads management service. The point is not to remove the human. It is to remove the slow, repetitive parts of the human’s day while keeping every spending decision under explicit approval.
Key Takeaways
- The agent operates, the human decides. Claude Code builds, analyzes, and proposes, but a strategist approves anything that publishes or changes spend.
- Guardrails are the product. Budget caps, approval gates, and a dry-run default matter more than the model's raw ability.
- It is not Advantage+. Advantage+ optimizes delivery inside Meta. The agent works one level above it, deciding structure, budget, and creative across campaigns.
- Tracking still rules everything. The agent is only as good as the Pixel and CAPI signal feeding its decisions, so clean measurement comes first.
Step 1: Connecting the account, with the right permissions
The first decision is access, and it is also the first guardrail. The agent connects to Meta through the Marketing API, not through someone’s logged-in browser session. That distinction matters: API access can be scoped, logged, and revoked cleanly.
We give the agent a system user token limited to the specific ad accounts in play. Read access to insights and entities is broad. Write access is deliberately narrow and gated behind approval, which we cover below. Every call the agent makes is logged, so there is an audit trail of what it looked at and what it changed. For a DSGVO-defensible setup, that trail is not optional, it is the evidence that a human stayed in control.
Step 2: Setting guardrails and approval gates
This is where most of the engineering effort goes, and rightly so. The model’s intelligence is the easy part. Containing it is the work.
We define guardrails as hard rules the agent cannot talk its way past. They live outside the prompt, in the tooling layer, so no clever instruction can override them. The core set looks like this.
| Guardrail | What it controls | Default behavior |
|---|---|---|
| Daily budget cap | Maximum spend the agent can set across all campaigns | Hard ceiling, cannot be raised by the agent |
| Approval gate | Any create, edit, or budget change | Queued for human review, never auto-published |
| Dry-run mode | How write actions are previewed | On by default, agent shows the diff before anything goes live |
| Change-size limit | How aggressively budgets can move per step | Capped at a set percentage per approval |
| Pause authority | Emergency stops | Agent may pause, but only a human may launch or scale |
The approval gate is the heart of it. When the agent decides to launch a campaign, raise a budget, or swap creative, it does not act. It produces a clear proposal: what it wants to change, the current numbers behind the decision, and the expected effect. A strategist reads that, approves, edits, or rejects. Only an approved proposal is pushed to Meta. This is the human-in-the-loop model in practice, and it is what makes the whole thing defensible.
Step 3: Building campaigns
With access and guardrails set, the agent can build. Given a brief, target market, offer, budget range, audience notes, it drafts a full campaign structure: campaign objective, ad sets with audiences and placements, and the ad shells ready for creative.
Here the agent earns its keep on speed and consistency. It applies the same naming conventions every time, structures ad sets to avoid audience overlap, and sets up the conversion event correctly against your Pixel and CAPI events. A task that takes a careful human an hour of clicking takes the agent minutes to draft. But it drafts. The build sits in the approval queue until a strategist signs off, because building campaigns is a spending decision in waiting.
Step 4: Generating and rotating creative
Creative is where volume usually breaks teams, and where an agent helps most. The agent drafts headline and primary-text variations against the brief and brand voice, proposes angles to test, and flags which existing creatives are fatiguing based on frequency and declining performance.
It does not invent your brand or your offer. It widens the funnel of ideas and handles the mechanical work of building variations into the right ad sets. A human still owns taste: which angles fit the brand, which images are on message, which claims are accurate. The agent proposes a rotation, the strategist approves the ones worth running, and the weak performers get queued for pause.
Step 5: Daily monitoring
This is the unglamorous work that an agent does tirelessly. Every morning it pulls the latest insights, compares them against targets and the prior period, and writes a plain-language read of what happened: which ad sets are pacing well, where cost per result drifted, what fatigued overnight, and any anomaly worth a human eye.
Because it reads the data directly through the API, the summary is current and consistent, not a screenshot someone half-remembers. The strategist starts the day with a briefing instead of an hour of dashboard archaeology. Nothing in this step spends money, so it runs without an approval gate, but everything it surfaces feeds the decisions that do.
Step 6: Proposing scaling and cutting
The payoff step. Based on the monitoring read, the agent proposes what to scale and what to cut. A winning ad set with stable cost per result and headroom gets a proposed budget increase, capped by the change-size guardrail. A losing ad set gets a proposed pause with the numbers that justify it.
Every one of these is a proposal, not an action. The strategist sees the reasoning, the current performance, and the expected effect, then approves or overrides. The agent may pause to stop the bleeding if a rule triggers, but it may never launch or scale on its own. Growth decisions stay human.
The agent's job is to make the right decision obvious and fast to approve. The human's job is to decide. Keeping that line sharp is what separates assisted operation from autopilot.
How this differs from Advantage+ and works with Pixel and CAPI
People often ask whether this just duplicates Advantage+. It does not, because they operate at different levels. Advantage+ is Meta’s in-platform automation: it optimizes delivery, placements, and combinations inside the boundaries you give one campaign. The Claude Code agent works a level above that, deciding what campaigns exist, how budget splits across them, which creative gets tested, and when to scale or cut. The agent can and does use Advantage+ as a tool inside a campaign it builds.
Both depend on the same thing: signal. The agent’s decisions are only as trustworthy as the conversion data behind them, which means a healthy Pixel firing browser-side and a CAPI feed sending server-side events for resilience against signal loss. If tracking is broken, the agent will confidently scale the wrong thing, just like Advantage+ would. That is why we treat measurement as the foundation, not an afterthought, and why this work sits next to our broader AI marketing automation practice rather than standing alone.
If you want a wider view of where agents genuinely fit a paid media stack and where the hype outruns the result, our guide to AI tools for performance marketing lays out the honest version.
Sources
- Meta for Developers, Marketing API overview and system user access tokens
- Meta Business Help Center, About Advantage+ campaigns
- Meta Business Help Center, About the Meta Pixel and the Conversions API
- Anthropic, Claude Code documentation on agentic tool use and permissions