# 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.

Also called: permissions, role-based access control, RBAC, authorisation, least privilege, row-level security. Category: Data and retrieval. Source: https://aibuildindex.com/glossary/access-control

## In the index

- User authentication: median $2,800, middle half $800 to $5,760, 218 priced briefs (https://aibuildindex.com/skills/user-authentication)
- Information security: median $3,200, middle half $1,450 to $7,200, 81 priced briefs (https://aibuildindex.com/skills/information-security)

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](https://aibuildindex.com/glossary/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](https://aibuildindex.com/glossary/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](https://aibuildindex.com/glossary/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

- [Retrieval-augmented generation (RAG)](https://aibuildindex.com/glossary/retrieval-augmented-generation): Retrieval-augmented generation is a way of answering questions with a language model that first looks up relevant passages in your own documents, then writes an answer grounded in what it found.
- [Personal data (PII)](https://aibuildindex.com/glossary/personal-data): Personal data is any information that relates to an identifiable living person, such as a name, email address, phone number, location or customer ID; in the US it is often called personally identifiable information, or PII, and its handling is governed by data protection law.
- [AI agent](https://aibuildindex.com/glossary/ai-agent): An AI agent is software built around a language model that can plan steps, call tools such as APIs, databases or a browser, look at the results and keep going until it completes a task, rather than only replying to a single message.
- [Guardrails](https://aibuildindex.com/glossary/guardrails): Guardrails are the checks and controls placed around an AI model, such as input filters, output validation, topic limits and action restrictions, that keep its behaviour within safe, permitted and useful bounds in a live system.
- [SOC 2](https://aibuildindex.com/glossary/soc-2): SOC 2 is an independent audit report, based on criteria set by the American Institute of CPAs, that describes how a service provider protects customer data and whether its security controls are designed and operating effectively.
- [Prompt injection](https://aibuildindex.com/glossary/prompt-injection): Prompt injection is a security attack in which hostile instructions are hidden in content an AI system processes, such as an email, web page or document, causing the model to follow the attacker's instructions instead of its own.
