Can you give an AI agent real access to a client’s website without it breaking something? Yes, but the safety does not come from the prompt. It comes from three things you set up before the agent starts: a written brief that limits what it may touch, tools whose default behaviour is the safe one, and checks that run after it finishes and prove nothing broke.

We learned the second one the plain way. On 29 November a publishing agent called one of our own blog tools with its default settings, and the tool did exactly what its default said: it deleted the old featured images on ten posts. Those images were still used as banners inside the post bodies. Ten posts went live-ready with broken pictures. Nobody was careless. The default was wrong for that caller.

This guide covers what we now do at Wbcom Designs, written for two readers. If you own a site, or hire people to run one, the plain-English parts tell you what to ask for. If you build or operate agents, there is a signposted developer section with the actual defaults, flags and checks. Skip it if you like; the rest stands on its own.


Is it safe to give an AI agent access to a client site?

It is safe when the agent can only do what you have decided in advance, and when you can see afterwards exactly what it did. It is not safe when the only protection is a sentence in a prompt asking it to be careful.

Think of an agent as a fast, tireless contractor who has read a lot and has never seen your site before. It will do what you ask, it will do it confidently, and it will fill any gap in your instructions with a guess. The guess is usually reasonable. On a client site, “usually reasonable” is the problem, because the one unreasonable guess is the one that deletes something.

So the work is not making the agent smarter. It is shrinking the space in which a wrong guess can cause damage. We do that in three places:

  • The brief sets scope: what to read, what to touch, what to leave alone, how to report.
  • The tools carry safe defaults: preview before change, refuse when unsure, never delete by default.
  • The checks run after the work and look for the specific damage this kind of work causes.

We have written before about why written rules alone do not govern an agent, and that argument still holds. A brief is not a rule list the agent is asked to obey. It is a work order. The enforcement lives in the tools and the checks, and the brief tells the agent where the walls are so it does not waste time walking into them.


How do you write a brief for a coding agent so it stays in scope?

A good brief answers six questions before the agent writes a line: what is the goal, which files or pages are in scope, what must it read first, what is it not allowed to do, how will it prove it is done, and what shape should the final report take. If any of those is missing, the agent will invent an answer.

We keep briefs as files, not chat messages. A file can be reviewed, reused, diffed and handed to several agents at once. The brief for a run of blog posts is a short document with the same bones every time:

  • A list of rule files the agent must read first, by path. The brief says “read these files, do not re-derive the rules”, so the rules live in one place and the brief does not drift from them.
  • The exact scope: which site, which items, in which order, one at a time.
  • Explicit output paths. Drafts go to one named folder, screenshots to another, and nothing is written into the folder the agent happens to be standing in.
  • Which browser tool the agent may use. When agents run in parallel, each one gets its own browser server so two agents never fight over one window.
  • A report format, short and fixed: what was done, the IDs and URLs, the checks run, and any failures.
  • What the agent must not do. In our publishing briefs that is a flat line: no social posts from the agent, and the main session distributes after review.

Why the report format matters more than people expect

A fixed report format is a safety tool, not a courtesy. When every agent returns the same fields, a person can scan five reports in a few minutes and spot the one where a field is missing or a number looks off. When each agent writes its own free-form summary, the problems hide in the prose.

It also changes the agent’s behaviour. An agent that must list “checks run” and “failures” cannot quietly skip a check and still produce a tidy answer. The empty field is visible.

Tell the agent what to read, not just what to do

Most damage we have seen from agents comes from missing context, not from malice or even carelessness. The agent did not know a banner image was reused in a post body. It did not know a post was scheduled for next week. Naming the files to read first, and keeping those files short and current, closes much of that gap with little effort.

We keep our skill files small for the same reason. A skill that loads everything every time crowds out the task. We cap them at roughly 500 lines and move detail into reference files that load only when needed, which we describe in how Claude Code skills stay small. Official guidance gives the same advice: the Claude Code skills documentation, read on 1 December 2026, says to keep SKILL.md under 500 lines and move reference material to separate files.

The “do not” list is short on purpose

