perl-security

perl-security is a skill for Claude Code, Codex from nklofy/code-agent-skills. It costs 43 tokens per session (3,775 once invoked), scanned B, a copy of perl-security, Apache-2.0.

A security guide for Perl programs that handle outside input, files, commands, databases, or web requests. It covers Perl taint mode, validation, safe process execution, parameterized DBI queries, and common web vulnerabilities.

In plain words
What is it for?
Use it when writing or reviewing Perl applications that accept user input, access files, run system commands, connect to databases, or serve web requests.
Why use it?
It helps prevent untrusted data from causing command injection, SQL injection, cross-site scripting, request forgery, or unsafe file access. It gives Perl developers safer defaults for code that crosses trust boundaries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it when writing or reviewing Perl applications that accept user input, access files, run system commands, connect to databases, or serve web requests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nklofy/code-agent-skills/perl-security
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 nklofy/code-agent-skills --skill perl-security
Clone the repo
git clone --depth 1 https://github.com/nklofy/code-agent-skills

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 perl-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/nklofy/code-agent-skills/perl-security/github.svg)](https://agentmods.dev/skills/nklofy/code-agent-skills/perl-security)
Your own site
<a href="https://agentmods.dev/skills/nklofy/code-agent-skills/perl-security"><img src="https://agentmods.dev/badge/skills/nklofy/code-agent-skills/perl-security/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 perl-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/nklofy/code-agent-skills/perl-security"><img src="https://agentmods.dev/badge/skills/nklofy/code-agent-skills/perl-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,775 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 91% copy Near-identical to another mod 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.00043 $0.03775
Opus 5 $0.00022 $0.01887
Sonnet 5 $0.00009 $0.00755
Haiku 4.5 $0.00004 $0.00378

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

Security

Grade B, and why

perl-security 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 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.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

open my $fh, $path; # If $path = "|rm -rf /", runs command!

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

Origin

This is a copy

91% identical to perl-security — 12 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

affaan-m-ECC/perl-security/SKILL.md · 505 lines

How it starts

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

Perl Security Patterns

Comprehensive security guidelines for Perl applications covering input validation, injection prevention, and secure coding practices.

When to Activate

  • Handling user input in Perl applications
  • Building Perl web applications (CGI, Mojolicious, Dancer2, Catalyst)
  • Reviewing Perl code for security vulnerabilities
  • Performing file operations with user-supplied paths
  • Executing system commands from Perl
  • Writing DBI database queries

How It Works

Start with taint-aware input boundaries, then move outward: validate and untaint inputs, keep filesystem and process execution constrained, and use parameterized DBI queries everywhere. The examples below show the safe defaults this skill expects you to apply before shipping Perl code that touches user input, the shell, or the network.

Taint Mode

Perl's taint mode (-T) tracks data from external sources and prevents it from being used in unsafe operations without explicit validation.

Enabling Taint Mode

#!/usr/bin/perl -T
use v5.36;

# Tainted: anything from outside the program
my $input    = $ARGV[0];        # Tainted
my $env_path = $ENV{PATH};      # Tainted
my $form     = <STDIN>;         # Tainted
my $query    = $ENV{QUERY_STRING}; # Tainted

# Sanitize PATH early (required in taint mode)
$ENV{PATH} = '/usr/local/bin:/usr/bin:/bin';
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};

Untainting Pattern

use v5.36;

# Good: Validate and untaint with a specific regex
sub untaint_username($input) {
    if ($input =~ /^([a-zA-Z0-9_]{3,30})$/) {
        return $1;  # $1 is untainted
    }
    die "Invalid username: must be 3-30 alphanumeric characters\n";
}

# Good: Validate and untaint a file path
sub untaint_filename($input) {
    if ($input =~ m{^([a-zA-Z0-9._-]+)$}) {
        return $1;
    }
    die "Invalid filename: contains unsafe characters\n";
}

# Bad: Overly permissive untainting (defeats the purpose)
sub bad_untaint($input) {
    $input =~ /^(.*)$/s;
    return $1;  # Accepts ANYTHING — pointless
}

Read the full file on GitHub · 505 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 · 505 lines · 43 tokens per session scan B 94f7c7eab501

Subscribe to this mod's changes

perl-security is a skill published in the GitHub repository nklofy/code-agent-skills (18 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 43 tokens to every session and 3,775 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (recursive force delete). It is 91% identical to perl-security, differing in 12 lines, and is treated as a copy.

Related

Other skills, from other repositories

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for…

JanDeDobbeleer/oh-my-posh · 80 tokens

platform-detection

Identify a .NET project's test platform, framework, command mode, and SDK-style vs classic project system. Use only for "which test platform/framework?", "VSTest or MTP?", or "what runner does this project use?", including bridge settings, UseVSTest opt-outs, and incompatible or conflicting VSTest/MTP configuration.…

dotnet/skills · 146 tokens

unity-version-split

Split a C# file into Unity 6.5+ and pre-Unity 6.5 variants. Use when a file needs different implementations for different Unity versions due to API changes (e.g., EntityId vs int, GetEntityId vs GetInstanceID).

IvanMurzak/Unity-MCP · 59 tokens

omh-rust

This is a Hermes-native rust workflow skill.

rlaope/oh-my-hermes · 69 tokens

axiom-concurrency

Use when writing ANY async code, actors, threads, or seeing ANY concurrency error. Covers Swift 6 concurrency, @MainActor, Sendable, data races, async/await patterns.

CharlesWiltgen/Axiom · 43 tokens