Install
Works with Drupal: ^11.1 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Download tar.gz
338 KB
MD5: 2fe2490aa4457f7b4810995f72bc4ddf
SHA-1: ff99f0c46ba8b4b8d35b46ec97b0d85d772fa4ad
SHA-256: 001b9ce634e8c9befffd39885f0e9a9acdc35ae42096852c3df70be9daad991d
Download zip
527.82 KB
MD5: c3211a1127a25c6b8c4fad9c3b5c8805
SHA-1: ed301296632ee06bee27cff34bd8f25bbf97c7ac
SHA-256: 0d28f163c575bdbe4e3275777250977766ef9f0576d0c6ad169d6744d3440289
Release notes
AI Provider: Universal 1.0.0-rc1
Changes since 1.0.0-beta4. Release candidate: no new features are planned before 1.0.0, only fixes.
Security hardening
A security pass over the whole module ahead of the security advisory coverage review. None of these was exploitable without an account holding the permission involved.
- Fact check results: viewing no longer grants editing.
view factcheck resultswas the entity's admin permission, so anyone allowed to view results could also create, edit and delete them wherever entity access is the gate (JSON:API, REST). Viewing now needs that permission; changing or deleting needsadminister factcheck settings. - URL fetching is pinned and capped.
PageFetcher, used by the standalone fact check and the terms API, connects to the address it checked, closing a DNS rebinding window between the check and the request; follows redirects by hand, checking and pinning each hop, five at most; and reads at most 5 MB, streamed, instead of loading any response whole into memory. Without PHP's curl extension the pin cannot be applied, so URL fetches are refused rather than made unpinned. - Every non-global address is refused, not only private and reserved ones: shared address space 100.64.0.0/10 (cloud metadata such as 100.100.100.200, CGNAT, Tailscale), 192.0.0.0/24, 198.18.0.0/15, multicast and the documentation ranges.
use standalone fact checkis marked restrict access: the site fetches any public URL the user gives and spends API budget on it.- Plagiarism matches link only http(s) URLs: an empty or
javascript:URL from the search API made the results page fail to render. - The Hugging Face pipeline tag lookup only takes
org/namerepo names; the name comes from the server's response and went into the URL path.
Bias ratings: no third-party data in the repository
- The bundled Media Bias/Fact Check dataset (
data/mbfc-ratings-full.json, ~8,700 ratings) is removed: MBFC's data is not GPL and cannot be redistributed from a drupal.org repository. Ratings come from a file you are licensed to use (--file) or live from the MBFC API (--fetch). drush factcheck:sync-bias-ratingswithout options no longer imports a bundled sample; the format is shown indata/bias-ratings-example.json, with invented rows. Trusted sites already imported are untouched.- The Reuters entry in the
factcheck_trusted_sites_seedsrecipe no longer quotes MBFC's rating.
New: terms and privacy analyzer (experimental)
ai_provider_universal_termsreads terms of service or a privacy policy, pasted or by URL, and returns findings in 19 categories (arbitration, data sharing, auto-renewal, …), each quoting the clause it comes from. Every quote is checked against the text and invented ones are dropped, so the response can only hold known categories and text that really is in the document. Results are cached by the hash of the normalized text, never by who asked. Not legal advice, and every response says so.- API:
POST /api/terms/analyze?_format=jsonwith{"text"}or{"url"}, behind theuse terms analyzerpermission (restrict access). JSON bodies only; cookie sessions sendX-CSRF-Token; at mostrequests_per_hour(default 30) per user, or per IP for anonymous callers, answering 429 above it. - Settings at
/admin/config/ai/terms: model, piece size, longest document, requests per hour. - Measured on Spanish documents only (F1 0.89 with Qwen3.6-35B-A3B, reasoning off, temperature 0): the prompt and category descriptions are Spanish, and findings' descriptions come back in Spanish on any site. An English prompt measured on English documents is next. See
docs/terms.md.
Other changes
- Requires AI ^1.5 (was ^1.3): AI 1.3.x is out of support.
- Docs: the content scan needs node view access, as the code has required since July (the docs and the permission description said update).
- Code review follow-ups: the claim cell in the content scan results is a
#plain_textrender array; the terms controller injects the config factory and current user instead of reaching the container.
Upgrading
composer update drupal/ai_provider_universal drupal/ai(AI 1.5 or newer).drush updb: sets the terms API's hourly limit on sites that already enabled the submodule from 1.0.x-dev.drush cr.- Check roles that hold
view factcheck results: they keep viewing results but can no longer change or delete them. Roles granteduse standalone fact checkkeep it; the permission is now flagged as restrict access on the permissions page. - Scripts calling
drush factcheck:sync-bias-ratingswith no options, or with--filepointing atmbfc-ratings-full.jsonormbfc-ratings-sample.json, need their own ratings file or--fetch. - Callers of the terms API from 1.0.x-dev: send
Content-Type: application/json, andX-CSRF-Tokenwhen authenticated by cookie.
Known limitations
- Jev (TypeSafe) and OpenAI's Decisions API (gpt-6-luna) are still not verified against their live APIs; everything decision-related is verified end to end against self-hosted Laya, and against both documented wire formats with mocked HTTP.
- The Decision and terms submodules are experimental: Decision targets AI 1.6.x-dev, whose interfaces may still change, and terms is measured on Spanish documents only.
- URL fetching needs PHP's curl extension (used by Drupal's default HTTP handler) and is refused without it; hosts without an IPv4 address are refused.
Requirements
Install: composer require 'drupal/ai_provider_universal:^1.0@RC'