---
name: kimaai_admin_assistant_prompt
type: filter
since: 1.5.0
tier: free
feature: admin-assistant
area: admin-assistant
summary: Changes an administrator's message before the admin assistant's gate and the AI provider see it.
parameters:
  - name: prompt
    type: mixed
    description: The administrator's message as the request sent it, a string of plain text with at most 5,000 characters.
  - name: data
    type: array
    description: The request's JSON body.
  - name: request
    type: WP_REST_Request
    description: The REST request.
returns:
  type: mixed
  description: The message to use, a string.
surfaces: [admin_assistant]
---

# kimaai_admin_assistant_prompt

## When it fires

First thing in an admin assistant request (`POST /wp-json/kimaai/v1/admin-assistant`), which only users who may manage options send, from the KimaAI settings screen. The route has already turned the message into plain text of at most 5,000 characters. After the filter come `kimaai_admin_assistant_gate`, the daily limit and the maximum message length; the quick action buttons of the assistant send their text through the filter too.

What the filter returns is the message from then on: the gate checks it, the setup workflows read it, the AI provider gets it and the assistant's history stores it. Return a string. Unlike the chatbot, the admin assistant masks no card numbers or IBANs.

The admin assistant is not released yet: its panel and its routes are switched off in this release, so these requests are not sent.

## Example

```php
add_filter(
  'kimaai_admin_assistant_prompt',
  function ($prompt, array $data, WP_REST_Request $request) {
    if (!is_string($prompt)) {
      return $prompt;
    }

    // Your team writes "KB" for the knowledge base.
    return (string) preg_replace('/\bKB\b/', 'knowledge base', $prompt);
  },
  10,
  3
);
```

## Related

- `kimaai_admin_assistant_gate`: blocks a message after this filter.
- `kimaai_admin_assistant_ai_payload`: changes the whole request to the provider, not only the message.
- `kimaai_chatbot_prompt`: the same filter for the chatbot.
