Data and retrieval

Access control

Access control is the set of rules and mechanisms that decide who or what can see, change or act on which data and functions in a system, so that users, staff and AI agents only reach what their role requires.

Access control answers two questions for every request: who is this, and what are they allowed to do? In ordinary software it keeps a junior employee out of payroll records. In AI builds it matters even more, because an assistant that can search every document or an agent that can call every tool will happily surface or act on things the person asking should never see. Getting permissions right is one of the main differences between a demo and a system a company can safely roll out.

How it works

Authentication establishes identity, usually through single sign-on, a password with multi-factor authentication, or an API key for software. Authorisation then decides what that identity may do. Common models include role-based access control, where permissions attach to roles such as "sales" or "manager", and attribute-based control, where rules consider properties such as department, region or document sensitivity. Databases can enforce row-level security so that each query only returns rows the user is entitled to.

In AI systems, access control appears in three places:

  • Retrieval. In a retrieval-augmented generation system, each document chunk carries metadata about who may see it, and searches filter on the user's permissions before anything reaches the model. Relying on the model to "not mention" restricted content is not access control.
  • Tools and actions. An AI agent should act with the permissions of the user it serves, or a narrowly scoped service account, never as an all-powerful administrator.
  • Administration. Who can change prompts, view conversation logs or export data is itself a permission.

An example: an internal HR assistant indexes policies for everyone, but salary bands only for HR staff. When a non-HR employee asks about pay, retrieval never returns those documents, so the model cannot reveal them.

What it means for cost

Permissions are among the most underestimated items in AI build quotes. A single-user tool or one where everyone sees everything is simple. Mirroring an existing permission structure, for example from SharePoint, Google Drive or a CRM, means syncing permissions as well as content and testing that they hold under every query. That adds design, integration and testing time.

Ask a builder how permissions from the source systems are carried into the search index, how quickly a revoked permission takes effect, and how they test that one user cannot retrieve another's data, including through prompt injection.

Common questions

Can a system prompt be used to control what an AI reveals?

Not reliably. Instructions in a prompt can be ignored or bypassed. Data a user should not see must be filtered out before it reaches the model, at the retrieval or database layer, so the model never has it to reveal.

What is least privilege?

It is the principle that every user, service and agent gets only the minimum access needed for its task. For AI agents it limits the damage if the agent misbehaves or is manipulated by malicious input.

Related terms

Pricing a build that involves Access control? Send the brief and get a fixed price set next to the market range.Get a quote