---
title: "AI Agents Security: Permissions, Data Access and Audit Trails"
description: "The security risks specific to AI agents, from over-broad permissions to prompt injection, and the controls that contain them, from MCP to audit trails."
canonical: https://shipshapedata.com/resources/ai-governance-ethics/ai-agent-security/
language: en-GB
author: "Emile Van Zyl"
author_role: "MarTech Automation Consultant"
author_url: https://www.linkedin.com/in/emile-vanzyl-enhancing-your-human-advantage/
date_published: 2026-11-07
date_modified: 2026-11-07
---

# AI agents security: permissions, data access and audit trails

> The security risks specific to AI agents, from over-broad permissions to prompt injection, and the controls that contain them, from MCP to audit trails.

Section: Home > Resources > AI governance & ethics

Canonical page: https://shipshapedata.com/resources/ai-governance-ethics/ai-agent-security/
By Emile Van Zyl, MarTech Automation Consultant (https://www.linkedin.com/in/emile-vanzyl-enhancing-your-human-advantage/) | published 2026-11-07

An AI agent that can read a mailbox, query a database and raise a purchase order is no longer a chat window. It is a new kind of user with system access. Most organisations have given it credentials without deciding what it is allowed to touch, who answers for what it does, or where its working copies of data end up.

AI agents security is the practice of controlling what an agent can reach, what it can do and what it leaves behind. It covers scoped permissions, defences against prompt injection, governed routes to data such as Model Context Protocol (MCP), human checkpoints for consequential actions, and an audit trail that records every step the agent takes.

This guide is for two readers. The first owns an AI mandate and has been asked to sign off an agent build. The second leads security or data and has to live with the agent afterwards. We build AI agents and the governed connections they use, and we often see the same gap: the agent is designed with care, and its access is an afterthought. The guide sets out the risks that are specific to agents. It then covers the controls that contain them and ends with a checklist to use before the first agent reaches production.

## Why agents change the security picture

Traditional security models assume two kinds of actor. People log in, act within a role and can be held to account. Software runs fixed logic that someone wrote and tested. An agent sits between the two. It is software, but it chooses its own next step based on a goal, a set of tools and whatever text it reads along the way. The same request can produce a different sequence of actions on a different day.

That changes three things. First, the agent's behaviour is not fully known in advance, so reviewing its code alone cannot secure it. Second, it usually acts on behalf of a person, but it often runs with its own credentials, and those credentials are often broader than that person's. Third, it reads content from outside your control, such as emails, web pages and shared documents, and it uses that content to make decisions. Our guide to agentic AI and when it is worth building covers how agents are designed. This guide covers how their access is controlled.

The useful starting point is to treat every agent as a named identity, with an owner, a purpose and a defined scope. Treat it as you would a new member of staff with system access. Most of the controls below follow from that decision.

> An agent that can act is a new kind of user. Decide what it may touch before you decide what it can do.

## The main risks specific to agents

Agents inherit the usual risks of any software with system access. Four risks are specific to them, or much sharper because of how agents work.

### Over-broad permissions

The quickest way to get an agent working is to give it a service account with wide access. That account then becomes the largest single point of exposure in the system. If the agent is misled, or its credentials leak, everything the account can reach is exposed. Long-lived tokens make this worse, because a stolen key keeps working until someone notices. Agents built as prototypes also tend to keep the permissions they were given for the demonstration.

### Prompt injection through retrieved content

Prompt injection is an instruction hidden in content the agent reads. Direct injection comes from the person typing to the agent. Indirect injection is the harder case. The instruction sits in a retrieved document, an inbound email or a web page, and the agent cannot reliably tell data it should read from an instruction it should follow. One example is a line in a supplier invoice that tells the agent to forward the payment file to an outside address. The model does not have to be faulty for this to work. It only has to treat text as text.

### Data copied to ungoverned places

Agents need context, so they gather it. Without a governed route, that context ends up in places nobody has catalogued. Examples include a vector store built from an export, a log file holding full customer records, a prompt sent to an external model provider, and an agent memory that persists between sessions. Each copy sits outside the access rules that protected the original. Memory carries a second risk. Content written into memory during one interaction can shape the agent's behaviour in a later one.

### Actions nobody logged

When an agent updates a record or sends a message, the system of record often shows only the service account. You can see that something changed. You cannot see which agent, which request, which retrieved document or which reasoning step led to the change. Without that trail you cannot investigate an incident, answer a regulator or decide whether the agent should keep its access. Untracked agents make the problem worse. When a team builds an agent on its own initiative, nobody else may know it exists.

These risks belong in the same register as the rest of your model risk. Our guide to AI risk management shows how to record and track them for as long as the system runs.

## Autonomous AI agents and checkpoints

Autonomous AI agents plan and complete several steps without a person approving each one. Most of their value comes from this, and it is also where the risks above compound. In a chat, a single wrong step produces a wrong answer. In an autonomous run, a wrong step early on can be followed by many more actions that depend on it.

The answer is not to remove autonomy. Decide instead where it stops. Start by sorting the agent's possible actions by how hard they are to reverse.

- Read-only actions, such as searching documents or querying a reporting table, can usually run without approval inside a scoped permission.
- Reversible changes, such as drafting a reply or creating a ticket, can run with a log and a sample review.
- Consequential or irreversible actions should wait for a person to approve them. These include sending money, deleting records, changing access and contacting anyone outside the organisation.
A checkpoint only helps if the person approving it can see what they are approving. That means the proposed action, the data it rests on and the reason the agent gives. A queue of bare yes or no prompts trains people to approve everything. Our guide to human in the loop design covers how to place reviews so they hold up under volume.

Two further controls belong with every autonomous agent. First, limit how many actions, how much spend and how much time a single run may use. Second, provide a way to stop an agent at once and revoke its credentials without waiting for a release.

> Autonomy is a setting you choose for each action, not a property of the agent.

## Local AI agents and where data stays

Local AI agents run the model and the agent logic on your own hardware or inside your own cloud tenancy, instead of calling an external provider. The appeal is that prompts and retrieved content do not leave your environment. This simplifies data residency and removes one third party from the data flow.

Local does not mean secure by default. A local agent with broad file system access, a shared admin token and no logging carries every risk described above. Prompt injection works the same way on a model running on your own server. Local deployment changes where the data goes. It does not change what the agent is allowed to do.

### Questions to settle before choosing

- Which data the agent will read, and whether any of it is restricted by contract or by UK GDPR.
- Whether the task needs a model that only runs at an external provider, or whether a smaller local model is good enough.
- Who will patch, monitor and update the local model and its tools over time.
- Whether a hosted model with clear data terms, reached through a governed route, would give the same protection with less to maintain.
The right answer is often a mix. Sensitive retrieval and actions stay inside your environment, and the governed route decides what, if anything, reaches an external model. Our guide to a data security governance framework sets out the policies that should make this decision.

## Governed access through MCP

Model Context Protocol (MCP) is an open protocol for connecting models and agents to tools and data. You do not give the agent a database password or an export. You give it access to an MCP server that offers a defined set of tools, such as looking up an order or summarising a contract, and each tool has its own rules.

Used well, MCP makes least-privilege access practical, because the server decides what the agent can do.

- Access controls are enforced at the server, so the agent can only call the tools and see the rows its identity allows.
- Business logic sits in one governed place, so a metric or a rule means the same thing to every agent that uses it.
- Credentials stay on the server side and can be short-lived, so the agent never holds a long-lived key to the underlying system.
- Every call is logged with the identity, the tool, the inputs and the result.
- Data is read where it lives, not copied into a new and ungoverned store.
MCP carries the rules you set. It does not write them. An MCP server that offers a general query tool with full access is simply a new route to the same risk. The real work is deciding which tools to offer, how far each one reaches and what permission each identity should hold. Those decisions depend on a governed data foundation underneath. If definitions differ across systems, the agent will act on whichever one it reaches first.

## Audit trails and lineage

An audit trail for an agent must record more than the fact that an action happened. It must record the chain that led to the action, so a person can trace any outcome back to its cause. A complete trail records the following.

- The identity of the agent, and of the person or process it acted for.
- The request or trigger that started the run.
- Each tool call, with its inputs and outputs.
- The documents and records retrieved, with their versions.
- Any approval given at a checkpoint, and who gave it.
- The final action and the system it changed.
This is lineage applied to decisions. Data lineage tells you where a number came from and what happened to it. Agent lineage tells you which data and which steps produced an action. The two should be joined. A question about a changed record can then be traced through the agent run to the source tables the agent read. Our guide to data lineage explains the underlying practice.

Keep these logs in a governed store with their own access rules and retention period. Logs that include full prompts and retrieved content can hold personal data, so they need the same care as the data they describe. Review the logs on a schedule, not only after an incident, so that unusual tool use is noticed early.

## A starting checklist

Use this list before an agent reaches production. If you cannot answer an item, that item is the first piece of work.

- Inventory: every agent in use is listed, with a named owner and a stated purpose.
- Identity: each agent has its own identity, separate from any person and from other agents.
- Least privilege: permissions cover only the tools and data the task needs, and credentials are short-lived.
- Governed route: the agent reaches data through defined tools, such as an MCP server, not through raw credentials or exports.
- Untrusted content: retrieved documents, emails and web pages are treated as data and cannot trigger consequential actions on their own.
- Checkpoints: irreversible and external actions wait for approval from a person who can see the evidence.
- Limits: each run has caps on actions, spend and time, and there is a tested way to stop it.
- Copies: no agent writes data to a store that is not catalogued and governed.
- Audit trail: every run is logged from trigger to final action, and the log is joined to data lineage.
- Review: logs and permissions are reviewed on a schedule, and unused access is removed.

## Where this leaves you

AI agents security is a decision about access before it is a decision about tools. The most important risks are over-broad permissions, injected instructions, ungoverned copies and unlogged actions. All of them come from giving an agent reach without rules. The controls that contain them are familiar ones applied to a new kind of user: scoped identity, governed routes, human checkpoints and a trail you can follow.

Start with one agent and one task. Scope its access, route it through governed tools, log every step and require a person to approve anything that cannot be undone. A first agent built this way gives you the pattern for the second. If the data underneath is not ready for an agent to read safely, fix that first. It is better to find this out before a build than after an incident.

Our MCP connections service designs and builds the governed connections agents use. Our AI workflow automation service builds the agents themselves, with scoped permissions, checkpoints and audit trails in place before anything goes live. If you have an agent in mind, or one already running with more access than you would like, Talk to us and we will tell you plainly what it needs, even if the answer is not yet.

## Frequently asked questions

An AI agent is software built around a language model. It is given a goal and a set of tools, and it decides its own next steps to reach that goal. A chatbot answers once. An agent can search documents, query systems, update records and send messages across several steps. That ability to act is why an agent needs its own identity, scoped permissions and an audit trail.

They can be, if they are given access without rules. The main risks are over-broad permissions, prompt injection through content the agent reads, data copied to ungoverned places and actions that are not logged. None of these is a reason to avoid agents. Each one is contained by familiar controls: least-privilege access, governed routes to data, human checkpoints for consequential actions and a full audit trail.

Treat it as a new user. Give each agent its own identity and owner, limit its permissions to the task, and use short-lived credentials. Route its access to data through governed tools, such as an MCP server, instead of raw credentials. Treat retrieved content as untrusted, require approval for irreversible actions, cap each run, and log every step from trigger to final action.

They can be, when you set autonomy for each action instead of for the whole agent. Read-only steps can run inside scoped permissions. Reversible changes can run with logging and sample review. Irreversible or external actions should wait for a person. Add limits on actions, spend and time for each run, a tested way to stop the agent, and an audit trail joined to your data lineage.

Local AI agents keep prompts and retrieved data inside your environment. This helps with data residency and removes a third party from the data flow. They are not secure by default. A local agent with broad access, shared credentials and no logging carries the same risks as any other agent, and prompt injection works the same way. Local deployment changes where data goes, not what the agent may do.

AI agents security is the practice of controlling what an agent can reach, what it can do and what it leaves behind. It covers scoped permissions and short-lived credentials, defences against prompt injection hidden in content the agent reads, governed routes to data such as Model Context Protocol (MCP), human checkpoints for irreversible actions, and an audit trail that records every step from trigger to final action.

## Frequently asked questions

### What is an AI agent?

An AI agent is software built around a language model. It is given a goal and a set of tools, and it decides its own next steps to reach that goal. A chatbot answers once. An agent can search documents, query systems, update records and send messages across several steps. That ability to act is why an agent needs its own identity, scoped permissions and an audit trail.

### Are AI agents a security risk?

They can be, if they are given access without rules. The main risks are over-broad permissions, prompt injection through content the agent reads, data copied to ungoverned places and actions that are not logged. None of these is a reason to avoid agents. Each one is contained by familiar controls: least-privilege access, governed routes to data, human checkpoints for consequential actions and a full audit trail.

### How do you secure an AI agent?

Treat it as a new user. Give each agent its own identity and owner, limit its permissions to the task, and use short-lived credentials. Route its access to data through governed tools, such as an MCP server, instead of raw credentials. Treat retrieved content as untrusted, require approval for irreversible actions, cap each run, and log every step from trigger to final action.

### Are autonomous AI agents safe to use with company data?

They can be, when you set autonomy for each action instead of for the whole agent. Read-only steps can run inside scoped permissions. Reversible changes can run with logging and sample review. Irreversible or external actions should wait for a person. Add limits on actions, spend and time for each run, a tested way to stop the agent, and an audit trail joined to your data lineage.

### Are local AI agents more secure?

Local AI agents keep prompts and retrieved data inside your environment. This helps with data residency and removes a third party from the data flow. They are not secure by default. A local agent with broad access, shared credentials and no logging carries the same risks as any other agent, and prompt injection works the same way. Local deployment changes where data goes, not what the agent may do.

### What is AI agents security?

AI agents security is the practice of controlling what an agent can reach, what it can do and what it leaves behind. It covers scoped permissions and short-lived credentials, defences against prompt injection hidden in content the agent reads, governed routes to data such as Model Context Protocol (MCP), human checkpoints for irreversible actions, and an audit trail that records every step from trigger to final action.

---

Shipshape Data is a London AI consultancy: we build the data foundation your AI depends on, then the AI on top. Site guide for agents: https://shipshapedata.com/llms.txt | Contact: hello@shipshapedata.com