A brief with forty prohibitions gets skimmed. We keep the “do not” list to the handful of things that would hurt: no outward actions such as posts or messages, no deleting, no touching paths outside the named folders, no bypassing a failed check. Everything else is covered by scope. If it is not in scope, it is out.


Does Claude Code plan mode stop an agent from damaging a site?

Plan mode helps with the thinking step, but it is a session setting, not a guarantee about what a remote tool will do. Use it to review the approach before work starts, and rely on tool defaults and checks for protection once work is running.

What it does, according to the Claude Code permission modes documentation (read 1 December 2026): plan mode tells Claude to research and propose changes without making them. Claude reads files, runs commands to look around, and writes a plan, but does not edit your source, and edits stay blocked until you approve the plan.

That is valuable for client work in a specific way. A plan is a chance for a person to say “no, not that file” before anything changes. We use that moment the way a developer uses a code review on a design, not on a diff.

Where plan mode stops being the answer is anything beyond local file edits. A tool on a remote server has its own behaviour and its own defaults. If a tool deletes the old image by default, approving a plan that says “replace the featured image” approves the deletion too, because the plan did not mention it and the person reading the plan did not know. The 29 November incident fits that shape exactly. Nothing was wrong with the plan. The surprise was inside the tool.

So the order we use is: plan first for the approach, then a brief for scope, then tools that are safe by default, then checks afterwards. Plan mode is the first layer, not the whole stack.


Why do tool defaults matter more than the prompt?

Because an agent calls a tool the way the tool’s description tells it to, and most of the time it leaves optional settings alone. Whatever the default does is what will happen, thousands of times, with nobody reading each call.

Here is the incident in full, because the details are what make it useful.

Our blog tooling has an action that attaches a new featured image to a post. It has an option to delete the previous featured image after the swap. The option’s documented default is on. That default makes sense for the case it was designed for: a post has one old featured image that nothing else uses, so tidy it away and keep the media library clean.

On 29 November a publishing agent ran that action across a batch of posts and left the option alone. On ten of them, the old featured image was also used as a banner inside the post body. The tool deleted the file. The posts now pointed at images that no longer existed.

We found it, and then we did four things:

  1. We repointed each of the ten banners to the new image.
  2. We re-checked all of them and confirmed zero missing media references.
  3. We changed our briefs so every featured-image call passes the delete option as false.
  4. We wrote the trap into the gotchas section of our publishing skill, so the next agent reads it before it starts.

Notice what we did not do. We did not add a sentence to the prompt saying “be careful with image deletion”. That sentence would have been one more line among many. We changed what gets passed to the tool and we recorded the trap where the next run will read it.

The wider lesson about tools built for an unreliable caller

A person calling a tool reads the description, notices the word “delete”, and thinks twice. An agent calls it from a template. Designing a tool for an agent means assuming the caller will do the plausible thing, not the careful thing, and making the plausible thing safe.

The Model Context Protocol specification (tools section, read 1 December 2026) says as much in its own way. It states that there should always be a human in the loop with the ability to deny tool invocations, that servers must validate all tool inputs, apply access controls and rate limit invocations, and that clients should show tool inputs to the user before calling the server. It also says clients must treat tool annotations as untrusted unless they come from a trusted server. In other words, a tool describing itself as harmless does not make it harmless, and the protocol does not let you outsource that judgement to the label.


What should a safe MCP tool for WordPress do by default?

It should do the least destructive useful thing when the caller says nothing extra. Concretely: preview instead of change, refuse when the target is ambiguous, and make every deletion an explicit opt-in.

This is the developer section. If you are not building or running agent tools, jump to the next question.

For developers: the defaults we use and where they come from

We maintain a handful of MCP servers for WordPress work, including a site-diagnostics server and a malware-cleanup server. Their safe defaults are not a style choice. They came from asking what the worst plausible call would do.

