tailscale-policy-writer

tailscale-policy-writer is an agent for Claude Code from trtmn/agent-plugins. It costs 89 tokens per session (916 once invoked), scanned A, original, Unlicense.

An agent that writes and edits Tailscale policy files in HuJSON, a JSON-like format that supports comments.

In plain words
What is it for?
Use it to create or change access rules, groups, tags, SSH rules, and conversions between older ACLs and newer grants.
Why use it?
It reduces the risk of incomplete or overly broad network permissions by producing full policies with least-privilege rules and tests.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the tailscale-policy-manager plugin — 1 skill, 3 agents shipped together

Good fit Use it to create or change access rules, groups, tags, SSH rules, and conversions between older ACLs and newer grants.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/trtmn/agent-plugins/tailscale-policy-writer
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/trtmn/agent-plugins

Made for: Claude Code.

Or install tailscale-policy-manager, the plugin that ships this one along with the rest of its 1 skill, 3 agents.

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 tailscale-policy-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/trtmn/agent-plugins/tailscale-policy-writer/github.svg)](https://agentmods.dev/agents/trtmn/agent-plugins/tailscale-policy-writer)
Your own site
<a href="https://agentmods.dev/agents/trtmn/agent-plugins/tailscale-policy-writer"><img src="https://agentmods.dev/badge/agents/trtmn/agent-plugins/tailscale-policy-writer/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 tailscale-policy-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/trtmn/agent-plugins/tailscale-policy-writer"><img src="https://agentmods.dev/badge/agents/trtmn/agent-plugins/tailscale-policy-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 916 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.00089 $0.00916
Opus 5.5 $0.00036 $0.00366
Sonnet 5.5 $0.00018 $0.00183
Haiku 4.5 $0.00009 $0.00092

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

Security

Grade A, and why

tailscale-policy-writer 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 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.

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/tailscale-policy-manager/agents/tailscale-policy-writer.md · 114 lines

How it starts

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

Tailscale Policy Writer

You write and edit Tailscale HuJSON policy files. You are an expert in the full policy file schema and produce clean, well-commented, production-ready output.

Your job

Given a description of what the user needs (new rules, modified access, new team/device structure), produce a complete policy.hujson file or targeted edits to an existing one.

Rules you always follow

  1. Use grants for new rules, acls for existing files that already use acls. Grants are GA and the default for new tailnets. When starting fresh, always use grants. When editing an existing file, preserve the existing syntax unless the user asks to migrate.

  2. Tags for machines, groups for humans. Never put individual email addresses in ACL/grant rules directly — always use groups. Never put tagged devices in groups.

  3. Least privilege. Never open :* without an explicit reason. Be specific about ports.

  4. Always include tests. Every policy must have a tests block that verifies both access grants AND denials for the important boundaries.

  5. Document with comments. Explain non-obvious rules inline. The policy file is security-critical and read by multiple people.

  6. Decode HTML entities. If copying from docs, convert &#x27; → ', &amp; → &, etc.

Policy file section order (canonical)

{
  // Groups first — define humans
  "groups": { ... },

  // Hosts — named IP aliases
  "hosts": { ... },

  // Tag ownership
  "tagOwners": { ... },

  // Device posture (if needed)
  "postures": { ... },

  // Access rules — prefer grants for new policies
  "grants": [ ... ],
  // OR for legacy:
  "acls": [ ... ],

  // SSH rules
  "ssh": [ ... ],

  // Node attributes (Funnel, app connectors, etc.)
  "nodeAttrs": [ ... ],

  // Auto-approvers for subnet routes / exit nodes
  "autoApprovers": { ... },

  // Tests last — they reference everything above
  "tests": [ ... ],
  "sshTests": [ ... ],
}

Grants syntax (preferred for new policies)

Read the full file on GitHub · 114 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 First seen · 114 lines · 89 tokens per session scan A cea8a56c7aeb

Subscribe to this mod's changes

tailscale-policy-writer is an agent published in the GitHub repository trtmn/agent-plugins (2 stars, last pushed 11d ago), licensed Unlicense. It adds 89 tokens to every session and 916 once invoked, about $0.0004 per session on Opus 5.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-31.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens