> ## Documentation Index
> Fetch the complete documentation index at: https://www.sapientpriors.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Roles and permissions

> The four roles, what each one can do, and what Priors returns when a role does not allow a call.

Everyone in a project holds one role there. The role decides what the person can do in the Priors app and what their own API key can do. Service accounts take the same roles. See [Service accounts](https://www.sapientpriors.com/docs/access/service-accounts.md).

| Role | Scope | In one line |
| - | - | - |
| **Org admin** | The whole organization | Everything, in every project, plus projects, people, the audit log, and billing. |
| **Project admin** | One project | Everything in that project: people, service accounts, keys, and every agent. |
| **Agent admin** | Chosen public agents in one project | A Contributor who also teaches the agents picked for them. |
| **Contributor** | One project | Chats with every public agent, and creates private agents of their own. |

An Org admin or a Project admin picks a person's role when they add the person to the project, and can change it later on the project's **Members** page. Choosing **Agent admin** opens a list of the project's public agents to pick from.

## What each role can do

"Teach" means every call that makes an agent learn: `observe`, `observe-and-respond`, `observe-and-recall`, and file uploads. "Chat" means `respond` and `recall`, which never learn.

| Action | Org admin | Project admin | Agent admin | Contributor |
| - | - | - | - | - |
| Chat with a public agent | Yes | Yes | Yes | Yes |
| Teach a public agent | Yes | Yes | Picked agents only | No |
| See and delete an agent's memories, change its settings | Yes | Yes | Picked agents only | No |
| Create a private agent, and use and teach it | Yes | Yes | Yes | Yes |
| Create a public agent, or change an agent's visibility | Yes | Yes | No | No |
| Delete a public agent | Yes | Yes | No | No |
| Delete a private agent | Yes | Yes | Their own | Their own |
| Create and revoke their own API key | Yes | Yes | Yes | Yes |
| Read the project's usage | Yes | Yes | Yes | Yes |
| Read the request log | Every call in the project | Every call in the project | Their own keys' calls | Their own keys' calls |
| Add people, change roles, pick Agent admins | Yes | Yes | No | No |
| Create service accounts and their keys, revoke anyone's key | Yes | Yes | No | No |
| Create and delete projects, manage organization people, read the audit log, buy credits | Yes | No | No | No |

Two rules hold for every role:

* **A thread is read only by the person or key that created it.** This includes Org admins. An admin still sees what an agent learned from every thread, through its memories.
* **A private agent is never shared.** Only its creator, the project's Project admins, and Org admins reach it.

## Public and private agents

| | Public | Private |
| - | - | - |
| Who creates it | Org admins and Project admins | Anyone with a role in the project |
| Who chats with it | Everyone with a role in the project, and the project's service-account keys | Its creator, Project admins, and Org admins |
| Who teaches it | Org admins, Project admins, and its Agent admins | Its creator, Project admins, and Org admins |
| Service-account keys | Reach it | Never reach it |

When a request to [POST`/v2/agents`](https://www.sapientpriors.com/docs/api-reference/v2/agents/create-agent) names no visibility, an Org admin or Project admin gets a public agent and anyone else gets a private one.

## When a role does not allow a call

| Status | `code` | Cause | What to do |
| - | - | - | - |
| `403` | `forbidden` | Your role reaches the agent or project but does not allow this action, for example a Contributor teaching a public agent. | Ask a Project admin for the role you need, or use a call your role allows. |
| `404` | `agent_not_found`, `project_not_found`, `not_found` | Your role does not reach this agent or project, or the id does not exist. Priors does not say which. | Check the id and which project your key belongs to. |

Priors returns `404`, never `403`, for anything you cannot reach, so an id never reveals that something exists.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.