# agent-rules-files-v1

> agent-rules-files-v1: 13 Keryn rules for generic (4 error, 9 warning).

Source: https://keryn.dev/rules/agent-rules-files-v1/

13 rules · Keryn Software Licence · rules 0.8.0 · [all packs](https://keryn.dev/rules/)

**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.

## seceng.agentrules.pipe-to-shell

`warning` generic agent-rules, prompt-injection

Agent instruction file tells the agent to download and pipe a script into a shell (curl | sh, wget -O- | bash, bash &lt;(curl ...), iwr | iex). The agent will run unreviewed remote code with the developer's privileges. Vendor the script or pin it by checksum.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [CWE-78](https://keryn.dev/taxonomies/cwe/#cwe-78-os-command-injection) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove the pipe-to-shell instruction. Commit the installer, or download it to a file, verify a pinned SHA-256, and only then run it. Installation steps for humans belong in README, not in files an agent obeys automatically.

**References:** [https://code.claude.com/docs/en/memory](https://code.claude.com/docs/en/memory) · [https://agents.md](https://agents.md)

## seceng.agentrules.pip-install-from-url

`warning` generic agent-rules, prompt-injection

Agent instruction file tells the agent to pip/npm install a package straight from a URL or VCS ref that is not pinned to a commit. Whatever is served at that moment is executed at install time. Install from a registry with a pinned version and hash, or pin the VCS ref to a full commit SHA.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Replace URL installs with pinned registry installs (pkg==1.2.3 --require-hashes) or a git ref pinned to a 40-character commit SHA.

**References:** [https://code.claude.com/docs/en/memory](https://code.claude.com/docs/en/memory) · [https://pip.pypa.io/en/stable/topics/secure-installs/](https://pip.pypa.io/en/stable/topics/secure-installs/)

## seceng.agentrules.instruction-override-phrase

`warning` generic agent-rules, prompt-injection

Agent instruction file contains a classic instruction-override phrase (ignore/disregard previous instructions, developer-mode jailbreak). Legitimate project rules never need to defeat the agent's own guardrails; this is the signature of an injected rules file.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-77](https://keryn.dev/taxonomies/cwe/#cwe-77-command-injection) [CWE-74](https://keryn.dev/rules/?cwe=CWE-74) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Delete the override text, review the file history for who added it, and treat the repository as untrusted until the rules files have been diffed against a known good copy.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://cursor.com/docs](https://cursor.com/docs)

## seceng.agentrules.conceal-from-user

`warning` generic agent-rules, prompt-injection

Agent instruction file tells the agent to hide actions from the user (do not tell the user, without informing the user). Concealment from the human reviewer is a hallmark of malicious instructions; remove it.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-451](https://keryn.dev/rules/?cwe=CWE-451) [CWE-77](https://keryn.dev/taxonomies/cwe/#cwe-77-command-injection) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI09](https://keryn.dev/taxonomies/owasp-agentic/#asi09-human-agent-trust-exploitation) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack)

**Fix:** Remove the concealment instruction. Legitimate rules should keep the human informed; require the agent to report every command it runs and every file it changes.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://code.claude.com/docs/en/memory](https://code.claude.com/docs/en/memory)

## seceng.agentrules.mandatory-fetch-or-exec

`warning` generic agent-rules, prompt-injection

Agent instruction file imposes a mandatory run/fetch step whose line also fetches from a URL or executes encoded content (you must always run ... curl, eval, base64). Mandatory network execution in a rules file is a persistence mechanism for prompt injection; make it an explicit, reviewed script 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](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [CWE-77](https://keryn.dev/taxonomies/cwe/#cwe-77-command-injection) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Replace the standing instruction with a documented, committed script that humans run, and remove any unconditional command the agent must execute on every task.

**References:** [https://cursor.com/docs](https://cursor.com/docs) · [https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions](https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions)

## seceng.agentrules.base64-decode-exec

`error` generic agent-rules, prompt-injection

Agent instruction file contains a long base64 blob followed by a decode-and-execute step (base64 -d | sh, eval, atob). Encoded payloads in rules files hide the command from reviewers. Remove it and decode the blob offline to see what it does.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [calls](https://keryn.dev/docs/edges/edge-kinds/#calls) one thing invokes another; it crosses the [`model->code`](https://keryn.dev/docs/edges/trust-boundaries/#model-to-code) boundary (model output reaching code, a shell, a query or a page).

[CWE-506](https://keryn.dev/taxonomies/cwe/#cwe-506-embedded-malicious-code) [CWE-94](https://keryn.dev/taxonomies/cwe/#cwe-94-code-injection) [CWE-78](https://keryn.dev/taxonomies/cwe/#cwe-78-os-command-injection) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Delete the encoded payload and the decode-and-run instruction, decode the blob in an isolated environment to learn what it executes, and rotate any credentials the machine may have exposed.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://code.claude.com/docs/en/memory](https://code.claude.com/docs/en/memory)

## seceng.agentrules.bidi-override-character

`error` generic agent-rules, prompt-injection

Agent instruction file contains Unicode bidirectional control characters (U+202A-U+202E, U+2066-U+2069). They reorder displayed text so what a reviewer reads differs from what the model ingests. Strip them.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-116](https://keryn.dev/taxonomies/cwe/#cwe-116-improper-encoding-or-escaping-of-output) [CWE-451](https://keryn.dev/rules/?cwe=CWE-451) [CWE-1007](https://keryn.dev/rules/?cwe=CWE-1007) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Remove all bidirectional control characters from rules and skill files and add a CI check (for example grep -P for the code points) so they cannot be reintroduced.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://www.unicode.org/reports/tr9/](https://www.unicode.org/reports/tr9/)

## seceng.agentrules.invisible-unicode-character

`error` generic agent-rules, prompt-injection

Agent instruction file contains invisible Unicode (zero-width space, word joiner, invisible operators, Unicode tag characters U+E0000-U+E007F, variation selectors supplement). Models read these code points while humans see nothing, so they are used to smuggle hidden instructions. Strip them.

Confidence **P1**: dangerous in context. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-116](https://keryn.dev/taxonomies/cwe/#cwe-116-improper-encoding-or-escaping-of-output) [CWE-451](https://keryn.dev/rules/?cwe=CWE-451) [CWE-1007](https://keryn.dev/rules/?cwe=CWE-1007) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Delete the invisible characters, diff the file against a known-good copy to find any text they encoded, and block them in CI. Emoji ZWJ (U+200D) and a leading BOM are intentionally not flagged.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://www.unicode.org/charts/PDF/UE0000.pdf](https://www.unicode.org/charts/PDF/UE0000.pdf)

## seceng.agentrules.disable-permission-checks

`warning` generic agent-rules, prompt-injection

Agent instruction file tells the agent or the developer to run with permission, approval or sandbox checks disabled (--dangerously-skip-permissions, --dangerously-bypass-approvals-and-sandbox, --yolo, bypassPermissions). That removes the human gate for every tool call. Keep prompts on or use a disposable sandbox.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-250](https://keryn.dev/taxonomies/cwe/#cwe-250-execution-with-unnecessary-privileges) [CWE-862](https://keryn.dev/taxonomies/cwe/#cwe-862-missing-authorization) [LLM06](https://keryn.dev/taxonomies/owasp-llm/#llm06-excessive-agency) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI05](https://keryn.dev/taxonomies/owasp-agentic/#asi05-unexpected-code-execution)

**Fix:** Remove the instruction to bypass approvals. If unattended runs are required, run the agent in a container or VM with no secrets and a narrowly scoped allow list.

**References:** [https://code.claude.com/docs/en/iam](https://code.claude.com/docs/en/iam) · [https://cursor.com/docs](https://cursor.com/docs) · [https://raw.githubusercontent.com/openai/codex/main/codex-rs/utils/cli/src/shared_options.rs](https://raw.githubusercontent.com/openai/codex/main/codex-rs/utils/cli/src/shared_options.rs)

## seceng.agentrules.secrets-to-url-command

`error` generic agent-rules, prompt-injection

Agent instruction file contains a command that sends environment variables, tokens or credential files to a remote host (curl ... $API\_TOKEN, cat \~/.ssh/id\_rsa | curl, env | nc). If an agent follows it, secrets leave the machine. Delete the instruction and rotate anything reachable.

Confidence **P0**: exploitable as written. False-positive risk **low**: an exact API or flag, so hits are almost always real.

Edge inspected: [sends](https://keryn.dev/docs/edges/edge-kinds/#sends) data leaves for another party; it crosses the [`secret->outside`](https://keryn.dev/docs/edges/trust-boundaries/#secret-to-outside) boundary (a secret leaving the trusted side).

[CWE-200](https://keryn.dev/taxonomies/cwe/#cwe-200-exposure-of-sensitive-information-to-an-unauthorized-actor) [CWE-201](https://keryn.dev/rules/?cwe=CWE-201) [CWE-522](https://keryn.dev/taxonomies/cwe/#cwe-522-insufficiently-protected-credentials) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Remove the command, treat all credentials on machines where agents followed it as exposed and rotate them, and add an egress allow list for agent runtimes.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://code.claude.com/docs/en/memory](https://code.claude.com/docs/en/memory)

## seceng.agentrules.secrets-to-url-prose

`warning` generic agent-rules, prompt-injection

Agent instruction file asks the agent in prose to send environment variables, API keys, tokens or credentials to a URL. This is the natural-language form of secret exfiltration. Remove it and review who changed the file.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [sends](https://keryn.dev/docs/edges/edge-kinds/#sends) data leaves for another party; it crosses the [`secret->outside`](https://keryn.dev/docs/edges/trust-boundaries/#secret-to-outside) boundary (a secret leaving the trusted side).

[CWE-200](https://keryn.dev/taxonomies/cwe/#cwe-200-exposure-of-sensitive-information-to-an-unauthorized-actor) [CWE-201](https://keryn.dev/rules/?cwe=CWE-201) [LLM02](https://keryn.dev/taxonomies/owasp-llm/#llm02-sensitive-information-disclosure) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse)

**Fix:** Delete the instruction; legitimate telemetry never needs the agent to forward secrets. Restrict agent network egress to an allow list.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://code.claude.com/docs/en/memory](https://code.claude.com/docs/en/memory)

## seceng.agentrules.fetch-remote-instructions

`warning` generic agent-rules, prompt-injection

Agent instruction file tells the agent to fetch its instructions or rules from a URL at run time. The remote content can change after review and becomes an injection channel. Vendor the text into the repository or pin it by commit.

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](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-829](https://keryn.dev/taxonomies/cwe/#cwe-829-inclusion-of-functionality-from-untrusted-control-sphere) [CWE-494](https://keryn.dev/taxonomies/cwe/#cwe-494-download-of-code-without-integrity-check) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM03](https://keryn.dev/taxonomies/owasp-llm/#llm03-supply-chain) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI04](https://keryn.dev/taxonomies/owasp-agentic/#asi04-agentic-supply-chain-vulnerabilities) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Copy the reviewed content into the repository (or reference an immutable commit-pinned URL) instead of loading mutable remote instructions on every run.

**References:** [https://cursor.com/docs](https://cursor.com/docs) · [https://code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)

## seceng.agentrules.hidden-html-comment-instructions

`warning` generic agent-rules, prompt-injection

Agent instruction file has an HTML comment containing directives to the agent (ignore previous, run this command, do not tell the user, send secrets). Markdown renderers hide the comment from human reviewers but the model reads it. Move legitimate guidance into visible text.

Confidence **P1**: dangerous in context. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-451](https://keryn.dev/rules/?cwe=CWE-451) [CWE-77](https://keryn.dev/taxonomies/cwe/#cwe-77-command-injection) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

**Fix:** Remove directive-bearing HTML comments from rules, skills and README files that agents read, and review git blame for the commit that introduced them.

**References:** [https://genai.owasp.org/llmrisk/llm01-prompt-injection/](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · [https://code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)
