# wordpress-seo/trunk/src/ai/http-request/domain/exceptions/insufficient-scope-exception.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version trunk. 20 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/ai/http-request/domain/exceptions/insufficient-scope-exception.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/trunk/raw/src/ai/http-request/domain/exceptions/insufficient-scope-exception.php
- Modified: 2026-07-07T11:18:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/ai/http-request/domain/exceptions/insufficient-scope-exception.php#L10-L20`.

```php
<?php

// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded

// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\AI\HTTP_Request\Domain\Exceptions;

/**
 * Thrown when the AI service rejects a request with a 403 carrying `error="insufficient_scope"`.
 *
 * This is distinct from a generic {@see Forbidden_Exception} because the recovery path differs:
 * a consent-revoked 403 should clear the user's consent and surface a re-consent prompt; a scope
 * failure should NOT touch consent (it's a deployment / token-issuance problem). Callers that catch
 * Forbidden_Exception to revoke consent must catch Insufficient_Scope_Exception first and re-throw
 * it untouched.
 */
class Insufficient_Scope_Exception extends Forbidden_Exception {

}

```
