1---2name: agent-guardrails3description: >-4 Checks an AI agent's access to an ad account (Google Ads, Microsoft Ads, LinkedIn, Meta, Reddit, ChatGPT Ads)5 before it acts: read-only first, a reviewed trial of its suggestions before any write access, a reasoning log that6 matches the platform's change history, before-values for every change, and people, never the agent, on budgets,7 bids, bid strategies, targets, billing and user access. Audits the log against the change history with a script.8 Returns PASS, PASS WITH NOTES, FAIL or BLOCKED with severities. Use it before connecting an agent, MCP server or9 automation to an ad account, before widening its access, and monthly while it runs. Not for auditing the account's10 performance (use search-terms-triage or lead-value-math).11license: MIT12compatibility: >-13 Works in Claude, ChatGPT, Codex, Cursor and any agent that reads SKILL.md. Reads the agent's setup, permissions and14 logs from what the reader shares; uses a connected ad account only to read its change history. Python 3 is15 optional, for the log audit.16metadata:17 author: SHAKEUP18 version: "1.0.0"19 stage: check20 plugin: paid-media21 homepage: https://www.shakeuphq.com/skills/agent-guardrails22---23 24# Ad account guardrails25 26Makes sure an AI agent can only do what a person has agreed to, and that every change it makes can be explained and reversed.27 28## Purpose29 30- One job: check one agent's access to one ad account (or one set of accounts) and return pass or fail with severities and fixes.31- Stage: check. It ends in a verdict.32- It never grants, removes or changes access, and never changes the account. It recommends; the reader applies.33- It holds one rule above all: budgets, bids, bid strategies, targets and bid adjustments stay with people.34 35## Use when / not36 37| Situation | Use |38| --- | --- |39| Before connecting an agent, MCP server, script or automation to an ad account | this skill |40| Before giving an agent write access, or more of it | this skill |41| Monthly, while an agent runs, to reconcile its log with the change history | this skill |42| Reviewing the account's performance | `search-terms-triage`, `lead-value-math` |43| Running the weekly ad operations as an agent | `adops-agent`, which runs this check first |44 45## Inputs46 47| Input | Required | Ways to provide, in order | If missing |48| --- | --- | --- | --- |49| What the agent can do: its permission level on each platform, and the tools or functions it can call | yes | the agent's configuration or tool list; the platform's user access page; the reader's description | ask once; `BLOCKED` |50| Who reviews and approves its changes, and how (per change, per batch, after the fact) | yes | the reader | ask once; without a named person, every write path is critical |51| The agent's reasoning log | no (yes once it can write) | a CSV or JSON lines export; pasted rows | logging is checked from the description only; with write access, the missing log is critical |52| The platform's change history for the same period | no (yes once it can write) | a connected account (read); the change history export | reconciliation not run, coverage `partial` |53| The trial record: how long suggestions were reviewed, and how many were accepted | no | the reader | write access without a recorded trial is a warning |54| How credentials are stored | no | the reader | ask; never ask for the credential itself |55| The data sources the agent reads, and whether each is described to it | no | the reader; the agent's instructions | warning |56 57## Profile read58 59From `company-profile.md`: `## Accounts and data` (ad accounts, connected tools), `## Channels` (owners: the people who should approve), `## Targets` (max CPL, so a spend-related action can be sized), and every `## Learnings` entry for `agent-guardrails` with status `noted`, `fact` or `accepted`.60 61No profile: ask in one message for the platforms, who owns each account, and who approves changes. Say that `company-profile` saves this next time. Never ask for passwords, API keys or tokens, and tell the reader not to paste them.62 63## Steps64 651. **Apply learnings.** A past incident (an agent change that wasn't logged, a runaway rule) raises its severity. Name each one that fires.66 672. **Map the access** to the tiers. Every action the agent can take falls in one tier:68 69 | Tier | What the agent may do | Who acts |70 | --- | --- | --- |71 | 0 Read | read reports, search terms, settings and the change history | the agent |72 | 1 Draft | write proposals to a sheet, a document or Editor files; create items only as paused drafts that can't serve | the agent drafts; a person applies |73 | 2 Apply with approval | add negatives, pause keywords or ads, add paused ads, each batch approved by a named person before it applies | a person approves; the agent applies and logs |74 | Never | change budgets, bids, bid strategies, targets or bid adjustments; enable campaigns, ad groups or ads; change conversion settings or tracking; billing; user access | people only, at every tier |75 76 Use the platform's least access that covers the tier: a read-only role for tier 0 and 1. Platforms name roles differently; read the user access page and record the role.77 783. **Check the path to each tier.**79 80 | Check | Pass when | Why |81 | --- | --- | --- |82 | Read only first | the agent started at tier 0 or 1 | its suggestions can be judged before they can cost anything |83 | Trial before write | before tier 2, its suggestions were reviewed for at least 2 weekly cycles, with what was accepted and rejected recorded | one cycle can't show it is consistent |84 | Named approver | each tier 2 action has a named person who approves it before it applies | someone owns every change |85 | Never list enforced by access | the agent's role or tool list can't reach the never list, not only its instructions | an instruction can be ignored; a missing permission can't |86 | Official integration | the agent uses the platform's official API or a connector built on it, not browser automation | automated activity outside official routes risks policy violations and account bans |87 884. **Check the log.** Every proposed or applied change has: time, account, entity, field, before-value, after-value, the reason with the data behind it, who approved, and whether it applied. Run `python3 scripts/audit_log.py --history change_history.csv --log agent_log.csv --agent-user <the agent's user>`: it finds budget or bid changes by the agent, changes the history shows that the log doesn't, log values that don't match the history, logged changes the history doesn't show, missing reasons, approvals and before-values, and the same setting changed more than once in 7 days. Without Python, match each agent row in the history to a log row by entity, field and day, by hand, and say so.89 905. **Check the limits.**91 92 | Check | Pass when | Why |93 | --- | --- | --- |94 | Rate limit | no setting is changed more than once in 7 days | a change needs 7 days before it can be judged; faster changes make results unreadable |95 | Batch size | each approved batch is small enough for the approver to read every line | a batch nobody reads is not approved |96 | Rollback | every change has a before-value, so it can be reversed | a change without one can't be undone cleanly |97 | Kill switch | a named person knows how to revoke the agent's access in one step, and where | stopping it shouldn't need the person who built it |98 | Tool surface | the agent exposes no more than about 12 tools or functions, each with one job | practitioners report agents getting worse past roughly 10 to 12 functions; a small core set is easier to check |99 | Data described | each data source the agent reads is explained to it (for example, "conversions are form fills, not opportunities") | without it, the agent optimizes the wrong thing confidently |100 | Credentials | tokens stored in a secrets store, scoped to the accounts it needs, never in the profile, a chat or a shared document | a leaked token is full access |101 1026. **Write the fixes.** For each finding: the severity, what was found, and the fix (remove the permission, move the action to a person, add the field to the log, set the rate limit).103 104## Check and verdict105 106Severity:107 108| Severity | Findings |109| --- | --- |110| critical | the agent can reach anything on the never list; write access with no named approver; write access with no reasoning log; a change in the history the log doesn't show; a log value that doesn't match the history; a change without a reason; credentials in a profile, chat or shared document |111| warning | write access without a recorded trial; no rate limit, or a setting changed twice in 7 days; changes without before-values; no kill switch named; more than about 12 tools; data sources not described; an unofficial integration; a logged change the history doesn't show; no change history to reconcile against while the agent can write |112| suggestion | anything that would make review faster, such as alerts on new changes or a separate log per account |113 114| Verdict | Condition (first match wins) |115| --- | --- |116| `BLOCKED` | What the agent can do is unknown after one question |117| `FAIL` | 1 or more critical findings |118| `PASS WITH NOTES` | Warnings or suggestions only |119| `PASS` | No findings |120 121Named stops: `BLOCKED` asks for the agent's permissions and tool list. `FAIL` says the agent should stay at, or go back to, read-only until every critical finding is fixed. No other stops.122 123## Learn124 125Append to `## Learnings` when:126 127- an incident happens (an unlogged change, a change that cost conversions, a runaway rule): a `fact` with the date, the change and the fix;128- the agent moves up a tier: a `fact` with the trial record and who approved it;129- the reader accepts a warning as a known risk: a `fact` with their reason and a review date;130- a monthly audit passes with no findings 3 times in a row: a `proposal` to widen the batch size, never the never list.131 132Example: `- 2026-10-24 | agent-guardrails | fact | The agent's MCP server exposed a budget function; removed and access set to read only | Why: monthly audit found 1 budget change by the agent user on 2026-10-01 | Status: noted`133 134## Output135 136```137Verdict: <PASS | PASS WITH NOTES | FAIL | BLOCKED> · Coverage: <complete | partial (what wasn't available)> · Log audit: <script | by hand | not run>138Counts: <n> critical, <n> warnings, <n> suggestions139 140Access map141| Platform | Role | Tier | Actions it can reach | On the never list? |142 143| Severity | Check | Found | Fix |144(critical first)145 146Log audit: <agent changes, log entries, unlogged, mismatches, budget or bid changes, too frequent>147Next tier: <what must be true before it moves up, or "stay at read only">148Learnings applied: <list, or none>149```150 151Then the handoff block.152 153## Hand off154 155```handoff156skill: agent-guardrails157version: 1.0.0158verdict: PASS WITH NOTES159coverage: complete160for: <agent> on <accounts>161outputs:162 tier: 1163 critical: 0164 warnings: 2165 never_list_enforced_by_access: true166 next_tier_when: 2 weekly cycles of suggestions reviewed and recorded167next: [adops-agent]168open: [name a kill switch owner]169```170 171`adops-agent` runs this check before each run and works only at the tier it returns.172 173## Failure modes174 175| Problem | Do this |176| --- | --- |177| The reader pastes an API key or token | Don't repeat or store it; tell them to rotate it and keep it in a secrets store |178| The agent's tools are hidden behind a vendor's product | Ask the vendor for the list of actions it can take on the account; until then, treat every action the role allows as reachable |179| The change history shows a person's change the log attributes to the agent | Mismatch: the log is unreliable until fixed |180| The agent changes bids through an automated rule the reader created | Still a bid change by an automation: on the never list, critical |181| The platform's change history only covers a short period | Reconcile what exists, say the period, and audit monthly so nothing falls out of the window |182 183## Influenced by184 185- Frederick Vallaeys' PPC Town Hall conversation with Benjamin Wenner on agentic PPC in practice (Optmyzr): start in read mode, review an agent's suggestions before letting it act, compare its reasoning logs with what actually changed, keep a small set of functions, and keep budgets and bids under human control: https://www.optmyzr.com/ppctownhall/what-agentic-ppc-actually-looks-like-in-practice/186- SHAKEUP's B2B Google Ads playbook: a change log with the reason and the expected result for every change, one change at a time, 7 days before judging it, and budget allocation as a human decision.