write-detection-rule

write-detection-rule is a skill for Claude Code, Codex from akasecurity/ai-tc. It costs 0 tokens per session (2,778 once invoked), scanned A, original, Apache-2.0.

A guide for creating and changing JSON security rules for an AI traffic-control rule engine. These rules describe what to detect, how serious it is, and which text or code patterns match.

In plain words
What is it for?
Writing detection rules for personal data, financial information, secrets, health information, code flaws, configuration issues, and other categories.
Why use it?
It helps authors follow the exact rule format, so misspelled or unsupported fields are caught instead of silently ignored.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Writing detection rules for personal data, financial information, secrets, health information, code flaws, configuration issues, and other categories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/akasecurity/ai-tc/write-detection-rule
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 akasecurity/ai-tc --skill write-detection-rule
Clone the repo
git clone --depth 1 https://github.com/akasecurity/ai-tc

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 write-detection-rule

README.md
[![agentmods](https://agentmods.dev/badge/skills/akasecurity/ai-tc/write-detection-rule.svg)](https://agentmods.dev/skills/akasecurity/ai-tc/write-detection-rule)
Your own site
<a href="https://agentmods.dev/skills/akasecurity/ai-tc/write-detection-rule"><img src="https://agentmods.dev/badge/skills/akasecurity/ai-tc/write-detection-rule.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,778 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 198
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
How audits are shown
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.00000 $0.02778
Opus 5 $0.00000 $0.01389
Sonnet 5 $0.00000 $0.00556
Haiku 4.5 $0.00000 $0.00278

Measured 7d ago against content hash 54afb528bf6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

write-detection-rule 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 7d 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.

skills/write-detection-rule/SKILL.md · 204 lines

How it starts

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

Skill: write-detection-rule

This skill teaches Claude Code how to write detection rules for the AI Traffic Control rule engine. Read this before creating or modifying anything in rules/. The full rule schema is Rule in packages/schema/src/zod/rule.ts — it is the source of truth for every field below.

Rule file format (specVersion 1)

Every rule is a JSON file named <rule-name>.json inside a pack directory:

{
  "specVersion": 1,
  "id": "<pack-id>/<rule-name>",
  "name": "Human-readable name",
  "category": "pii|financial|secret|phi|code_context|code_flaw|custom|config",
  "severity": "critical|high|medium|low",
  "matcher": { ... },
  "postValidators": ["luhn"],
  "examples": ["example matching string"]
}

A misspelled key fails the parse — it is not dropped

Every object in the rule tree is strict: an unrecognized key is a parse error naming the key, at whatever depth it sits. This holds for the rule itself, for matcher, appliesTo, requiresNearby, the object form of a postValidators entry, and for fixture files including each entry of expectedSpans.

The reason is that the old behaviour was to strip the key and carry on, which is the worst outcome available: the rule still parses, still loads and still fires, with whatever the key was meant to configure simply gone. postValidator for postValidators dropped a false-positive guard. capture_group for captureGroup widened the redacted span from the value to the whole match. windowChar for windowChars left a proximity gate at the 160-character default while the author believed they had narrowed it. None of these produce a failing fixture, so nothing caught them.

So a rule that parses is a rule whose every key was understood. If you get Unrecognized key, check the spelling against Rule in packages/schema/src/zod/rule.ts — the field is real but named something else, or it belongs one level up or down.

Matcher types

keyword — fast literal or phrase match, good for high-recall low-precision terms:

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

Subscribe to this mod's changes

write-detection-rule is a skill published in the GitHub repository akasecurity/ai-tc (11 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,778 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-31.

Related

Other skills, from other repositories

content-planner

GSC-driven content calendar. Pulls real Search Console data, finds the highest click-potential opportunities (striking-distance queries at positions 5-20, unanswered query intent, related-keyword expansions), and produces a dated, prioritized content calendar — ready to hand to /content-writer. Use when the user asks…

nowork-studio/notfair-plugin · 123 tokens

meta-tags-optimizer

Optimize title tags, meta descriptions, Open Graph, and Twitter cards for maximum click-through rate. Generates multiple A/B test variations with character counting and SERP preview. Use when asked to "optimize title tag", "write meta description", "improve CTR", "Open Graph tags", "fix my meta tags", "social media…

nowork-studio/notfair-plugin · 91 tokens

setup-cms

Connect a CMS to notfair SEO tools. Guides users through configuring WordPress, Strapi, Contentful, or Ghost — tests the connection, and writes credentials to .env.local. Once set up, seo-analysis automatically cross- references CMS content against Google Search Console data. Use whenever the user says "connect my…

nowork-studio/notfair-plugin · 111 tokens

broken-link-checker

Scans a website to find broken links (404s, 500s). Crawls internal pages, identifies broken outbound links, and reports source pages for easy fixing. Use this when the user asks to "check for broken links", "find 404s", "audit my links", or "is my site healthy".

nowork-studio/notfair-plugin · 72 tokens

google-ads-audit

Google Ads account audit and business context setup. Run this first — it gathers business information, analyzes account health, and saves context that all other ads skills reuse. Trigger on "audit my ads", "ads audit", "set up my ads", "onboard", "account overview", "how's my account", "ads health check", "what should…

nowork-studio/notfair-plugin · 114 tokens

google-ads-copy

Generate and A/B test Google Ads copy. Use when asked to write ad copy, headlines, descriptions, create ad variants, test ad messaging, improve CTR, or generate RSA (Responsive Search Ad) components. Trigger on "ad copy", "write ads", "headlines", "descriptions", "RSA", "responsive search ad", "ad text", "ad…

nowork-studio/notfair-plugin · 121 tokens