PatternWhat the tool does by defaultExample in our servers
Confirm gateWithout confirm=True, the tool returns a preview of what it would do and changes nothing.Twelve tools in our site-diagnostics server take confirm: bool = False, covering cache flush, database optimise, orphan cleanup, rewrite flush, file-permission fix and error-log clear.
Preview twinA separate read-only tool shows the change before the write tool exists in the plan.Search-replace has a preview tool that runs the replacement with the WP-CLI dry-run flag and reports only what would change.
Destructive means explicitThe docstring says DESTRUCTIVE, says what is lost, and the default returns a preview.Removing a site from the registry also deletes its history database. Without confirm=True it only previews.
Gates covered by testsA test asserts that calling the tool without confirm returns a preview and never reaches the server.Our malware-cleanup server has a test file of nine tests for its confirm gates, which fire before any SSH call is made.
Incomplete is an errorA run that could not finish says so, instead of returning a green result for a half-done job.The diagnostics server marks such calls as INCOMPLETE errors.

One more fact worth owning. The confirm gates in our malware server were added after the fact. Four tools that used to run destructive operations without any confirm parameter were changed so that omitting it returns a preview manifest instead. We did not start with the safe version. We found the unsafe ones and fixed them, and the tests exist so that nobody quietly removes the gate later.

The 29 November media tool is the same story from the other side. Its default of deleting was documented in its own schema, so the agent was not misled. The default was simply unsafe for a caller that does not know what else points at the file. The fix we applied is on the caller side, in the brief. The cleaner fix is on the tool side: a deletion that is off unless asked for, or one that checks for other references first. Both are fair. The point is that someone decides, in advance, which side owns the safety.

Permission rules are a second fence, not the first

Claude Code lets you allow or deny tools by name, including MCP tools. The permissions documentation (read 1 December 2026) says a rule written as mcp__server__* matches every tool from that server, a full name like mcp__server__tool matches one tool, and an unanchored allow glob such as mcp__* is skipped and approves nothing. Deny and ask rules are how you keep a risky tool out of reach even when the server offers it.

We treat these rules as a seat belt. They stop the agent from calling a tool you never meant to expose. They do not tell you what a tool does once it is called, so they sit beside safe defaults, not in place of them.


What can an agent repair on its own, and where does a person sign off?

An agent can run checks and apply low-risk, reversible fixes by itself. A person signs off on anything that deletes data, changes who can log in, or cannot be cleanly undone.

We have gone deeper on this in can AI replace a website maintenance retainer, so here is just the line we draw on client sites.

Agent handles alonePerson signs off first
Health checks, update checks, reading error logsDeleting users, including suspected rogue admins
Previewing a search-replace or a cleanupRunning the real search-replace on a live database
Flushing a cache or rewrite rules after a previewReinstalling a plugin or core on a live site
Scanning for malware and reporting findingsQuarantining or removing files the scan flagged
Backing up the database before any changeResetting passwords or regenerating keys, which logs everyone out

The pattern is easy to state. Reading and previewing are free. Reversible, low-impact writes are fine with a preview first. Anything that removes, resets or replaces something a client depends on goes to a person, who sees the preview and decides.

With malware work this matters twice. A scan produces findings, and findings include false positives. An agent that deletes everything a scanner flags will eventually delete a legitimate file. We keep scanning and cleaning as separate steps with a human between them.

Backups are part of the brief, not an afterthought

Before any write that touches a database, the brief says take a backup and say where it is. A backup that exists only in the agent’s memory of having taken one is not a backup. The report lists the path.


How do you keep secrets out of agent configs?

Keep each token in one file, give tools the path rather than the value, and make each token narrow enough that losing it is survivable. The agent config then holds references, and there is nothing in a log or a chat for anyone to copy.

We covered the full set of rules and the places secrets leak in keeping tokens out of agent logs and chat, so this is the short version for client work: never paste a client’s credentials into a brief. The brief names the site and the registry entry. The tool looks the credential up itself, at the moment it needs it, and never prints it back.

Pinning is the other half. An MCP server you installed last month may behave differently today if it updates under you, which we wrote up in pin, test, watch. A tool default can change in an update just as easily as a bug can appear. If a safe default matters to you, a daily test that asserts it is the way to notice when it stops being true.


What checks catch damage after an agent finishes?

The useful checks are narrow and specific to the damage the work can cause. A generic “looks fine” pass misses the exact failure that happens. Ask what this kind of run tends to break, and write a check for that.

Two examples from our own publishing work show the idea.

Check one: no missing media references

