What the agent does
The agent starts from the issue text and the repository in its own cloud sandbox, and checks what the app already has before it adds anything, because Laravel ships most of the pieces and the panel only needs to be told to use them. In an app like filamentphp/demo, composer.json requires filament/filament ^5.0 on laravel/framework ^12.0 with pestphp/pest ^3.0, larastan and laravel/pint in dev. app/Models/User.php already implements MustVerifyEmail beside FilamentUser and HasTenants, casts email_verified_at to a datetime, and the create_users_table migration already has a nullable email_verified_at column; database/factories/UserFactory.php sets email_verified_at to now() and has an unverified() state. What is missing is on the panel: app/Providers/Filament/AdminPanelProvider.php configures ->login(Login::class), ->databaseNotifications(), ->spa() and the middleware stack, but never calls ->emailVerification(), so an unverified user who can log in reaches every resource.
The change is one line on the panel plus the places that line affects. The agent adds ->emailVerification() to the panel builder, which registers Filament's email verification prompt page, the signed verification route and the EnsureEmailIsVerified middleware on the panel's authenticated routes. It checks app/Filament/Pages/Auth/Login.php, a subclass of Filament's login page that pre-fills the demo credentials, needs no change. In database/seeders/DatabaseSeeder.php, where the admin user is created through User::factory, the factory already stamps email_verified_at, so the seeded login keeps working; the agent says so in the pull request rather than editing the seeder. .env.example sets MAIL_MAILER=smtp toward a mailhog host, and phpunit.xml overrides it to array for tests, so no mail configuration changes.
Tests follow tests/Pest.php, which extends Tests\TestCase, uses RefreshDatabase and acts as a fresh verified User before every case in tests/Filament. The agent adds tests/Filament/Auth/EmailVerificationTest.php with cases that an unverified user created with User::factory()->unverified() who requests the dashboard is redirected to the panel's email verification prompt; that the prompt page renders and its resend action sends Filament's verification notification, asserted with Notification::fake(); that visiting the signed verification URL built from the user's id and email hash marks email_verified_at and redirects into the panel; and that a verified user still reaches ShopDashboard, the page the existing ShopDashboardTest.php covers. It runs composer test:pest and composer test:phpstan, the two halves of composer test, and vendor/bin/pint --test, after composer setup with the SQLite database the repository's tests.yml workflow creates with touch database/database.sqlite.
The pull request links back to the Linear issue and lists what was already in place (the contract on the model, the column, the factory state), the one builder change, the new test file, and the note that existing unverified accounts in a production database will be asked to verify on their next visit.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "A Linear issue labelled agent says: \"Require email verification before anyone can use the admin panel.\" Read composer.json, app/Providers/Filament/AdminPanelProvider.php, app/Models/User.php, app/Filament/Pages/Auth/Login.php, database/migrations/2021_12_13_000001_create_users_table.php, database/factories/UserFactory.php, database/seeders/DatabaseSeeder.php, .env.example, phpunit.xml, tests/Pest.php, tests/Filament/Pages/ShopDashboardTest.php and .github/workflows/tests.yml first, and say which parts of email verification already exist. Add ->emailVerification() to the admin panel and change nothing else on the panel. Add tests/Filament/Auth/EmailVerificationTest.php with Pest cases for: an unverified user is redirected from the dashboard to the verification prompt, the prompt renders and its resend action sends the verification notification under Notification::fake(), the signed verification URL marks the user verified and redirects into the panel, and a verified user still reaches the shop dashboard. Run composer setup, composer test:pest, composer test:phpstan and vendor/bin/pint --test, and paste the outputs in the pull request. Open a pull request that links the issue, lists what already existed and what changed, and notes what existing unverified accounts will see.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
What comes back is a pull request with a one-line change in app/Providers/Filament/AdminPanelProvider.php and a new tests/Filament/Auth/EmailVerificationTest.php; the model, the migration, the factory and the seeder are untouched, and the description says why. It shows the composer test:pest output with the four new cases beside the existing suite, the PHPStan result, and the Pint check.
The repository's tests workflow runs the same composer test:pest on the pull request after npm run build and the SQLite setup, and the phpstan workflow runs the analysis. A reviewer checks that the builder change is the only panel change, that the prompt page is reachable while everything else behind the panel is not for an unverified user, that the notification goes out through the configured mailer in production, and that the seeded demo login still works because the factory verifies it. Then they merge, and users without a verified address see the prompt on their next visit.
Run it on every Linear issue labelled agent
In the console, an automation with a linear trigger on linear.issue.labeled and the label agent starts one run per labelled issue, with the issue as its context, in the Project's repository. Changes made by an app integration never fire it, so the agent's own updates to the issue do not start new runs.
From your own server, the same run is one POST /o/{org}/sessions per issue: put the repository in resources, and add the issue's https://linear.app/<workspace>/issue/<ID> URL there too to have Rush read it through your Linear connection into the prompt. The key's webhook_url posts run.completed or run.failed when the turn finishes, with the session_url to read the result.
The use case this job follows, with its automation and trigger: Turn a Linear label into a PR.
Why run it on Rush?
Email verification on an admin panel is a small change with a large blast radius: a missing contract on the model, a seeder that creates unverified admins, or a mailer that is not configured locks real users out on deploy. In a Rush sandbox the agent runs the app's own setup, the full Pest suite and PHPStan, and drives the verification flow in tests with a faked notification, keeping every command and its output in the transcript, so the pull request shows the gate working rather than the one line that turns it on.
Starting from a Linear label means a security request becomes a reviewed pull request without a developer context-switching into the panel code. The same request runs across every Filament app the team owns, each in its own sandbox, and each pull request lists what that app already had.
Frequently asked questions
Does the User model need to change?
Not in this app: app/Models/User.php already implements MustVerifyEmail, which is the contract Filament's verification middleware checks. The agent reads the model first and says in the pull request that the contract was present. On an app whose user model lacks it, the agent adds the interface, which is the one model change this job can need.
Will the seeded admin be locked out?
No. UserFactory sets email_verified_at to now(), and the seeder creates the admin through the factory, so the demo login keeps working. One of the new tests signs in as a verified factory user and reaches the shop dashboard to prove it.
How is the email tested without a mail server?
phpunit.xml sets MAIL_MAILER to array for tests, and the agent's cases use Notification::fake() to assert that the resend action dispatches the verification notification to the user. The signed URL case builds the link the same way Laravel does, from the user's id and email hash, so the route and the middleware are exercised end to end.
What about users who registered before this change?
Any account whose email_verified_at is null is sent to the verification prompt on its next panel visit and can resend the email from there. The pull request description says so, and a reviewer who wants to grandfather existing accounts can run a one-off update before merging.
More Filament jobs
The same job on other stacks
- Add Email Verification to a FastAPI App on SQLModel (SQLModel)
- Add Email Verification to an AdonisJS App (AdonisJS)
- Add Email Verification to a Django REST Framework Project (Django REST Framework)