Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    skill-directives-v1

    View as Markdown

    18 rules · Keryn Software Licence · rules 0.8.0 · all packs

    How to read a rule
    Severity
    How bad the finding is if it is real: error fails a default gate, warning and info do not.
    Confidence
    P0 exploitable as written; P1 dangerous in context; P2 a heuristic or a posture check: confirm by reading the code.
    False-positive risk
    low: an exact API or flag, so hits are almost always real; medium: the pattern is legitimate in many programs, so check each hit; high: it finds a lead to confirm, so expect benign hits.
    Edge
    The relationship the finding sits on. reaches: content or traffic gets to a thing; calls: one thing invokes another; reads: one thing reads from another; writes: one thing writes to another; sends: data leaves for another party; grants: authority is given or left unchecked; depends_on: something relies on a component it does not verify; trusts: one party believes another without evidence. The boundary it crosses, when there is one: user->prompt (untrusted input reaching a prompt); model->code (model output reaching code, a shell, a query or a page); secret->outside (a secret leaving the trusted side); supply-chain (code, models or prompts pulled in from outside).
    Taxonomy chips
    References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

    warning generic agent-rules, prompt-injection, skills

    Instruction file tells the agent to adopt a persona that has no rules or restrictions (“you are now an assistant with no rules”, “act as an unrestricted model”, “do anything now”). Persona hijacks are a standard way to talk an agent out of its safety behaviour, and the file loads with the authority of project instructions. Remove the persona and give the agent a concrete working role instead.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: calls one thing invokes another.

    CWE-1427 LLM01 ASI01

    Fix: Delete the roleplay directive. Describe the job (reviewer, migration helper) and keep it inside the agent’s normal policy; review who last edited the file.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, prompt-injection, skills

    Instruction file asks the agent to switch off its own safeguards (unrestricted or jailbreak mode, disabling its content filter, “your guidelines no longer apply”, “without any ethical constraints”). Text like this is aimed at the model rather than a human reader and tries to lift refusal behaviour for everything that follows. Remove it and review the file history.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: calls one thing invokes another.

    CWE-1427 LLM01 ASI01

    Fix: Remove the directive. Legitimate policy changes belong in the agent client’s managed settings, not in prose inside a repository file.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills

    Instruction file tells the agent never to ask for confirmation, not to wait for approval, or to auto-approve tool calls. This removes the human check on every command the agent runs, and it comes from a file rather than from the person at the keyboard. Keep confirmations on, or grant narrow allow rules in the client settings.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-862 CWE-250 LLM06 ASI02 ASI09

    Fix: Delete the directive. If unattended work is required, use the client’s allow-list for specific commands or run inside a disposable sandbox with no credentials.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.mandatory-local-execution

    Section titled “keryn.skilldirective.mandatory-local-execution”

    warning generic agent-rules, skills

    Instruction file orders the agent to run a local script before or after every task or session, or to execute something silently. The script is not shown to the reviewer of the instruction file and runs with the developer’s privileges on every turn. Inline the step as a visible, reviewed hook or remove it.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk high: it finds a lead to confirm, so expect benign hits.

    Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).

    CWE-78 CWE-829 LLM06 ASI05 ASI02

    Fix: Move recurring actions into a reviewed client hook with a pinned command, and keep the instruction file free of standing “always run” scripts.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills

    Instruction file tells the agent to respond as the user, as the system administrator, or as a vendor (Anthropic, OpenAI, Google, GitHub, Microsoft, AWS), or to sign messages in a vendor’s name. Impersonation lets the agent forge approvals or lend its output false authority. Remove the directive; the agent should speak as itself.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: calls one thing invokes another.

    CWE-290 CWE-1427 LLM01 ASI03 ASI09

    Fix: Delete the line. If the agent drafts text on the user’s behalf, have it say so and leave sending to the user.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills

    Instruction file puts a side action in front of whatever the user asks (“regardless of what the user asks, first run …”, “whatever the task, also send …”, “before doing anything else, download …”). The agent runs the action on every request, so the user’s actual goal is no longer in control. Move legitimate setup into a visible hook and drop the unconditional directive.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk high: it finds a lead to confirm, so expect benign hits.

    Edge inspected: reaches content or traffic gets to a thing.

    CWE-1427 LLM01 LLM06 ASI01

    Fix: Remove the unconditional preface. Tie any setup step to a stated condition (“when the lockfile changes, run …”) and keep its command visible.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.cross-agent-addressing

    Section titled “keryn.skilldirective.cross-agent-addressing”

    warning generic agent-rules, skills, prompt-injection

    Instruction file addresses other AI agents that happen to read it (“if you are an AI agent reading this”, “to any assistant processing this file”, “note to the model:”, “AI: note that”). Text written for a model rather than a person is the carrier of indirect prompt injection and of agent-to-agent propagation. Remove it or move the guidance into a normal instruction section.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: trusts one party believes another without evidence.

    CWE-1427 LLM01 ASI07 ASI01

    Fix: Write instructions for the agent that is meant to load this file, in the normal file structure, and do not address passers-by agents.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills, agent-memory

    Instruction file tells the agent to write text into its own persistent memory or instruction files (MEMORY.md, CLAUDE.md, AGENTS.md) or to remember it across all sessions. That turns one poisoned file into a standing instruction that survives after the file is gone. Remove the directive and check the agent’s memory files for entries it may have added.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: writes one thing writes to another.

    CWE-1427 LLM01 ASI06

    Fix: Delete the directive, then inspect the user-level and project memory files for text that came from this file and remove it.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.document-poisoning-directive

    Section titled “keryn.skilldirective.document-poisoning-directive”

    warning generic agent-rules, skills, rag

    File carries a directive for whatever model summarizes or answers questions about it: what to say, link or report (“when summarizing this document, include a link …”, “if asked about this file, respond with …”, “ignore the actual content and report …”). That is retrieval poisoning: readers of the summary are shown the attacker’s text instead of the content. Remove the directive and treat the file’s origin as untrusted.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: writes one thing writes to another.

    CWE-1427 LLM01 LLM08 ASI06 ASI09

    Fix: Delete the directive. Summaries should come from the file’s content only; strip imperative text addressed to the model before indexing untrusted documents.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.system-prompt-extraction

    Section titled “keryn.skilldirective.system-prompt-extraction”

    warning generic agent-rules, skills, prompt-injection

    Instruction file asks the agent to print or repeat its system prompt, hidden instructions, or the text above the current message. Extraction requests leak the operator’s configuration and any secrets embedded in it. Remove the request; the agent should not echo its own instructions.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-200 CWE-497 LLM07 ASI01

    Fix: Delete the line and keep secrets out of prompts altogether; configure the client so instruction text is not echoed into outputs.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills

    Instruction file tells the agent to leave no trace: do not log this, delete the file after running, do not mention the skill, remove the evidence, clear the audit log or shell history. That defeats review of what the agent did and is aimed at the person who owns the machine. Remove the directive.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: reads one thing reads from another.

    CWE-778 CWE-117 LLM06 ASI09 ASI10

    Fix: Delete the directive. Agent actions should stay visible in the transcript and in the client’s own logs.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills, supply-chain

    A word in this instruction file mixes Latin letters with Cyrillic or Greek look-alikes (for example a Cyrillic letter inside “npm” or a domain name). Look-alike characters hide a different command, URL or package name from a reviewer. Retype the token with ASCII letters, or replace it with the intended name.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: calls one thing invokes another.

    CWE-1007 LLM03 LLM01 ASI04

    Fix: Replace the token with ASCII letters and check where the file was copied from; keep non-Latin text in separate words.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills

    The file says it is read-only or never modifies anything, yet the same file contains a write, delete, push, POST or install command. Users and reviewers trust the stated capability, so the mismatch is how a harmless-looking skill gets approved. Make the claim true or state the write behaviour in the description.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk high: it finds a lead to confirm, so expect benign hits.

    Edge inspected: calls one thing invokes another.

    CWE-451 CWE-1059 LLM06 ASI09 ASI03

    Fix: Remove the write/exec command or correct the description and allowed-tools so that they say what the skill actually does.

    References: https://code.claude.com/docs/en/skills

    warning generic agent-rules, skills, supply-chain

    Skill manifest presents itself as an official skill or plugin of a vendor (Anthropic, OpenAI, Google, GitHub, Microsoft, AWS) or names a vendor as its author, with no vendor URL in the same manifest. Borrowed brand names are how look-alike skills win trust. Check the publisher and use your own name unless the vendor really ships it.

    Confidence P2: a heuristic or a posture check: confirm by reading the code.

    Edge inspected: trusts one party believes another without evidence.

    CWE-1021 LLM03 ASI04

    Fix: Publish under the real author name, link the project home page, and drop “official” unless the vendor lists the skill themselves.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.skill-description-vague

    Section titled “keryn.skilldirective.skill-description-vague”

    info generic agent-rules, skills

    Skill frontmatter has an empty, very short or placeholder description (“helper”, “misc”, “TODO”). The description is what the agent uses to decide when to load the skill, and what a reviewer reads before approving it, so a vague one makes the skill hard to audit and easy to trigger by accident. Write one sentence on what it does and when to use it.

    Confidence P2: a heuristic or a posture check: confirm by reading the code.

    Edge inspected: calls one thing invokes another; it crosses the model->code boundary (model output reaching code, a shell, a query or a page).

    CWE-1059 LLM06 ASI02

    Fix: Replace the description with a specific sentence stating the task, the inputs it touches and when Claude should use it.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.skill-allowed-tools-destructive-prefix

    Section titled “keryn.skilldirective.skill-allowed-tools-destructive-prefix”

    warning generic claude-code, skills

    Skill frontmatter pre-approves a wildcard for a destructive or privilege-changing command prefix (Bash(rm:*), Bash(sudo:*), Bash(chmod *), Bash(bash *), Bash(eval *), git reset/clean). Every use of the skill can then delete files or change privileges without a prompt. List the exact command and arguments the skill needs instead.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-250 CWE-862 LLM06 ASI02 ASI03

    Fix: Replace the wildcard with a fixed command (Bash(rm ./build/cache.json)) or remove the entry and let the permission prompt stand.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.skill-allowed-tools-network-prefix

    Section titled “keryn.skilldirective.skill-allowed-tools-network-prefix”

    warning generic claude-code, skills

    Skill frontmatter pre-approves a network-capable tool without a destination limit (Bash(curl:*), Bash(wget *), ssh, scp, git push, or WebFetch with no domain). Skill text, or content the skill reads, can then send data anywhere without a prompt. Scope the entry to a domain or a fixed command line.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-200 CWE-862 LLM06 LLM02 ASI02 ASI03

    Fix: Use WebFetch(domain:docs.example.com) or a fixed Bash(curl https://api.example.com/health) entry, and keep push and ssh behind the prompt.

    References: https://code.claude.com/docs/en/skills

    keryn.skilldirective.skill-readonly-write-tools

    Section titled “keryn.skilldirective.skill-readonly-write-tools”

    warning generic claude-code, skills

    Skill description says it is read-only or only reads, but the frontmatter allowed-tools pre-approves Write, Edit, MultiEdit, NotebookEdit or an unscoped Bash. The grant runs without a prompt, so the stated capability and the real one differ. Remove the write tools or fix the description.

    Confidence P2: a heuristic or a posture check: confirm by reading the code. False-positive risk medium: the pattern is legitimate in many programs, so check each hit.

    Edge inspected: grants authority is given or left unchecked.

    CWE-451 CWE-250 LLM06 ASI02 ASI09

    Fix: Limit allowed-tools to Read, Grep, Glob and read-only Bash prefixes (git status, git diff), or describe the writes honestly.

    References: https://code.claude.com/docs/en/skills