Skip to content

Add usage safeguards to AI Client (limits, visibility, and cost awareness) #345

Description

@jeffpaul

What problem does this address?

As originally requested by @ifahimreza via https://make.wordpress.org/core/2026/03/24/introducing-the-ai-client-in-wordpress-7-0/#comment-48592:

This looks like a great step toward a unified AI layer in WordPress. One concern, though, is that since plugins can send prompts through the AI Client, it may be helpful to have safeguards for usage. For example, allowing site owners to set monthly token/request limits and a simple WP-Admin usage dashboard that shows calls by plugin, with estimated costs and alerts. That could help avoid surprise bills and build more trust in the ecosystem.

What is your proposed solution?

Activity

  1. added this to the 1.0.0 milestone on Mar 27, 2026
  2. moved this to In progress in WordPress AI Roadmapon Apr 16, 2026
  3. modified the milestones: 1.0.0, 0.8.0 on Apr 16, 2026
  4. modified the milestones: 0.8.0, 0.9.0 on Apr 22, 2026
  5. gohelkunjan commented on Apr 23, 2026

    @gohelkunjan
    Contributor

    Hi @jeffpaul

    Introduce a centralized AI usage management layer in WordPress core. This would allow site owners to set global and per-plugin limits (tokens/requests), view usage in a simple WP-Admin dashboard (with plugin-wise breakdown and estimated costs), and receive alerts when thresholds are reached.

    Additionally, require basic plugin attribution for AI requests to improve transparency.

    This would help prevent unexpected costs, improve visibility, and build trust in the AI ecosystem while remaining extensible for developers.

  6. modified the milestones: 0.9.0, 1.0.0 on May 7, 2026
  7. moved this from In progress to Needs review in WordPress AI Roadmapon May 12, 2026
  8. jeffpaul commented on May 12, 2026

    @jeffpaul
    MemberAuthor

    @gohelkunjan there's now a reviewable / testable PR if you want to try that out and provide feedback on the PR, thanks!

  9. gohelkunjan commented on May 12, 2026

    @gohelkunjan
    Contributor

    Hi @jeffpaul

    Great progress on this. As we move toward the 1.0 milestone, I suggest prioritizing these three architectural points to ensure the safeguards are scalable for the core ecosystem:

    Mandatory Attribution: We should require a source or component identifier in the AI Client request. Without standardized attribution, the "per-plugin" breakdown in the dashboard will be impossible to maintain reliably across the ecosystem.

    Hook-based Costing: Instead of hard-coding token rates, let’s provide a filter (e.g., wp_ai_request_cost). This allows specific providers (OpenAI, Anthropic, etc.) to inject their own pricing logic without bloating Core with volatile price tables.

    Aggregated Logging: To avoid database bloat on high-traffic sites, the usage dashboard should rely on daily metadata aggregates rather than storing raw request/response logs in the primary tables.

    Defining these "rules of engagement" now will make the 1.0.0 management layer much more robust.

  10. moved this from Needs review to Done in WordPress AI Roadmapon May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions