PhoenixKit 2.63.0: A machine API for agents, and real-pixel zoom
PhoenixKit 2.63.0 adds a machine API that modules plug their tools into, over REST and MCP, with keys and approvals. It also adds real-pixel zoom to the media viewer and closes a hole in the profile form.
A machine API, off by default
There are two sides. The admin API at /api/admin/v1 takes bearer keys owned by a user or a service user, scoped per tool. The public API at /api/shop/v1 needs no key and is rate-limited. The same tools are served over MCP at /mcp/admin and /mcp/shop, and OpenAPI 3.1 documents are generated from them. Risky operations go through dry runs, confirmation codes, an approval queue and Idempotency-Key.
Both sides are off until you switch them on under Settings → API, and an off side answers 404. Core ships only two tools of its own; the real tools come from modules. Minting keys needs the new api permission, which Admins do not get automatically, so an upgrade does not hand every Admin the power to create keys. The Owner always has it.
Media viewer
100% zoom now means one image pixel per screen pixel, and a picture opens at fit or 100%, whichever is smaller, with a toggle and a zoom control. Burned copies keep what the picture is: a transparent picture stays transparent and an animated GIF stays animated. The arrow tool snaps to shapes.
Profile form fix
A user could forge system custom fields through the profile form or change their own email there. Forged fields had let an account past invite-only registration, among other things. The form now keeps only fields with an enabled, user-editable definition and drops the email. A stale profile save also no longer overwrites newer system fields.
Upgrading
Run mix phoenix_kit.update for V218 to V220. It also adds plug PhoenixKit.API.BodyGuard before Plug.Parsers in your endpoint and the API’s cleanup jobs to the Oban crontab, and mcp becomes a reserved path segment. V218 raises the Sync module’s per-minute rate limit from 60 to 600 where it is still 60. Server code that writes arbitrary keys with update_user_profile(user, %{custom_fields: …}) now has them dropped; use Auth.merge_user_custom_fields/3.
Full release notes: PhoenixKit 2.63.0
2.63.0 · 17 October 2026
Migrations V218, V219 and V220 (run mix phoenix_kit.update). Ships PR #932 (profile-form hardening), #933 (chart and
picker options), #934 (the machine API: REST, MCP, keys, confirmations, approvals), #935 (real-pixel zoom and burned copies
that keep what the picture is) and #937 (held approval answers), plus the fixes from the reviews of all five.
Added
- A machine API for modules to plug tools into (#934). A closed admin API at
/api/admin/v1(bearer keys owned by a user or a service user, scoped per tool) and an open public API at/api/shop/v1(no key, rate-limited per cart token and client network), the same tools over MCP at/mcp/adminand/mcp/shop(Streamable HTTP, tools only, stateless), and OpenAPI 3.1 documents generated from the tool registry. Dangerous operations go through dry runs, confirmation codes, an approval queue andIdempotency-Key, shared by REST and MCP. Both sides are off by default (api_admin_enabled,api_public_enabled; an off side answers404). Core shipssystem.get_identityandsystem.get_approval; the real tools come from modules. Guide:dev_docs/guides/2026-10-11-shop-api.md.- Module callbacks:
PhoenixKit.Module.api_tools/0andoban_crons/0, both optional (default[]); install and update write module cron entries into the host’s Oban crontab, never overwriting host edits. apipermission (Settings → API): opt-in for Admin, so an upgrade does not let every Admin mint bearer keys. Owner has it by construction. Service users (users.api_only) get no web session on any door.- Settings → API and an approvals page; strings in the template and the nine locales.
Activity.log_many/2for batch audit writes.- V219 adds
users.api_onlyandphoenix_kit_api_keys; V220 addsphoenix_kit_api_confirmationsandphoenix_kit_api_idempotency(with a partial index for the stuck-operation sweep). No row is created. mix phoenix_kit.updateinsertsplug PhoenixKit.API.BodyGuardbeforePlug.Parsersin the host endpoint (2 MB body limit, JSON errors; the body is always read as JSON, whatever itsContent-Typesays) and adds theIdempotency.PruneWorker,Confirm.ExpiryWorkerandConfirm.PruneWorkercron entries.mcpis now a reserved path segment.
- Module callbacks:
- Real-pixel zoom in the media viewer (#935). 100% is one image pixel per screen pixel; a picture opens at fit or 100%, whichever is smaller, with a fit/actual toggle and a zoom control.
- Stacked bars, a week-stepping
date_nav, a chosen state forsearch_picker(#933).bar_charttakesparts: [%{value, class, label}]per datum andy_max;date_navtakesstep,label,today_labelandevent+targetfor a nested LiveView;search_pickertakeschosen/clear_event/clear_label. All additive. - Viewer libraries are minified in production (#935).
ViewerLibraries.vendor!/1runs Etcher, Fresco, Tessera and Leaf through the host’s esbuild (Etcher 1.3 MB → about 450 KB); without esbuild the readable copy is served.config :phoenix_kit, minify_libraries:overrides either way.
Changed
- V218: the sync per-minute rate-limit default goes from 60 to 600 for
phoenix_kit_sync; rows still at exactly 60 are raised. - Burned copies keep what the picture is (#935). A see-through picture burns as a PNG with its transparency; a photo as
WebP with see-through margins; an animated GIF stays animated (
ImageProcessor.composite_animation/5, a still PNG past the budget); the server-bakedthumbnail_annotatedno longer flattens onto white; a burn is never composed bigger than the picture. - The media viewer’s arrow tool snaps to shapes (#935).
connectors={:off}is gone. - The media browser is split into modules (#935), taking a full compile from about 18.5 s to 13.3 s; rendered HTML is unchanged.
- Dependencies:
:fresco ~> 0.14.0,:tessera ~> 0.3.9,:etcher ~> 0.22.0(floors, reasons inmix.exs) and:beamlab_countries ~> 2.0. - Behaviour change: a host that calls
update_user_profile(user, %{custom_fields: …})from server code to write arbitrary keys now has them dropped; useAuth.merge_user_custom_fields/3.
Fixed
- The profile form no longer lets a user forge system
custom_fieldsor change their email (#932).CustomFields.cast_user_input/2keeps only keys with an enabled, user-accessible definition (never an internal key), scalar values of at most 10,000 characters that pass the definition’s rules; the profile events drop"email". Forged keys had admitted an account past invite-only, minted avatar URLs, planted an<img src>beacon and redirected the user’s own notifications. - A stale profile save no longer overwrites newer system fields.
update_user_profile/2re-reads the row underFOR NO KEY UPDATEand validates the custom-field changes against it. - An approval no longer runs after the admin API is switched off, a re-request after the values changed supersedes the
stale pending approval,
Approvals.finish/3no longer raises after the write,Keys.create_key/3only accepts a service user the creator made, and the validator does the cheap bounds checks first (#934 review). - Machine API gates and credentials: admin calls refused before the rate limiter cost one unit over REST as over MCP,
the limiter’s own refusal is not charged twice, CIDR parsing refuses a signed prefix length,
/mcpreserves a whole path segment, and a public tool with a danger must requirecart_token(ToolLint). - A repeat of an operation that already waits for approval carries
Idempotent-Replayed: true(#937) and returns the sameapproval_id; if the values it touches changed meanwhile, the waiting approval is closed and a new one is queued. The OpenAPI description, MCP instructions and the guide say so. - JSON-decoded stacked bar data renders: string-keyed
"parts"no longer draws a blank chart. - Rubbing out the last shape restores the clean burned copy, a selected text’s selection box no longer lands in the burned copy, burns of transparent pictures keep their transparency, and the viewer’s Edit image button works after the media browser split.
date_nav’s day picker honoursphx-target.
PhoenixKit 2.63.0. Install or update: {:phoenix_kit, "~> 2.63"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.