Phoenix API Generator

ReviewAudited by ClawScan on May 10, 2026.

Overview

This instruction-only Phoenix API generator is not malicious, but its tenant/auth templates could generate APIs that trust a user-supplied tenant header and fail to scope some record actions by tenant.

Install or use this only if you will carefully review the generated code. Pay particular attention to tenant and authorization logic: do not trust x-tenant-id directly, scope every read/update/delete query by tenant, add cross-tenant denial tests, and review all migrations and router changes before merging.

Findings (3)

Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.

What this means

Using the skill can change application code, routes, tests, and database migrations.

Why it was flagged

The skill is intended to create or modify many project files. This is disclosed and purpose-aligned, but it is still a meaningful local project mutation.

Skill content
Generate schemas, migrations, controllers, views, router, and tests. Ask the user to confirm before writing files.
Recommendation

Use version control, review the generated diff, and require explicit approval before applying generated files.

What this means

If generated as-is, API clients may be able to choose or spoof a tenant ID and access another tenant's data.

Why it was flagged

The tenant selection pattern assigns tenant identity directly from a client-controlled header, with no shown validation against the authenticated account or token claims.

Skill content
tenant_id = get_req_header(conn, "x-tenant-id") |> List.first()
assign(conn, :tenant_id, tenant_id)
Recommendation

Derive tenant identity from authenticated claims or verify the header against the authenticated user's memberships before assigning it.

What this means

Generated APIs could allow cross-tenant reads, updates, or deletes if record IDs are guessed or exposed.

Why it was flagged

The controller pattern scopes the index action by tenant, but show/update/delete retrieve records only by ID. That contradicts the stated tenant-scoped API goal and can propagate into generated production code.

Skill content
def show(conn, %{"id" => id}) do
    user = Accounts.get_user!(id)
...
def update(conn, %{"id" => id, "user" => params}) do
    user = Accounts.get_user!(id)
...
def delete(conn, %{"id" => id}) do
    user = Accounts.get_user!(id)
Recommendation

Generate tenant-scoped get/update/delete functions, pass tenant_id into every resource lookup, and add tests that deny cross-tenant access.