If role-based access control (RBAC) is enabled
in the Arango Contextual Data Platform, the AQLizer checks a permission for
every request, except for the health checks. The permission is an action on
the database that the AQLizer is installed for, for example,
ai:reasoner.query on ai:database:sales.
You need the following:
- The
ai-userorai-developerrole. Both grant the action to use the AQLizer. Saving queries as templates additionally requires theai:mcp.template.manageaction, which onlyai-developergrants. - A scope for the role assignment that covers the database that the AQLizer
is installed for, like
ai:database:sales, or all databases. - Access to the data in ArangoDB, because the AQLizer works with your token. See Permissions in ArangoDB.
Actions
| Action | Allows | Resource | Predefined roles |
|---|---|---|---|
ai: | Generate and optimize AQL queries | ai:, the database that the AQLizer is installed for | ai-user, ai-developer |
The resource is always the database that the AQLizer is installed for. It is taken from the configuration of the service and not from your request, so you cannot direct the check to a different database.
Permissions per endpoint
| Endpoint | Action | Predefined roles |
|---|---|---|
POST /txt2aql | ai:Also ai: on ai:, if add_ is true | ai-user, ai-developer |
POST /query | ai: | ai-user, ai-developer |
POST /query/ | ai: | ai-user, ai-developer |
GET /health | None, any authenticated user | – |
GET /health/ | None, any authenticated user | – |
Permissions in ArangoDB
The AQLizer reads the database with your token. What it can access is therefore decided by your own permissions in ArangoDB, whether or not ArangoDB RBAC is enabled:
- ArangoDB RBAC disabled: You need the classic permissions for the database and its collections.
- ArangoDB RBAC enabled: You need a
coredb-*role with a scope that covers the database and the collections that the queries read, likecoredb-reader.
Saving templates doesn’t require write access to the Tools collection,
because the AQLizer writes them with its own service identity.
Errors
| HTTP status | Cause |
|---|---|
401 | No Authorization: Bearer <token> header, or the token is invalid or expired |
403 | You lack the action on the database |
503 | The authentication or authorization service of the platform cannot be reached, or your token is close to expiry and cannot be renewed. The request is not carried out, and you can retry it |
The AQLizer renews your token for long-running requests if it has less than 15 minutes left. You don’t need any additional permission for this.
Example
Alice holds the ai-user role and Bob the ai-developer role, both with a
scope of the sales database (ai:database:sales). Both can read the
sales database in ArangoDB. The AQLizer is installed for the sales
database.
| Request | Alice | Bob |
|---|---|---|
POST /txt2aql | Allowed | Allowed |
POST /query | Allowed | Allowed |
POST /txt2aql with add_ set to true | The request ends with the Can not add template error, because her role doesn’t grant ai: | Allowed |
