---
title: Abilities
---

Mantle registers twelve abilities with the WordPress Abilities API. Abilities are the tool surface the AI chatbot calls, and they are also reachable by any other Abilities API client on the site.

## Registered abilities

Verified with `wp_get_abilities()` on a running installation. All identifiers use the `mantle/` prefix.

<!-- wp:docspress/fields {"title":"mantle/* abilities","description":"Implemented in <code>includes/Model/Abilities/</code>, each extending <code>Ability_Abstract</code> and registered by <code>Modules\\AI_Chatbot\\Abilities_Registrar</code>.","fields":[{"name":"mantle/get-post","type":"string","required":false,"defaultValue":"","description":"Retrieve a single post.","values":"","deprecated":false},{"name":"mantle/search-posts","type":"string","required":false,"defaultValue":"","description":"Search posts.","values":"","deprecated":false},{"name":"mantle/get-content-details","type":"string","required":false,"defaultValue":"","description":"Retrieve details about a piece of content.","values":"","deprecated":false},{"name":"mantle/create-post-draft","type":"string","required":false,"defaultValue":"","description":"Create a draft post. Writes content.","values":"","deprecated":false},{"name":"mantle/create-page-draft","type":"string","required":false,"defaultValue":"","description":"Create a draft page. Writes content.","values":"","deprecated":false},{"name":"mantle/publish-post","type":"string","required":false,"defaultValue":"","description":"Publish a post. Makes content public.","values":"","deprecated":false},{"name":"mantle/generate-block-content","type":"string","required":false,"defaultValue":"","description":"Generate new block markup.","values":"","deprecated":false},{"name":"mantle/rewrite-block-content","type":"string","required":false,"defaultValue":"","description":"Rewrite the content of an existing block.","values":"","deprecated":false},{"name":"mantle/plan-block-edit","type":"string","required":false,"defaultValue":"","description":"Produce a plan for editing blocks without applying it.","values":"","deprecated":false},{"name":"mantle/generate-post-featured-image","type":"string","required":false,"defaultValue":"","description":"Generate and attach a featured image. Creates a media attachment.","values":"","deprecated":false},{"name":"mantle/set-permalink-structure","type":"string","required":false,"defaultValue":"","description":"Change the site permalink structure. Site-wide effect.","values":"","deprecated":false},{"name":"mantle/remember","type":"string","required":false,"defaultValue":"","description":"Persist a note into the chatbot's memory, stored in the <code>ai_chatbot_memory</code> setting.","values":"","deprecated":false}],"searchable":true,"compact":false} /-->

<!-- wp:docspress/callout {"tone":"danger","title":"Several abilities mutate the site","content":"<p><code>publish-post</code> makes content publicly visible, <code>generate-post-featured-image</code> creates media attachments, and <code>set-permalink-structure</code> rewrites site-wide URL structure — which can break inbound links and cached URLs. These are reachable by anything holding <code>mantle_access_chatbot</code>, which is granted to <code>editor</code> by default. Narrow that grant on sites where editors should not be able to change permalinks.</p>","collapsible":false} /-->

## Enumerate abilities on your own site

<!-- wp:docspress/terminal-session {"title":"List Mantle abilities","shell":"bash","prompt":"$","command":"wp eval 'foreach ( wp_get_abilities() as $name => $ability ) { if ( 0 === strpos( $name, \"mantle/\" ) ) { echo $name . PHP_EOL; } }'","output":"mantle/get-post\nmantle/create-post-draft\nmantle/generate-post-featured-image\nmantle/publish-post\nmantle/search-posts\nmantle/set-permalink-structure\nmantle/create-page-draft\nmantle/get-content-details\nmantle/rewrite-block-content\nmantle/generate-block-content\nmantle/plan-block-edit\nmantle/remember"} /-->

Abilities are also exposed over REST by the Abilities API itself at `/wp-json/wp-abilities/v1/`, independently of Mantle's own `mantle/v1` namespace.

## Relationship to the AI routes

Three Mantle REST routes wrap abilities for the block editor:

<!-- wp:docspress/diagram {"title":"Editor to ability","type":"flow","source":"Block editor -> mantle/v1/ai/generate-block: request\nBlock editor -> mantle/v1/ai/rewrite-block: request\nBlock editor -> mantle/v1/ai/plan-edit: request\nmantle/v1/ai/generate-block -> mantle/generate-block-content: invoke\nmantle/v1/ai/rewrite-block -> mantle/rewrite-block-content: invoke\nmantle/v1/ai/plan-edit -> mantle/plan-block-edit: invoke","caption":"The editor talks to Mantle's namespace; Mantle invokes the corresponding ability."} /-->

Generated block markup passes through validation before it reaches the editor. `Modules\AI_Chatbot\Validation` contains a block validator, a markup sanitizer, a design linter, and a content preparer, so malformed or off-brand markup is rejected or repaired rather than inserted directly.

<!-- wp:docspress/callout {"tone":"warning","title":"Abilities register even when the ai_chatbot module is disabled","content":"<p><code>Abilities_Registrar</code> is driven by <code>Controller\\AI_Chatbot</code>, which <code>Bootstrap::load_controllers()</code> instantiates unconditionally. It hooks <code>wp_abilities_api_init</code> at priority 99 regardless of module state, so all twelve abilities and the <code>/ai/*</code> routes are present on a site where <code>ai_chatbot</code> is inactive. This was verified on an installation with the module switched off.</p><p>What the module gates is the chat <em>surface</em>: <code>ai_chat_is_available()</code> requires <code>mantle_access_chatbot</code>, a configured provider, <em>and</em> an active <code>ai_chatbot</code> module. Do not treat disabling the module as a way to revoke ability access — restrict the capability instead.</p>","collapsible":false} /-->

## Prompting against this surface

<!-- wp:docspress/prompt {"prompt":"Review every class in includes/Model/Abilities/ and report, for each ability: its registered name, its input schema, whether it writes to the database, and which capability gates it. Flag any ability that mutates content without a capability check.","model":"Claude Opus 5","mode":"code","thinking":true,"context":"@repository, includes/Model/Abilities/, includes/Modules/AI_Chatbot/Abilities_Registrar.php","caption":"Audit prompt for the ability surface"} /-->
