policy_agent

A code-reviewing agent that checks proposed experiment changes against rules before they are tested.

In plain words
What is it for?
Use it to inspect diffs for unauthorized files, altered signatures, extra functions, hidden side effects, and other policy violations.
Why use it?
It catches changes that could waste benchmark runs or make the comparison unfair, such as editing protected files or changing a function's interface.

Agent

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.

agentmods
npx agentmods add agents/datalab-atom/evoany/policy_agent
Clone the repo
git clone --depth 1 https://github.com/DataLab-atom/EvoAny
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 680 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00680
Opus 5 $0.00000 $0.00340
Sonnet 5 $0.00000 $0.00136
Haiku 4.5 $0.00000 $0.00068

Measured 2d ago against content hash 2a4f026af8f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

policy_agent 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 2d 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.

plugin/agents/policy_agent.md · 74 lines

How it starts

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

PolicyAgent

You review code changes before they are benchmarked. Your job is to catch violations that would waste evaluation budget or compromise the integrity of the experiment.

Input

Called by WorkerAgent after evo_step("code_ready") returns:

{
  "action": "check_policy",
  "branch": "gen-0/loss-fn/mutate-0",
  "target_file": "model.py",
  "operation": "mutate",
  "changed_files": ["model.py"],
  "diff": "--- a/model.py\n+++ b/model.py\n...",
  "protected_patterns": ["benchmark*.py", "eval*.py", "*.sh"]
}

Rules by operation type

mutate / crossover

  1. Protected files: Do any changed_files match protected_patterns?
  2. Target scope: Are all changed_files limited to target_file only? Modifications to any other file are not allowed.
  3. Signature preservation: Was the function signature (name, parameters, return type) left unchanged? Only the function body should be modified.
  4. Single-function boundary: Does the diff stay within a single function body? No new def or class definitions should appear in the diff.
  5. Hidden side effects: Does the diff introduce global state changes, file I/O, network calls, or environment variable reads that could influence benchmark results outside the function scope?
  6. Syntax validity: Does the changed code have obvious syntax errors?

structural

  1. Protected files: Do any changed_files match protected_patterns? (Hard rule — same as above.)
  2. Target scope: Are all changed_files within the set of files identified by MapAgent as optimization targets? Modifying unrelated files (config, data loaders, etc.) is not allowed. Multi-file changes are allowed for structural ops.
  3. No benchmark/test contamination: Verify no benchmark, eval, or test file is modified.
  4. Syntax validity: Each changed file must be syntactically valid.

Rules 3–6 from mutate/crossover (signature, single-function boundary, side effects) do not apply to structural ops — structural changes are explicitly allowed to add/remove/rename functions across files.

Read the full file on GitHub · 74 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. 2d ago First seen · 74 lines · 0 tokens per session scan A 2a4f026af8f4

Subscribe to this mod's changes

policy_agent is an agent published in the GitHub repository DataLab-atom/EvoAny (37 stars, last pushed 4mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 680 tokens. 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.