Contact Book a call

Systems

How much should an AI agent be allowed to do?

An agent with an unscoped token dropped a production database and its backups in nine seconds. The permission model we use for every agent: read widely, write narrowly, spend with a cap, and escalate when unsure.

Cover card reading "How much should an AI agent be allowed to do?" beside a permissions panel with read, write, spend and escalate rows
Read widely. Write narrowly. Spend with a cap. Escalate when unsure. Image: SBD.

In 2026 a developer gave a coding agent a Railway API token with full project access and asked it to tidy up a database migration. The agent decided the cleanest path was to drop the database and start again. It also removed the backups. Nine seconds, by the account published on DEV Community.

Nobody at that company wrote malicious code. Nobody wrote any code. The failure was a permission, not a bug.

The short answer

Give an agent the smallest set of actions that lets it finish the job, and nothing it could use to make the job worse. In practice: read access to what it needs to understand, write access to one table or one system, a hard cap on what it can spend, and a rule that sends anything it is unsure about to a person. Decide this before the first run, in writing.

Four decisions, made separately: the model used on every SBD agent build
Four decisions, made separately. The model used on every SBD agent build.

The question every operator is asking

On the n8n forum this month the thread is literally titled “How do you limit what an AI agent can do?”. On Hacker News the same question keeps resurfacing: “Would you let AI agents into production?”, “AI agents accessing production data”, “How are you monitoring AI agents in production?”. The honest answers in those threads are mostly “carefully” and “not yet”.

The nervousness is correct. An agent is a worker that follows instructions, and instructions are ambiguous. “Clean this up” to a person means tidy. To an agent with a delete permission it might mean delete.

Four permissions, decided separately

We treat every agent as four separate decisions.

Read

Reading is cheap and usually safe, so be generous. An agent that qualifies leads should be able to read the CRM, the website, and the enrichment service. The one limit: no reading of data the business would not show the person who asked for the task. If the sales rep cannot see payroll, neither can the sales agent.

Write

Writes are where damage happens, so be narrow. One agent, one destination. The lead agent writes to the leads table and nowhere else. The invoice agent writes to an “incoming invoices” staging table, and a person or a separate rule promotes rows to the ledger. Deletes are never granted to an agent. If something needs removing, the agent flags it.

Spend

Every agent has a budget it cannot exceed. Model calls, enrichment lookups, SMS sends. A March thread on X described a multi-agent setup that spawned fifty-one specialists and burned a monthly budget in an hour. The cap is a number in a config file and a hard stop, not a dashboard someone checks on Friday.

Escalate

The agent gets a confidence score on every decision and a threshold. Above it, act. Below it, write the record to a review queue with the reasoning attached and stop. Confidence-based routing is now a standard n8n pattern, and it is the single change that makes clients comfortable switching an agent on.

What this looks like in a real build

For a client whose leads arrived from forms, cold email replies and social messages, the qualification agent reads the lead, the company site and the enrichment result. It writes to one CRM object with tagged fields. It can send one first reply from a template. It cannot delete, cannot change deal value, and cannot email anyone who is not the lead. Anything under the confidence line goes to a rep with a note on why.

Manual CRM entry fell by about 90% and first reply time dropped under three minutes. The permission model is the reason it stayed on. The case study is here.

Before and after

BeforeAfter
TokenOne admin key for everythingOne scoped key per agent, per system
WritesAnywhere the key allowedOne table, no deletes
SpendDiscovered on the invoiceCapped per day, hard stop
UncertaintyAgent guessesReview queue with reasoning
Audit trailChat historyEvery action logged with input and output

A checklist before switching an agent on

  1. Write down the one job in a sentence. If it needs “and”, it is two agents.
  2. List every system it reads and every system it writes. Cut the write list to one.
  3. Create a separate credential for it, scoped to that list. Never reuse a person’s login.
  4. Set a daily spend cap in the orchestration layer.
  5. Set a confidence threshold and build the review queue before the agent, not after.
  6. Log input, decision, action and cost for every run, somewhere a person can read.
  7. Run it in shadow mode for a week: it decides, a person acts.

This is the standard we hold ourselves to on every build, and the first thing we check when we harden an agent somebody else built.

Questions we get asked

Can an agent ever be trusted with deletes?

We have not found a case where it needed to be. Soft-delete, archive, or flag for a person. The time saved by letting an agent hard-delete is never worth the one time it is wrong.

Does this slow the agent down?

Scoping credentials and logging add milliseconds. The review queue adds human time only for the uncertain cases, which should be a small minority once the prompt is tuned.

What about agents that write code?

Same rules, stricter. Read the repo, write to a branch, never to main, never to infrastructure, and a person merges. The nine-second database story is what happens when the branch rule is skipped.

Sources and further reading

  • AI agents
  • Security
  • Permissions

Keep reading

Cover card reading "Does an AI agent still need Zapier?" beside two columns: judgement and plumbing

Strategy

Does an AI agent still need Zapier?

A widely shared post argues Zapier goes to zero because agents click buttons and call APIs themselves. We run both every day. Where the argument is right, where it is wrong, and what we use for each job.

Cover card reading "Invoice intake with an agent: the first thirty days" beside a four-week timeline from shadow mode to steady state

Systems

Invoice intake with an agent: the first thirty days

What the first month of an invoice intake agent looks like from the inside: how the queue behaves, which invoices escalate, what the finance team changes, and the three settings that decide whether it survives month two.

Cover card reading "Six months of AI agents in production: what broke" beside a log panel listing four failure causes, none of them the model

Systems

Six months of AI agents in production: what broke

Not the model. Field renames, a confidence score that drifted, a supplier who changed invoice format, and a Slack channel nobody read. What failed across the agent systems we run for clients, and what we changed.

For teams that tried AI and nothing stuck

Get the hours back.

About 95% of AI pilots never reach the profit line. Ours start with the work your team still does by hand, and end when it is gone.

See how we work
A team of six gathered around one screen in an open-plan office
Thirty minutes with the people who own the process. Photo: Vitaly Gariev, Unsplash.