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

# Policies and directory groups

> Workspace-wide rules for agents and databases, and Directory Sync groups mapped to project roles, on Team and Ultimate.

On **Team** and **Ultimate**, **Settings → Policies** holds rules for every project in the workspace, and maps groups in your directory to project roles. Owners and admins change them; everyone can read the policies.

## Workspace policies

| Policy | What it does | Default |
| - | - | - |
| **Connected agents must be pinned to projects** | An agent nobody has [pinned](https://docs.hookie.ai/connected-agents.md#pin-it-to-projects) is refused until its person chooses its projects under **Connected agents**. It can still say who it acts for. | Off |
| **Agents may read connected databases** | Off: nobody connects or queries a project's [read-only databases](https://docs.hookie.ai/project-databases.md). Connected ones stay listed so they can be removed. | On |
| **Keep the database query audit for** | How long each database's query audit is kept: 7 to 365 days. | 90 days |

Policies are set by a person in the console; connected agents cannot change them. If the workspace moves to a plan below Team, the defaults apply again, so nobody is locked out.

## Directory groups to project roles

With [Directory Sync](https://docs.hookie.ai/single-sign-on.md) connected, map a group in your directory to a role in a project:

1. Choose **Map a group**.
2. Pick the directory group, the project, and the role: **Project admin**, **Developer** or **Viewer**.
3. Choose **Map and sync**.

Hookie matches the group's members to this workspace's members by email and gives them the role in the project, then keeps it in step every hour, and on **Sync now**. When someone leaves the group, they lose the role.

* Nobody joins the workspace through a group: invite people or use SSO first.
* A project role only narrows: someone who is a viewer in the workspace stays a viewer.
* If two groups give someone a role in the same project, the stronger one wins.
* Members added to a project by hand are never changed. Editing a group member's role by hand makes it a hand-added role.
* If Hookie cannot read a group from your directory, it removes nobody and shows why.

Removing a mapping takes the role away from the group's members, unless another mapped group gives them one.


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