How the AI assistant works
This section describes the AI assistant's components, how it answers questions, and how it handles data.
Components
| Component | Role |
|---|---|
| Assistant panel | Part of the Authorization Hub user interface. Sends the user's message and the open policy, and displays the answer. |
| API gateway | Routes assistant requests to the assistant service with the signed-in user's token. |
Assistant service (hub-ai-service) | Builds the request to the model, checks the policy and runs tests, and stores conversations. |
| Model provider | The language model configured for the deployment. Not included with Authorization Hub. |
| PostgreSQL | Holds the conversations and preferences in the assistant schema of the Authorization Hub database. |
How a question is answered
-
A message is sent from the assistant panel. The open policy file, the cursor position, the selection, and the editor's errors are added by the panel.
-
The request is forwarded by the API gateway, with the user's token, to the assistant service.
-
The message, the conversation so far, and the assistant's instructions are sent to the model provider.
-
The model can request policies to be read, checked, or tested. The project's data is read as the signed-in user, with that user's permissions, and checks and tests are run with the built-in ALFA compiler and decision engine.
-
The answer is streamed back to the panel as it is written.
-
If a change is proposed, the proposed text is checked where possible, and the result is shown below the change in the panel.
Data handling
- Sent to the model provider:
- The user's message.
- The open policy file, including unsaved edits, the cursor position, the selection, and the editor's errors.
- The earlier messages of the conversation.
- The user's preferences for the project.
- The policies, staged changes in My workspace, attributes, and test results that are read to prepare the answer.
- Stored: conversations and preferences, in the Authorization Hub database. Conversations are removed after a period without activity. Read the Conversation limits section for details.
- Not logged: messages, answers, policy content, and the content of policy checks. Only the user, the check, and its outcome are logged.
- Not stored by Authorization Hub: the model provider's own processing. Your provider's data retention terms apply.
Conversations and preferences are retained when the assistant service is restarted.
Trust boundary
- The assistant is instructed to stay on authorization topics and to decline unsafe requests. These instructions guide the language model but they are not a security control.
- Messages and answers are not filtered. A user who deliberately tries to make the assistant act outside its scope may succeed.
- The assistant cannot exceed the user's permissions. It reads data as the user, and it cannot save or publish.
- Every answer must be treated as a suggestion. Proposed changes are checked where possible, but a check proves only the cases that were tested.