>_ DevTrendsen

Language

Home

Languages

Sections

Frontend Backend Mobile DevOps AI / ML GameDev Blockchain Embedded Security
Python

How to Make Claude Safely Audit Ad Accounts Across 12 Platforms

Claude Ads banner

Trusting language models with production tasks is always a bit scary. When it comes to advertising budgets, the fear grows tenfold. One wrong move by an agent in the ad platform API, and a month's budget goes to the wrong targeting in a couple of hours. That's why most teams still copy exports manually and feed them into chatbot web interfaces, getting vague advice with no concrete numbers in return.

Recently stumbled upon an open-source repository claude-ads. The author tried to build a strict engineering system on top of Claude Code's agent capabilities. The idea is to turn Claude into a supervised performance marketing assistant with hard safeguards, type safety, and deterministic validation checks.

How it works diagram

Under the Hood

The project is a collection of skills and CLI tools written in Python. You can work with it through Claude Code, Cursor, Windsurf, Gemini, or Codex. The main focus here is on data security and predictability.

The system supports 12 advertising platforms:

  • Search and social networks: Google Ads, Meta Ads, YouTube Ads, LinkedIn Ads, TikTok Ads, Microsoft Advertising, Reddit Ads, Snapchat Ads, X Ads.
  • E-commerce and retail media: Apple Ads, Amazon Ads, Pinterest Ads.

Platform coverage

Instead of giving the model full freedom through uncontrolled tool calls, the project divides the workflow into isolated stages.

Security and Protection Against Accidental Charges

The claude-ads architecture runs in read-only mode by default. You can run audits, build hypotheses, generate ad copy, and analyze metrics without risking breaking live campaigns.

If optimization needs to be applied, the system requires passing several levels of checks:

  • Exact account and object IDs are explicitly specified.
  • A clear diff of the state before and after changes is generated with an impact zone assessment.
  • Strict budget limits are set that the agent fundamentally cannot exceed.
  • For each write request, an idempotency key and a rollback plan for changes are generated.

Full entity deletion operations are simply removed from the code in version two. API credentials don't end up in the model context, reports, or git history: they're read exclusively from environment variables or the system secrets store.

Architecture and Campaign Quality Assessment

Inside the repository, everything is divided into clear levels of responsibility.

Architecture

A single conductor process accepts user commands, defines scope boundaries, and distributes tasks to isolated workers. Each worker is responsible for a specific piece of analysis and outputs strict JSON according to a schema. If one of the required workers fails with an error, the entire run is marked as partial. The system won't mask the failure and present an incomplete report as a finished result.

The canonical output is versioned, validated JSON. From this, the utility assembles Markdown summaries, HTML pages, or PDFs via WeasyPrint.

Health score diagram

The ad account health scoring is interestingly designed. Each check has a status of pass, fail, unknown, or not_applicable. The completeness of collected data is evaluated separately from the overall health score:

  • If 80% or more of checks are covered, a full score is assigned.
  • With 60% to 79% coverage, the score is considered preliminary.
  • If data is less than 60%, scoring is not calculated at all due to insufficient evidence.
  • Beta features and unavailable platform features are excluded from calculations to avoid lowering the rating.

What Working with the Tool Looks Like

Demo GIF

Installation in Claude Code is done through the plugin manager:

/plugin marketplace add AgriciDaniel/claude-ads
/plugin install claude-ads@ai-marketing-hub-claude-ads

If you prefer local installation or use other environments:

git clone https://github.com/AgriciDaniel/claude-ads.git
cd claude-ads
bash install.sh --source=local

The installer supports Python 3.11 and 3.12 on Linux, macOS, and Windows. If system libraries are missing, the script will fail with an error before making any changes.

After installation, interaction is built around slash commands. For example:

  • /ads setup configures the client profile, target KPIs, acceptable budget boundaries, and privacy rules.
  • /ads audit all runs a full audit of connected channels with each output tied to dated metrics.
  • /ads plan calculates budget distribution, media plan, and split test plan.
  • /ads optimize --draft prepares a draft of bid and creative changes without applying them on the platform.
  • /ads report generates the final structured report.

Direct shortcuts for specific accounts also work: /ads google, /ads meta, /ads reddit.

Who the Project Will Be Useful For

The repository is unlikely to be needed by someone running a single ad with a budget of a few thousand rubles. But if your company runs multi-platform advertising or you're building internal automation for an agency, there's plenty to explore here.

Even if you don't use the tool in full, the source code claude_ads_core and directory structure control-plane/ provide a solid example of how to design reliable skills for LLMs. Instead of chaotic text prompts, the author implemented data contracts, validation schemas, and mandatory operator confirmation gates. The repository has an open license (MIT), so you can freely break down the code into your own modules.

Related projects