/elixir:beam-security-hardeningfrom elixir
Hardens Elixir/Erlang/Phoenix code and deployments and answers Zero Trust architecture questions. Use when writing or reviewing code that parses untrusted input, deserializes terms, shells out, handles secrets, compares tokens, parses XML, or makes TLS connections; when adding LiveView routes, live_session, on_mount hooks, or authorization in mount/handle_event; when hardening releases, Erlang distribution, EPMD, or crash dumps; or when asked about the NSA Zero Trust Implementation Guidelines (ZIG), pillars, capabilities, activities, or technology mappings.
Ships in elixir. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two knowledge bases:
Never answer BEAM security or Zero Trust questions from memory - the references override intuition, and the ZIG postdates training.
Full detail per topic: secure-coding.md
String.to_atom/1 on input, atom interpolation (:"x_#{i}", ~w[x_#{i}]a), Module.concat on input, binary_to_atom%{"dark" => :dark}) over String.to_existing_atom/1 - existing-atom variants still accept unintended atoms:erlang.system_info(:atom_count) vs :erlang.system_info(:atom_limit); alert on growth after startup:erlang.binary_to_term(x, [:safe]) - :safe does not block function deserialization, existing-atom injection, or huge-term DoSPlug.Crypto.non_executable_binary_to_term(x, [:safe]) + validate the decoded shapeRange structs blow CPU/memoryput_resp_cookie(conn, ..., sign: true) / encrypt: trueos:cmd/1 or a shell (/bin/sh -c) with one argument stringSystem.cmd/2,3 or open_port({spawn_executable, path}, [{args, list}])System.cmd("env", [], env: %{"DB_PASSWORD" => nil})fn -> System.get_env("SECRET") endInspect on structs holding secrets; implement format_status/2 on GenServers:private ETS tables; :erlang.process_flag(:sensitive, true) for short-lived secret-handling processesPlug.Crypto.prune_args_from_stacktrace/1Code.eval_string/eval_file/eval_quoted or file:script on untrusted input - no in-VM sandbox exists== or pattern matchingPlug.Crypto.secure_compare/2 or :crypto.hash_equals/2 (OTP 25+):ssl, :httpc - default is verify_none, MITM-open)verify: :verify_peer, cacerts: :public_key.cacerts_get(), depth: 2..3, customize_hostname_check: [match_fun: :public_key.pkix_verify_hostname_match_fun(:https)]uri_string:parse/1, never http_uri:parse/1 (mints atoms)xmerl)xmerl_scan on untrusted input (tag/attr names become atoms)internalEntityDecl/externalEntityDecl events with xmerl_sax_parser (XML bomb, XXE)plug_crypto or enacl/libsodium over raw crypto primitivespublic_key:sign/verify over crypto:sign/verify for asymmetric keysmount/on_mount for the stateful connection; live navigation within a live_session skips plugs entirelyon_mount hooks at the router: live_session :default, on_mount: MyAppWeb.UserLiveAuth; pair with a plug pipeline doing the same checksmount (page access) and in every handle_event (actions), server-side via context functions - hiding buttons is not authorizationlive_session for authentication boundaries (user vs admin) or root-layout changes, not per-page authorization rulesput_session(:live_socket_id, "users_socket:#{user.id}") + Endpoint.broadcast(topic, "disconnect", %{}) - live connections outlive logout otherwiseFull detail: deployment-hardening.md
RELEASE_DISTRIBUTION=none when clustering is not neededverify_peer: -proto_dist inet_tls -ssl_dist_optfile ...-kernel inet_dist_use_interface '{...}'; pin ports via inet_dist_listen_min/maxERL_EPMD_ADDRESS, or -start_epmd false-setcookie on the command lineERL_CRASH_DUMP_SECONDS=0 to disable, or redact via Part A secret techniquesulimit -c 0 / LimitCORE=0strip_beamsCFLAGS="-fpie -fstack-protector-strong" LDFLAGS="-pie -z now"binary_to_term on anything attacker-influencedto_atom near params, headers, or JSON keysos.cmd or shell strings; == on a token; :ssl/:httpc without verifyxmerl_scan on fetched/uploaded documents; EPMD reachable beyond the clusterRun Sobelow, Credo - already configured in this project; they catch several of the above.
pillar.capability (4.4), activity pillar.capability.activity (1.1.1)Sources: EEF Security WG (security.erlef.org, github.com/erlef/security-wg); Phoenix LiveView "Security considerations" guide (hexdocs.pm/phoenix_live_view); NSA Cybersecurity ZIG (nsa.gov/Cybersecurity/ZIG) + ZIG CTR PDFs (Primer, Discovery, Phase One, Phase Two; Jan 2026).
references/deployment-hardening.md (opens in a new tab)references/liveview-security.md (opens in a new tab)references/nsa-zig-framework.md (opens in a new tab)references/nsa-zig-phase-details.md (opens in a new tab)references/nsa-zig-technology-capability-mapping.md (opens in a new tab)references/secure-coding.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub xu-chris/ai-setup --plugin elixir5 skills in this plugin
/codebase-cleanupRun focused, pass-based remediation on an Elixir/BEAM codebase to eliminate unsafe patterns and harden runtime boundaries. Use when auditing or cleaning up OTP supervision, DTO/boundary integrity, atom safety, ambient configuration, secret/error redaction, unsafe deserialization or runtime eval, GenServer state and backpressure, serialization and event versioning, persistence backends, package boundaries, or observability. Triggers on "clean up codebase", "remediation pass", "audit OTP/supervision", "remove String.to_atom", "boundary/DTO cleanup", "redact secrets", "ban binary_to_term", "backpressure cleanup". Each invocation targets one pass and produces a focused PR with red-first tests, exit-gate scans, and documented exceptions./elixir-architectUse when designing or architecting Elixir/Phoenix applications, creating comprehensive project documentation, planning OTP supervision trees, defining domain models with Ash Framework, structuring multi-app projects with path-based dependencies, or preparing handoff documentation for Director/Implementor AI collaboration/updating-dependenciesUpdate Elixir/Phoenix dependencies safely. Use when running mix hex.outdated, updating mix.exs version constraints, handling breaking version changes, reviewing changelogs for upgrades, or verifying updates with compile and test.Other plugins' skills for the same job