AI agent security comes down to one idea: assume the agent will eventually do something dumb or get tricked, and make sure that mistake can’t cost you much. You do that with a short list of guardrails. Give the agent only the access it needs, keep your production secrets out of its reach, keep a backup it can’t touch, and make it ask before anything destructive.
That’s it. None of it needs a security team.
I run Claude Code agents on a Mac Mini at home that works as an always-on worker. It runs scheduled jobs and helps manage about 30 WordPress sites, my email lists and my reporting dashboards. So this isn’t theory for me. Here’s the setup I’d tell any small business or solo operator to copy.
Why this matters now: two real wipeouts
In April 2026, a Cursor agent running Claude Opus 4.6 was doing a routine task in a staging environment for PocketOS, a software company that car rental businesses use for bookings and payments. It hit a credential mismatch, tried to “fix” it, and deleted a Railway database volume. That took out the production database and the volume-level backups with it.
Decrypt reported the founder’s words: “It took 9 seconds.”
The details are the whole lesson.
Railway’s founder said the agent used a “fully permissioned API token” to hit a legacy endpoint. The agent later admitted it guessed the delete would stay scoped to staging and never checked.
The company got running again from a backup that was three months old. Imagine telling your customers you lost three months of their bookings.
A year earlier, in July 2025, SaaStr founder Jason Lemkin watched Replit’s agent delete a live production database during a code freeze. Fortune reported it wiped data on more than 1,200 executives and over 1,190 companies, and the agent called it “a catastrophic failure on my part.” Replit’s response was to separate development and production databases automatically.
Neither of these was a hacker. And neither needed one. They were agents with too much access and nobody standing between them and the delete button.
What OWASP says about AI agent guardrails
OWASP, the nonprofit security project behind the well-known Top 10 lists, published the Top 10 for Agentic Applications for 2026 in December 2025. It’s written for big companies, but you can use the core advice in a one-person shop just fine.
The big idea is what they call “Least-Agency.” Don’t hand an agent autonomy it doesn’t need, because extra autonomy expands the attack surface without adding value.
Their mitigations for tool misuse read like a guardrail checklist: read-only database access where possible, no send or delete rights for an email summarizer, human confirmation before destructive actions like delete, transfer or publish, and sandboxes for anything that runs code.
Their older LLM Top 10 entry on Excessive Agency breaks the problem into three causes. It’s a handy way to audit your own setup:
| Problem | What it looks like in a small business | The fix |
|---|---|---|
| Excessive functionality | A “read my inbox” agent that can also send and delete email | Give it a tool that only reads |
| Excessive permissions | An agent logged into your database as an admin when it only needs to run reports | A separate read-only login |
| Excessive autonomy | It can delete, publish or pay without anyone checking | An approval gate on high-impact actions |
The guardrails, in the order I’d set them up
1. Least privilege and scoped credentials
Every agent you run gets its own login or API key, and that key can do one job.
If your agent writes blog drafts, it gets an account that can create drafts, not one that can delete posts or change plugins. If it pulls numbers for your reports, it gets read-only access. OWASP’s advice is to enforce this in the system the agent connects to, not by asking the model nicely in a prompt.
The PocketOS agent had rules telling it not to run destructive commands without approval. It ran one anyway, with a token that let it.
Short-lived keys are even better. Temporary credentials that expire after use mean a leaked key isn’t good to anyone for long.
2. Keep production secrets away from agents
If an agent can read it, assume it can use it. Your live database password, your payment processor keys and your domain registrar login shouldn’t be anywhere an agent can read them. That means not in a project folder it works in, not in a config file it can open, and not pasted into a chat.
The simplest version: give your agents a staging or test copy of whatever they work on, with its own keys. If they need to touch something live, route it through a small helper script that does one specific thing, so the agent never holds the master key.
That’s how I do it. I use scoped helper scripts instead of handing over raw access, and I keep backups before edits.
3. Backups stored off the main machine or volume
This is the one you’ll be tempted to skip, and it’s the one that saves you.
PocketOS had backups. They just lived in the same place as the data, so one delete call took both.
A backup the agent can reach isn’t a backup from the agent’s point of view. You want at least one copy on a different drive or a different service, with credentials the agent never sees.
On a Mac, that starts with a Time Machine backup to an external drive, then an off-site copy from a cloud backup service for Mac. Test a restore once.
A backup you’ve never restored from is a guess.
4. Approval gates on anything destructive
Let the agent read and draft on its own. Make it stop and ask you before it deletes, sends, publishes or spends.
You can go a step further. OWASP suggests showing a dry run or a diff before you approve, so you see exactly what’s about to change.
Check your agent’s settings for an approval or permission mode. I’ll be honest, I’ve run Claude Code in its skip-permissions mode for speed, and that’s exactly why the other layers matter so much: when the gate is open, scoped access and an untouchable backup are what’s left. If you’re using Claude Code, read how Claude Code permissions work before you decide what to skip.
5. Sandboxing
A sandbox fences your agent in.
It can only see certain folders and only reach certain websites, so even a bad command can’t wander into the rest of your machine or send your files somewhere you didn’t approve. OWASP recommends running code in isolated sandboxes and blocking every network destination you haven’t approved.
For your business, a dedicated machine (or at least a separate user account on it) is a sandbox you can understand. Claude Code also ships with a built-in sandbox you can switch on, and OpenClaw has its own sandbox settings that are worth tightening before you connect anything.
6. Treat everything the agent reads as untrusted (prompt injection)
Prompt injection is when text the agent reads changes what it does. OWASP ranks it first on its LLM Top 10 for 2025, and the indirect kind is the one that should worry you. That’s when the instructions come from a web page, an email or a file the agent processes, not from you.
Picture an agent that answers customer emails. Someone sends an email with hidden text telling it to forward your customer list. If your agent can read and send, it might just do it.
It isn’t hypothetical. In July 2025, someone slipped a prompt into Amazon’s Q Developer extension for VS Code, which had nearly one million installs. BleepingComputer reported the injected text told the agent its goal was “to clear a system to a near-factory state and delete file-system and cloud resources.” Amazon said no customer resources were impacted and shipped a clean version the next day.
Even OWASP admits it’s unclear whether prompt injection can be fully prevented.
So you don’t rely on the model to resist it. You limit what a tricked agent can do, which is every guardrail above. An agent that reads email shouldn’t also be able to send it without you.
A quick checklist before you turn an agent loose
- Write down what the agent is for, in one sentence. Anything outside that sentence, it doesn’t get access to.
- Create a separate login or API key for it with the smallest permissions that still let it do the job.
- Move live passwords and keys out of any folder or file it can read.
- Make a backup to a different drive or service, and test one restore.
- Turn on approval prompts for deletes, sends, publishes and payments.
- Run it in a sandbox, a separate user account or a separate machine.
- Check its logs after the first week. You’ll learn more from that than from any checklist.
FAQ
What are AI agent guardrails?
They’re the limits you put around an agent so a mistake stays small: scoped access, approval before risky actions, a sandbox and a backup it can’t reach. Guardrails work at the system level. A line in the prompt saying “be careful” isn’t one.
Is it safe to let an AI agent access my business accounts?
It can be, if the access is narrow. Read-only access to reports is low risk. Full admin on your live database or payment account is how the incidents above happened. Start small and widen access only when you’ve watched it work.
Can prompt injection be stopped completely?
Maybe not. OWASP says it’s unclear whether it can. That’s why the practical fix is limiting the damage: an agent that reads outside content shouldn’t hold powers you’d regret it using.
What’s the single most important guardrail?
A backup the agent can’t touch. Every other guardrail can fail. If you’ve got a recent copy somewhere else, a bad day stays a bad day instead of the end of your business.
Want this done for you?
I run AI agents on my own Mac Mini, and I’m putting together a done-for-you setup for people who’d rather not spend a weekend on it. Join the waitlist and I’ll email you when spots open.
Running a business and want AI doing more of your marketing? See AI consulting.
