Blog

AI agent security and permissions: how to set limits

AI agent security and permissions need three guardrails: narrow rights, human approvals and logs. Here is how to set them up before the agent starts working.

AI agents Walldy · · 8 min

What can go wrong with an AI agent

An AI agent that can do things in your systems can also do things wrong. That is the starting point for all AI agent security. The mistakes are usually everyday ones: the agent misunderstands a customer question and books the wrong time, overwrites a record in the CRM or sends a reply that promises something you cannot keep.

There are also less common risks. An agent that reads emails or web pages can be influenced by text someone has planted on purpose, such as an instruction hidden in an email that makes the agent do something unwanted. This is often called prompt injection and is a known weakness of systems that read uncontrolled content. The more permission the agent has, the more damage such a mistake can do.

So security for agents is about limiting the damage if something goes wrong, not about hoping it never does. Three guardrails go a long way: permissions, approvals and logs.

Permissions: give the agent the least right possible

Treat the agent like a new employee on day one. It gets only what it needs for its particular task. An agent that books times in the calendar does not need access to the accounting system. An agent that answers order questions needs to read order status, but rarely to change prices.

Start with read access. Let the agent fetch and summarise, and let a person carry out the change itself. Once you have seen the agent get it right, you can add write access for a bounded action, such as creating a new task but not deleting existing ones.

Use separate accounts for the agent, not a colleague's login. Then the log shows that it was the agent that did something, and you can withdraw access without closing a person's account. Store keys and passwords in a managed vault, not in the text the agent reads.

Review the permissions when something changes. New systems are connected, staff are replaced and someone gives the agent temporary extra access to solve a problem. The temporary easily becomes permanent. Set a recurring check, for example every quarter, where you go through the list of what the agent can reach and remove what is no longer needed.

  • A separate account for the agent, never a shared login
  • Read access first, write access per action
  • No access to systems the agent does not need
  • Keys in a vault, rotated regularly
  • Time limited access where possible

TipWrite a table with the agent's tasks in one column and the rights it needs in another. Anything not listed there, the agent should not have.

Human approvals: what a person should always see first

Having a person in the flow is often called human in the loop. The idea is simple: for certain actions the agent should propose, and a person press approve. It costs a few seconds per case but protects against the mistakes that are expensive.

Set the limits by what a mistake costs and how hard it is to undo. Actions involving money, legal promises, deletion of data, mailings to many recipients and decisions about individuals should always be approved. Under the General Data Protection Regulation people also have the right not to be subject to decisions based solely on automated processing if they have legal or similarly significant effects. That makes human review extra important when the agent touches personal data. This is not legal advice.

Make approval easy. Show what the agent wants to do, why and what happens if you say yes. An approval that needs ten minutes of research soon becomes a bottleneck, and then people start approving without reading.

Choose the level of control by experience. At the start a person can approve everything. Once you have seen the agent get it right in hundreds of cases, you can loosen approval for the simplest actions and keep it for the rest. What matters is that you choose it actively, instead of the control gradually disappearing because nobody can be bothered to click.

  • Money: invoices, discounts, refunds
  • Promises: prices, delivery times, terms
  • Deleting or changing existing data
  • Mailings to many recipients
  • Anything touching individuals' rights

Logging: how you see what the agent has done

Without logs you cannot answer the question ”why did this happen?”. So log every action: what input the agent received, what it decided, which tool it used, what changed and who approved. Also log when it did nothing and handed over.

The log should be readable by a person who is not a developer. A simple flow with date, case and action is more useful than a thousand lines of technical text. Decide too how long logs are kept and who has access, because they can contain personal data. That is a matter for your GDPR review.

Use the log actively. Go through a sample every week for the first months, and look for patterns: cases that are often handed over, answers corrected by people and actions that came close to the limit. That is where the basis for better rules lies.

Finally, decide how long logs and case history are kept. Keep them long enough to investigate errors, but no longer than necessary, especially if the logs contain personal data. A simple rule, such as a certain number of months, and a routine for deleting, is usually enough.

Test, limit and have an emergency stop

Test the agent on real cases from earlier months before it is released. Run difficult cases too: unclear questions, angry customers, customers who try to make the agent do something it should not. Write down what went wrong and fix it before launch.

Limit the scope at first. Release the agent on a single channel, a small customer group or one type of case. Set caps on what it can do per hour or day, such as a maximum number of mailings, so a mistake does not have time to spread.

Have an emergency stop. Someone should be able to switch the agent off immediately, and you should know who and how. Decide what happens to ongoing cases when it is switched off. Practise once, so you know it works when needed.

TipDecide three clear alarm conditions in advance, such as too many rejections, an unusual number of mailings or access to a system that does not belong to the task. On an alarm the agent stops and a person looks.

Data, vendors and hosting: what is often forgotten

Security covers both what the agent does and where the data goes. When the agent sends text to an AI model, it leaves your own system. Find out where the model runs, whether the vendor stores or trains on your data, and what agreements exist. For personal data a data processing agreement is often needed.

Ask where data is stored, too. Many companies prefer operation and storage to take place within the EU, and may set that as a requirement in procurement. It is a choice you make based on your customers' expectations and your own risk assessment, and a lawyer or your data protection officer can help you weigh it. This is not legal advice.

Review vendors as you would review any other subcontractor. Who has access, how long is data kept, how are incidents reported and what happens if you want to leave? Write the answers down, so you can show you took it into account if anyone asks.

Checklist and how Walldy works with guardrails

Before an agent goes live, check that you can answer yes to each point below. If something is missing, wait. It is easier to release an agent that is boringly carefully fenced in than to fix one that has already done wrong.

At Walldy we build AI agents with clear permissions, logging and guardrails, and we follow GDPR and can deploy in EU regions. We also run workshops where you go through which rights and approvals suit your own flows, so you can make the decisions yourselves.

  • The agent has its own account and the least possible permission
  • There is a list of actions that require approval
  • All actions are logged and the log is readable
  • The agent is tested on real cases
  • There are caps, alarm conditions and an emergency stop
  • One person owns the agent and reviews the logs regularly

FAQ

What risks are there with AI agents?

The most common are wrong actions, such as a wrong booking or a promise you cannot keep, and the agent being influenced by unwanted instructions in text it reads. The risks are handled with narrow permissions, human approvals and logging.

What does human in the loop mean?

That a person is part of the flow and approves certain actions before they are carried out. It applies especially to anything involving money, promises, deletion and mailings to customers.

What permissions should an AI agent have?

As few as possible. Start with read access, give write access only for bounded actions and use a separate account for the agent. Never give access to systems the task does not require.

How do you log an AI agent?

Save every action with input, decision, tool, result and any approval, in a format a person can read. Decide how long logs are kept and who has access.

AI solutions Want help building it? Tell us what you would rather not do by hand, and we will propose an AI agent or automation that fits your systems. See what we build →
More posts

Keep reading.

Next step

What do you want to automate?

One line is enough. We normally reply within one working day and book a first call.

Newsletter

Stay up to date on AI in practice.

Guides, tips and news about AI for businesses, straight to your inbox. You can unsubscribe at any time.

We only use your details for the newsletter and never share them with anyone else. Read how we handle your data in our privacy policy.