After the 29 November cleanup we did not stop at repointing the ten banners. We ran a check across the posts for any image reference that no longer resolved, and the answer had to be zero. The check exists because the damage has a precise shape: a reference to a file that is gone. Looking for exactly that is faster and more reliable than reading ten posts by eye.

In the same run, 26 internal links pointed at posts scheduled for later dates. Those links would have returned a 404 until the scheduled posts went live. The agent had linked to them because, from its point of view, they existed in the system. A script now finds links to scheduled or unpublished posts and removes them before publish.

Both checks are small. Neither needed clever tooling. What they share is that each came from a real failure and each tests for one named thing.

Make the agent report its own checks

The report format in the brief includes the checks run and their results. When an agent says “zero missing references” it should say how it found out. If the answer is “I assumed”, that is a failure. We ask for the result and the method in one line each.


A one-page checklist for giving an agent access to a client site

Use this before you hand an agent real access. If you cannot tick a line, that line is where the first problem will come from.

Before the run

  • The brief is a file with goal, scope, files to read first, a short do-not list and a report format.
  • Outward actions (posts, emails, messages, deploys) are excluded from the agent’s scope and done by a person after review.
  • Output paths are named. Nothing is written to the agent’s working folder by default.
  • A backup exists for anything the run can change, and the path is in the brief.
  • Each tool the agent will call has been read for its defaults, especially anything that deletes, resets or replaces.
  • Credentials are referenced by path or registry name, never pasted.

During the run

  • Writes use a preview first wherever the tool offers one.
  • Deletion options are passed explicitly as off unless a person decided otherwise.
  • Permission rules deny any tool that should be out of reach, even if the server exposes it.

After the run

  • The report arrives in the fixed format, with checks run and failures listed.
  • Damage-specific checks pass: missing references, dead links, broken forms, whichever apply.
  • Anything the agent could not finish is called out as incomplete, not rounded up to done.
  • A person signs off on removals, user changes and password resets.
  • The trap or surprise, if any, is written into the skill or notes so the next run reads it first.

Frequently asked questions

Should an AI agent ever get admin access to a client site?

Only with the narrowest account that can do the job, and only when every destructive tool is gated by a preview or a confirm step. Admin access without those gates means one wrong call can do admin-sized damage.

Is a long prompt enough to keep an agent in scope?

No. A long prompt is easy to skim past, and the agent can still call a tool whose default does something you did not expect. Use a short brief for scope and put the real protection in tool defaults and checks.

What is the first thing to check in an MCP tool before using it on a live site?

Read its optional parameters and note which ones default to destructive. Look for words like delete, remove, overwrite and replace, and see what the default value is. If it deletes by default, pass the safe value explicitly or choose a different tool.

How do we know an agent did not quietly skip a check?

Make the checks part of the required report. A report with a blank “checks run” field is visibly incomplete, which is far easier to catch than a skipped step buried in a long summary.

Do agents make a maintenance retainer unnecessary?

They take over routine reading, scanning and reporting. The decisions and the accountability for a client’s site stay with people. We explain the split in detail in our post on AI and maintenance retainers.

What do we do when an agent does cause damage?

Fix the damage, prove the fix with a check that names the failure, change the brief or the tool so it cannot repeat, and write the trap down. That is exactly what we did on 29 November, and it took the four steps listed above.


If you want help setting this up

If you run client sites and want agent access set up with these guards in place, our team builds MCP servers with safe defaults and sets up AI agent workflows around them. For ongoing care of a live site, see our WordPress maintenance service.


Sources

  • Claude Code documentation, “Choose a permission mode” (plan mode), code.claude.com/docs/en/permission-modes, read 1 December 2026.
  • Claude Code documentation, “Configure permissions” (MCP tool rules), code.claude.com/docs/en/permissions, read 1 December 2026.
  • Claude Code documentation, “Extend Claude with skills” (SKILL.md under 500 lines), code.claude.com/docs/en/skills, read 1 December 2026.
  • Model Context Protocol specification, Tools (human in the loop, security considerations, annotations), modelcontextprotocol.io/specification/latest/server/tools, read 1 December 2026.
  • First-hand: our own publishing run on 29 November, our diagnostics and malware-cleanup MCP servers, and our written briefs.