Search by

assetfeed / filament-ai-detector

assetfeed

A Filament infolist entry that checks a text attribute for AI-written passages with the AssetFeed AI content detector and marks them on the View page.

Package info

github.com/assetfeed/filament-ai-detector

pkg:composer/assetfeed/filament-ai-detector

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-27 18:21 UTC

This package is auto-updated.

Last update: 2026-11-27 19:09:39 UTC


README

A Filament infolist entry that checks a text attribute for AI-written passages with the AssetFeed AI content detector and marks them on the View page:

  • an orange bar for likely AI, amber for unsure, green for likely human;
  • a tint behind the passages the detector is most sure about;
  • a card with the verdict, word count and score when you hover a passage;
  • a bar under the text with the share of AI text, a switch between highlights, side bars only and no marks, and a Recheck button.

The entry on a Filament View page

The same in dark mode

The check runs on your server: the entry takes the text from the record, and the API key never reaches the browser. The last result is kept in the Laravel cache, so no migration is needed. If the text is edited after a check, the entry says so and asks for a recheck.

Install

composer require assetfeed/filament-ai-detector

Requires PHP 8.2+ and Filament 4 or 5 (with the Laravel versions Filament requires). Tested on Filament 5.12.0 (Livewire 4.4.10) with Laravel 13.44.1, and on Filament 4.17.0 (Livewire 3.8.12) with Laravel 12.74.0 and 13.44.1, all on PHP 8.4. Filament 3 is not supported. The service provider is discovered automatically.

Register the plugin on your panel:

use AssetFeed\FilamentAiDetector\AiDetectorPlugin;

$panel->plugin(AiDetectorPlugin::make())

If you use a custom theme, nothing needs to be added to it: the entry brings its own stylesheet and a small Alpine component that Filament loads when the entry is on the page. Run php artisan filament:assets on deploy, as you do for any Filament plugin.

Configure

Checks spend credits on an AssetFeed account. Free accounts include 500 credits per month, and one check uses 5 credits (plans). Get a key at assetfeed.com/api-keys and put it in .env:

ASSETFEED_API_KEY=your-key

Optionally publish the config (endpoint, timeout, cache store and TTL, text size limit, throttle) and the translations:

php artisan vendor:publish --tag=filament-ai-detector-config
php artisan vendor:publish --tag=filament-ai-detector-translations

The endpoint must use https. Texts above the size limit are not sent, and the throttle caps how often one user can run checks (10 per minute by default).

Results live in the cache store from filament-ai-detector.cache.store (the default store when null). Use a persistent store, not array. Checks made with a key are not saved to a check history on AssetFeed's side (see the privacy policy).

If you use Laravel Telescope, it records the headers of outgoing requests, so the X-Api-Token header with your key may appear there.

Use

use AssetFeed\FilamentAiDetector\AiDetectionEntry;

public static function infolist(Schema $schema): Schema
{
    return $schema->components([
        AiDetectionEntry::make('body')->columnSpanFull(),                  // the attribute holds HTML
        AiDetectionEntry::make('notes')->plainText()->columnSpanFull(),    // the attribute holds plain text
    ]);
}

The entry goes into a resource's infolist(), which the View page shows. The check is for the saved text of the record, so edits you have not saved are not checked.

The HTML is cleaned in the browser before it is shown (scripts, styles, images and all attributes are dropped). Anyone who can open the page and see the entry can run a check, and each check uses credits of the key's account. English text only, from about 50 words. The score is an estimate, not proof of how a text was written.

How the check is secured

The Recheck button calls an #[Exposed] method of the entry through the page's own Livewire component, so the panel's authentication, the page's record and the tenant apply as for any other Filament action. On top of that the method:

  • reads the text from the record, never from the request;
  • looks the record up again through the resource's getEloquentQuery() and canView();
  • refuses when the entry is hidden;
  • counts the check against the user's throttle.

Build the assets

dist/ is committed. To rebuild after changing resources/js or resources/css: npm install && npm run build. Tests: composer test and npm test. The workbench panel in workbench/ runs with vendor/bin/testbench workbench:build and vendor/bin/testbench serve; workbench/fake-detector.php stands in for the detector API.

Related

assetfeed/nova-ai-detector for Laravel Nova. Plugins for TinyMCE, HugeRTE, Tiptap and Editor.js: assetfeed/ai-detector-plugins.

MIT licence.