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

# Suggest policies

> Let CrewAI propose Ranger policies for a table or schema.

The AI crew can propose Ranger policies for a table, or for every table in a schema. It reads the table's classification
tags, which label data such as personal information. NexusOne applies nothing until you accept a suggestion.

## Prerequisites

Before starting this task, ensure you have the following:

* Required roles: `nx1_migration_admin` or `nx1_migration_ops`.
* A table with accepted classification tags in DataHub. The crew bases its suggestions on them. To add them, refer to
  [Classify a table in a Trino catalog](https://docs.nx1cloud.com/documentation/catalog-and-models/tasks/catalogs/classify-a-table-in-a-trino-catalog.md).

## Suggest policies

> [tab] Web portal
>
> Perform these steps to suggest policies.
>
> 1. Log in to NexusOne.
>
> 2. On the top navigation bar, hover your mouse over **Govern** and then select **Data Access**.
>
> 3. Click the **All policies** tab.
>
> 4. Click **Suggest Policies**.
>
> 5. Select what the crew should look at:
>
>    * **Single table**: Select the catalog, schema, and table. The crew runs once for that table.
>    * **Entire schema**: Select the catalog and schema. The crew runs for every table in the schema, up to 25 tables.
>
> 6. Click **Generate suggestions**. If an open batch already exists for that scope, click **Resume review** to continue
>    it, or **Regenerate** to start a new one.
>
> 7. Wait while the crew runs for each table. The drawer lists each table with its status.
>
> 8. Review the suggestions. Each one shows a confidence score and the crew's rationale. Click **Policy detail** to see
>    the policy it would write.
>
> 9. Optional: Click **Edit** on a suggestion to change it. An edited suggestion shows an **Edited** badge.
>
> 10. Select the suggestions to apply. Click **Select all** or **Deselect all** to change every selection at once.
>
> 11. Click **Accept selected**. To discard every suggestion instead, click **Reject all**.
>
> 12. Review the results, and then click **Done**.
>
> If a suggestion needs roles or groups that don't exist yet, it shows **Requires Keycloak provisioning**. Accepting it
> creates those roles and groups.

> [tab] REST API
>
> Use the following API endpoints to:
>
> 1. [Suggest Ranger policies for a table or a schema's tables](https://docs.nx1cloud.com/api-reference/endpoints/policy-management/suggest-ranger-policies-for-a-table-or-a-schemas-tables.md).
> 2. [Find an open suggestion batch for a scope](https://docs.nx1cloud.com/api-reference/endpoints/policy-management/find-an-open-undecided-suggestion-batch-for-a-scope.md).
> 3. [Get all suggestion rows in a batch](https://docs.nx1cloud.com/api-reference/endpoints/policy-management/get-all-suggestion-rows-in-a-batch-grouped.md).
> 4. [Accept and provision selected suggestions](https://docs.nx1cloud.com/api-reference/endpoints/policy-management/accept-and-provision-+-createmerge-selected-suggestions.md).
>
> To discard suggestions, use the following API endpoints to:
>
> * [Reject a single suggestion row](https://docs.nx1cloud.com/api-reference/endpoints/policy-management/reject-a-single-suggestion-row.md).
> * [Reject every undecided suggestion row in a batch](https://docs.nx1cloud.com/api-reference/endpoints/policy-management/reject-every-undecided-suggestion-row-in-a-batch.md).

## Additional resources

For an overview of the Govern feature, refer to [Govern Overview](https://docs.nx1cloud.com/documentation/govern/overview.md).


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