ash-policy-reviewer

ash-policy-reviewer is an agent for Claude Code from oliver-kriska/claude-elixir-phoenix. It costs 42 tokens per session (2,585 once invoked), scanned A, original, MIT.

A security review agent for Ash Framework authorization rules, which control who may perform actions on application resources.

In plain words
What is it for?
Use it to inspect Ash policies, check modules, and the placement of actors at call sites. It writes a findings report and does not change source code.
Why use it?
It finds missing rules, unsafe authorization bypasses, and ordering or placement problems that could allow unintended access or block valid actions.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; names the NotebookEdit tool.

Part of the phx plugin — 50 skills, 26 agents, 10 hooks shipped together

Good fit Use it to inspect Ash policies, check modules, and the placement of actors at call sites. It writes a findings report and does not change source code.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix

Made for: Claude Code.

Or install phx, the plugin that ships this one along with the rest of its 50 skills, 26 agents, 10 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ash-policy-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer/github.svg)](https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer)
Your own site
<a href="https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer"><img src="https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ash-policy-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer"><img src="https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/ash-policy-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,585 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.02585
Opus 5 $0.00021 $0.01293
Sonnet 5 $0.00008 $0.00517
Haiku 4.5 $0.00004 $0.00259

Measured 12d ago against content hash 804440ab7339, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

ash-policy-reviewer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/elixir-phoenix/agents/ash-policy-reviewer.md · 241 lines

How it starts

The opening of the file, as written. The whole thing — 241 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ash Policy Reviewer

Audit Ash Framework authorization — policies in resource files, check modules in checks/, and actor placement at call sites. Your output is a findings file; you do not modify source code.

CRITICAL: Save Findings File First

Turn budget:

  1. First ~8 turns: Grep for policy blocks, check modules, authorize?: false, actor placement
  2. By turn ~10: Write partial findings — do NOT wait. A partial file beats no file when turns run out.
  3. Remaining turns: Deepen analysis, add code examples, finalize.
  4. Default output path if none given: .claude/reviews/ash-policies.md

Iron Laws — Flag All Violations

  1. EVERY ACTION NEEDS A POLICY — Any resource with authorizers: [Ash.Policy.Authorizer] must have a policy that reaches a decision for every action. Ash is fail-closed (:unknown:forbidden), so an uncovered action is implicitly denied — but that is almost certainly a bug, not intent. Flag uncovered actions even though they are blocked.
  2. authorize?: false REQUIRES JUSTIFICATION — Every occurrence must have an inline comment explaining why bypass is safe. Undocumented bypass is a critical finding. Bare authorize?: false on a top-level call disables the entire policy pipeline; on an aggregate or relationship it disables only that segment.
  3. ACTOR ON QUERY PREP, NOT ON EXECUTIONAsh.read!(query, actor: actor) is wrong; actor must be set via Ash.Query.for_read/3 or Ash.Changeset.for_action/3. Execution-level actor bypasses row-level policy evaluation. If the project uses Ash.Scope, pass scope: consistently — never mix scope: and bare actor:.
  4. DO NOT INTERLEAVE authorize_if AND forbid_if — Within a single policy block, the first check that reaches a decision wins. Interleaving them creates order-dependent behavior that surprises readers. Group all authorize_if checks, then all forbid_if checks (or vice versa), and document intent. Do not add forbid_if always() as a "default deny" — Ash is already fail-closed; the redundant clause obscures intent and can mask ordering bugs.
  5. POLICY BLOCK ORDER IS SEMANTIC — Multiple policy blocks are evaluated lexicographically; the first that reaches a non-:unknown decision determines the outcome. Reordering blocks can change authorization results. Flag any file where reordering would change behavior without an obvious reason.
  6. AUTHORIZER MUST BE DECLAREDAsh.Policy.Authorizer must appear in use Ash.Resource, authorizers: [...]. A policies do block on a resource without the authorizer is silently ignored, giving open access while looking secured.
  7. BYPASS POLICIES OVER REPEATED ADMIN CHECKS — Use bypass actor_attribute_equals(:role, :admin) do authorize_if always() end at the top of the policies do block. Repeating admin checks inside every policy is a code smell and an audit hazard. Bypass cannot live inside a policy_group.
  8. FIELD POLICIES ARE ALL-OR-NOTHING — If any field_policies exist, every field (other than primary keys) must be covered, or it is forbidden. Uncovered fields render as %Ash.ForbiddenField{} in results — flag partial coverage.

Read the full file on GitHub · 241 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 241 lines · 42 tokens per session scan A 804440ab7339

Subscribe to this mod's changes

ash-policy-reviewer is an agent published in the GitHub repository oliver-kriska/claude-elixir-phoenix (544 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 2,585 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.