feat: add Elixir framework support - #946
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
6e5076c to
57700c0
Compare
5bc160d to
f14d962
Compare
Adds Elixir as a supported framework, stacked on the Go framework PR: - Integration.elixir enum entry in the frameworks block, before the language fallbacks - ELIXIR_AGENT_CONFIG in src/frameworks/elixir/ — claims a mix.exs with a def project definition, gathers whether the app is Phoenix (:phoenix dep) as agent context for the Plug integration nudge, installs by editing mix.exs deps then mix deps.get (Mix has no single add command) - mixPackageManager helper + FRAMEWORK_REGISTRY entry - bash-fence allowlist for mix: deps.get/deps.update/deps.tree/compile/format/hex.info only — mix runs arbitrary project-defined tasks, so run/test/phx.server/ecto.* stay denied - Pins framework: elixir on integration-elixir in the variant-resolution contract test, matching context-mill PR #268 which must release before this merges - Marks mix.exs as a real framework target in the agentic manifest comment Generated-By: PostHog Code Task-Id: 9c949855-7611-48f2-b8b5-7aa4112543e5
f14d962 to
ab2cdff
Compare
The comment implied only run/test/phx.server execute code. mix compile also runs code (compile-time macros); it is permitted under the "builds are equivalent risk" model, not because it is code-free. Clarify. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Additive conflicts against the Flutter work: both language helpers kept. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| // under the "builds are equivalent risk" model in the file header; run/test/ | ||
| // phx.server are denied so app code, tests, and servers aren't run. | ||
| mix: [ | ||
| 'deps.get', |
There was a problem hiding this comment.
High: Repository-defined Mix aliases bypass the command fence
A repository can override deps.get or any other allowed task with a Mix alias that invokes an Elixir function, script, or shell command. When the agent follows the Elixir installation prompt and runs mix deps.get, attacker-controlled code from mix.exs executes outside an OS sandbox; avoid enabling Mix in the pi harness until it can run inside a filesystem and network sandbox, rather than relying on task-name allowlisting. (hexdocs.pm)
PR overviewThis pull request adds Elixir project support by permitting selected Mix dependency and formatting commands through the agent’s command fence. Two security issues remain open, and none have yet been addressed. An attacker-controlled repository can redefine an allowed Mix task to execute arbitrary code outside an OS sandbox, while unrestricted formatting paths can modify Elixir files outside the intended workspace. The Mix integration should remain disabled or be sandboxed and constrained before release. Open issues (2)
Fixed/addressed: 0 · PR risk: 8/10 |
|
Full e2e run of this PR pair (wizard #946 + context-mill #268, both with main merged in) against teslamate-org/teslamate. Set up, best self-verification of the four languages — Dashboard and notebook created through prod MCP. Independently re-verified: Note: the context-mill branch as filed fails at the dashboard step — its agent prompts predate the |
The result JSON parsed package.json and pubspec.yaml only, so Go, Rust, Java, and Elixir runs reported hasPosthogDep false; a *.env file like gotify's also failed the .env prefix check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…sitive Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Elixir and Go framework support landed in parallel, so every conflict was two frameworks claiming the same list. Kept both sides throughout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| 'deps.update', | ||
| 'deps.tree', | ||
| 'compile', | ||
| 'format', |
There was a problem hiding this comment.
Medium: Mix formatting escapes the workspace
Once the first argument is format, the fence accepts every trailing path. A prompt-injected repository can make the pi agent run mix format ../sibling/lib/victim.ex, causing Mix to rewrite an Elixir file outside installDir. Remove format from this allowlist, or enforce that every format target resolves inside the working directory before execution.
Elixir support (#946) landed on main, so the conflicts were rust and elixir claiming the same lists. Kept both sides throughout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Elixir support (#946) landed on main, so the conflicts were java and elixir claiming the same lists. Kept both sides throughout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

























Related PRs:
mainand can merge on its own, in any order relative to the sibling Go/Elixir/Rust/Java framework PRs.Adds Elixir as a supported framework, following the backend-framework pattern:
Integration.elixirenum entry in the frameworks block, before the language fallbacksELIXIR_AGENT_CONFIGinsrc/frameworks/elixir/— claims amix.exswith adef projectdefinition (a stray placeholder file falls through); gathers whether the app is Phoenix (:phoenixdep) as agent context, which drives thePostHog.Integrations.Plugprompt nudge; installs by editing themix.exsdeps list thenmix deps.get(Mix has no single add verb — same manual-edit framing as pip)mixPackageManagerhelper +FRAMEWORK_REGISTRYentrymix:deps.get|deps.update|deps.tree|compile|format|hex.infoonly — mix executes arbitrary project-defined tasks, somix run/test/phx.server/ecto.*stay deniedframework: elixironintegration-elixirin the variant-resolution contract test, matching the context-mill PR aboveWhy: the wizard docs page lists Elixir as "Coming soon"; instead of removing the label (posthog.com#18797), we're making the wizard actually support it.
Verification:
pnpm build✅,pnpm test✅ (1542 tests, incl. new elixir detect + mix fence tests),pnpm fix✅Created with PostHog Code