Use three separate SQL accounts: schema owner, application runtime, maintenance.
The schema owner runs migrations and grants. It is never used by PHP-FPM.
Create accounts and passwords through the database administrator or hosting panel;
the grant generator does not accept or include passwords.

After migrations, generate a reviewable grant script from the trusted checkout:
  python tools/database_roles.py --database DATABASE --runtime-user RUNTIME_USER --maintenance-user MAINTENANCE_USER --host localhost --output reviewed-grants.sql
Use the actual private host scope for a remote database. Keep database ports
private, require verified TLS for remote SQL, and avoid broad public host grants.
The generator never executes SQL. Apply it using the schema owner after review.

Both application roles can append usage ledger records; neither can update or
delete them. Runtime cannot modify/delete audit records, delete exit identities,
modify historical plan/field versions, or execute schema DDL. Maintenance can
delete eligible archived requests and audit records and expire financial payloads
through the bounded policy jobs. Neither role is a database administrator.
Run the owner-side grant generator after adding tables, then verify new privileges.

Public and coordination pools use only runtime credentials. Maintenance credentials
belong in an independently protected CLI environment, never the web .env file or
public PHP-FPM environment. Run hub:maintain and retention with that environment.
For cached Laravel configuration, set APP_CONFIG_CACHE to a separate private CLI
path; do not let the public pool's cached database credentials override the CLI
account, or place maintenance credentials in the browser runtime's config cache.
Use separate Unix users and storage ACLs where the platform supports them.
Shared hosting must provide the required account/grant isolation or use a separate
coordination/maintenance host. Validate the actual privileges before activation.

Grant files do not reset counters, delete quota groups, clear ledger rows or change
tenant policies. Application authorization and row locking remain mandatory.
