policy-validation

policy-validation is a skill for Claude Code, Codex from tallclub/matimo. It costs 49 tokens per session (2,207 once invoked), scanned B, original, MIT.

A guide to a security policy system that checks whether an agent's requested tools and network access are allowed. The policy can restrict domains, HTTP methods, credentials, namespaces, and command or function tools.

In plain words
What is it for?
Use it to define and validate allowed tool behavior, check requests with the policy validator, and enforce fixed security rules before tools run.
Why use it?
It prevents an agent from weakening its own safety rules or reaching blocked systems. It also helps stop server-side request forgery, a technique for making a server access unintended internal addresses.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define and validate allowed tool behavior, check requests with the policy validator, and enforce fixed security rules before tools run.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tallclub/matimo/policy-validation
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.

Any agent
npx skills add tallclub/matimo --skill policy-validation
Clone the repo
git clone --depth 1 https://github.com/tallclub/matimo

Made for: Claude Code, Codex.

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 policy-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/tallclub/matimo/policy-validation/github.svg)](https://agentmods.dev/skills/tallclub/matimo/policy-validation)
Your own site
<a href="https://agentmods.dev/skills/tallclub/matimo/policy-validation"><img src="https://agentmods.dev/badge/skills/tallclub/matimo/policy-validation/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 policy-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/tallclub/matimo/policy-validation"><img src="https://agentmods.dev/badge/skills/tallclub/matimo/policy-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,207 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00049 $0.02207
Opus 5.5 $0.00020 $0.00883
Sonnet 5.5 $0.00010 $0.00441
Haiku 4.5 $0.00005 $0.00221

Measured 1mo ago against content hash 7eda0ee5fdc7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

policy-validation scanned grade B with 1 finding 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 1mo 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.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

{ "rule": "no-ssrf", "severity": "critical", "message": "URL targets internal/metadata network: http://169.254.169.254/..." }

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

python/packages/core/src/matimo/skills/policy-validation/SKILL.md · 234 lines

How it starts

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

Policy Validation: Security Rules and Enforcement

This skill teaches you Matimo's policy engine — the deterministic rules that decide which tools you may create and what happens each time a tool runs.

Core Principle: The Developer Sets Policy, You Work Within It

The developer configures the policy when they start Matimo (in code or a policy.yaml). No tool lets an agent change it. When a rule blocks you, redesign the tool; do not look for a way around the rule.

// Set by the developer at start-up:
const matimo = await MatimoInstance.init({
  untrustedPaths: ['./agent-tools'],
  policyConfig: {
    allowedDomains: ['api.github.com', 'api.weatherapi.com'],
    allowedHttpMethods: ['GET', 'POST'],
    protectedNamespaces: ['matimo_'],
    allowedCredentials: ['GITHUB_TOKEN', 'WEATHER_API_KEY'],
  },
});

Two Layers

  1. When a tool loads — every tool you create is untrusted and must pass 9 content rules. A tool that breaks a critical or high rule never reaches the registry.
  2. Every time a tool runs — the call is risk-classified, checked against execution gates, and may need a human's approval.

Layer 1: The 9 Content Rules

# Rule id Severity Rejects
1 no-function-execution critical execution.type: function
2 no-command-execution critical execution.type: command
3 no-ssrf critical URLs aimed at localhost or loopback, 0.0.0.0, private ranges (10.*, 172.16-31.*, 192.168.*), link-local 169.254.* (cloud metadata), or *.internal / *.local / *.localhost hosts
4 unauthorized-credential high A placeholder that names a credential (such as {GITHUB_TOKEN} or {API_KEY}) not in allowedCredentials, when the developer set one
5 reserved-namespace critical Names starting with a protected prefix (default matimo_)
6 forced-approval high requires_approval other than true
7 blocked-http-method high Methods outside allowedHttpMethods (default GET and POST)
8 blocked-domain high Hosts outside allowedDomains, when the developer set one (subdomains of a listed domain are allowed)
9 forced-draft-status medium A status other than draft

Read the full file on GitHub · 234 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. 1mo ago Changed · -307 lines · +5 tokens per session scan C → B 7eda0ee5fdc7
  2. 2mo ago First seen · 541 lines · 44 tokens per session scan C 8bc2a3aa9568

Subscribe to this mod's changes

policy-validation is a skill published in the GitHub repository tallclub/matimo (18 stars, last pushed yesterday), licensed MIT. It adds 49 tokens to every session and 2,207 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

policy-validation compared with skills from other repositories

policy-validation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
policy-validationtallclub/matimoSkill18yesterdayMITB49Claude Code, Codex
imagegenopenai/codexSkill133kyesterdayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill99kyesterdayApache-2.0A19Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79k4d agoMITA200Claude Code, Codex
systematic-debuggingobra/superpowersSkill313k3d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code
next-partial-prefetching-adoptionvercel/next.jsSkill143ktodayMITA103Claude Code