Hub rules-agent

rules-agent

v5 public Verified

Agent

AI agent efficiency and cost-reduction rules. These rules prevent context-bloat and redirect shell commands to native agent tools to reduce token costs by 30-50%.

@sigmashakeinc 5 pulls 27 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-agent →
Severity
10 error 14 warn 3 info
demo.cast
AI agent efficiency and cost-reduction rules. These rules prevent context-bloat and redirect shell commands to native agent tools to reduce token costs by 30-50%.

Rules index

27 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

agent

agent-enforce-dependency-hashes warning log

AI agents can hallucinate dependencies. Pinning dependencies with hashes in requirements.txt is recommended to prevent typosquatting/malicious package execution.

Rule source requires an active Pro or Enterprise subscription.
agent-enforce-google-style warning log

Google Python Style Guide prohibits wildcard imports (import *). Please use explicit imports.

Rule source requires an active Pro or Enterprise subscription.
agent-jinja2-autoescape-off error block

RISK: Jinja2 Environment with autoescape=False (or Template.from_string on LLM output) enables SSTI — the LangGrinch chain ends in Jinja2 RCE via trusted-namespace class instantiation. FIX: construct jinja2.Environment with autoescape=select_autoescape() and never render templates whose source string contains agent/user input.

Rule source requires an active Pro or Enterprise subscription.
agent-js-child-process-shell error block

RISK: child_process.exec or spawn with shell:true interpolates agent output into a shell string — command injection (CWE-78). FIX: use execFile/spawn with an explicit args array and shell:false; never concatenate agent-returned strings into shell commands.

Rule source requires an active Pro or Enterprise subscription.
agent-js-eval-exec error block

RISK: eval() or new Function() on agent-generated strings enables arbitrary JavaScript execution (CWE-95). An LLM completing code or processing tool output can inject malicious expressions. FIX: never pass agent output directly to eval/new Function — use structured JSON parsing, sandboxed VMs, or purpose-built expression evaluators with a restricted scope.

Rule source requires an active Pro or Enterprise subscription.
agent-langchain-secrets-from-env error block

RISK: LangChain CVE-2025-68664 (LangGrinch, CVSS 9.3) — dumps/loads with secrets_from_env=True allows prompt-injected LLM output to exfiltrate env-var secrets via unescaped 'lc' keys. FIX: upgrade langchain-core >= 0.3.81 (or >= 1.2.5) and pass secrets_from_env=False when deserializing untrusted payloads.

Rule source requires an active Pro or Enterprise subscription.
agent-mcp-hidden-instruction warning ask

RISK: MCP tool descriptions containing hidden directives ('<IMPORTANT>', system-style comments, 'ignore previous instructions') are the canonical tool-poisoning vector (Invariant Labs 2025 — WhatsApp/GitHub MCP exfiltration). FIX: keep tool descriptions to plain user-visible prose and pin MCP server versions with integrity hashes so definitions can't mutate post-install.

Rule source requires an active Pro or Enterprise subscription.
agent-prevent-eval-exec error block

Executing raw agent output via eval() or exec() leads to critical arbitrary code execution vulnerabilities.

Rule source requires an active Pro or Enterprise subscription.
agent-prevent-hardcoded-keys error block

Hardcoding API keys or secrets in agent scripts or outputs is a security risk. Use environment variables instead.

Rule source requires an active Pro or Enterprise subscription.
agent-prevent-os-system error block

Using os.system or subprocess with shell=True with AI agent output can lead to command injection.

Rule source requires an active Pro or Enterprise subscription.
agent-prevent-pickle-load error block

RISK: pickle/cloudpickle deserialization executes arbitrary code (CVE-2025-1716 bypasses picklescan; CVE-2026-0773 cloudpickle RCE; malicious models on Hugging Face routinely ship pickle payloads). FIX: load model weights via safetensors.load_file or torch.load(path, weights_only=True) on torch >= 2.6 (post CVE-2025-32434), never raw pickle on untrusted input.

Rule source requires an active Pro or Enterprise subscription.
agent-prevent-prompt-injection warning log

Potential prompt injection vulnerability. Ensure user input is not directly interpolated into system prompts without escaping or bounding.

Rule source requires an active Pro or Enterprise subscription.
agent-prevent-yaml-load error block

RISK: yaml.load / yaml.unsafe_load / Loader=yaml.Loader on agent-authored YAML allows arbitrary Python object construction and RCE via !!python/object tags. FIX: use yaml.safe_load() (or yaml.load(data, Loader=yaml.SafeLoader)) for all config, prompt, and tool-definition files.

Rule source requires an active Pro or Enterprise subscription.
agent-untrusted-path-traversal error block

RISK: agent-returned strings concatenated directly into file-system calls are a path traversal vector (CWE-22) — the LLM may return '../../../etc/passwd' or similar. FIX: resolve the path with path.resolve()/os.path.abspath(), then assert it starts with the expected base directory before any FS operation.

Rule source requires an active Pro or Enterprise subscription.
ask-claudemd-duplicate-table warning log

Writing a large reference table to a CLAUDE.md. These files are loaded into every conversation — duplicating tables across CLAUDE.md files wastes hundreds of tokens per conversation.

Rule source requires an active Pro or Enterprise subscription.
ask-hook-echo-on-allow warning log

Hook script echoes on every allow decision. At ~10 tokens per tool call, this costs 500-1,500 tokens per session with no agent value — agents do not need confirmation that a tool was allowed.

Rule source requires an active Pro or Enterprise subscription.
ask-package-install warning ask

Package installation modifies the environment. Confirm the package name is correct and the install is intentional — typosquatted package names are a common attack vector.

Rule source requires an active Pro or Enterprise subscription.
ask-write-temp-root warning log

Writing a temporary or debug file to the repo root. These files are frequently committed by accident and clutter the working tree.

Rule source requires an active Pro or Enterprise subscription.
log-agent-tool-invocation info log

Sub-agent spawned. Each agent invocation consumes significant tokens. Prefer direct tools (Read, Grep, Glob, Edit) for focused lookups — reserve agents for tasks requiring multiple sequential decisions.

Rule source requires an active Pro or Enterprise subscription.
log-background-agent-process info log

Background process started. Background jobs started by an agent are easy to lose track of — ensure cleanup is handled when the session ends.

Rule source requires an active Pro or Enterprise subscription.
log-skill-file-write info log

Skill file written. Large SKILL.md files are injected entirely on each invocation — keep skills under 300 lines. Split into sub-skills or use lazy-loaded phase files for complex workflows.

Rule source requires an active Pro or Enterprise subscription.
no-cat-use-read warning force

Use the Read tool instead of 'cat' for reading files.

Rule source requires an active Pro or Enterprise subscription.
no-echo-to-file-use-write warning force

Use the Write tool instead of 'echo >' for writing file contents.

Rule source requires an active Pro or Enterprise subscription.
no-find-use-glob warning force

Use the Glob tool instead of 'find' for locating files by pattern.

Rule source requires an active Pro or Enterprise subscription.
no-grep-use-grep-tool warning force

Use the Grep tool instead of 'grep' or 'rg' for searching file contents.

Rule source requires an active Pro or Enterprise subscription.
no-head-tail-use-read warning force

Use the Read tool with offset/limit instead of 'head' or 'tail'.

Rule source requires an active Pro or Enterprise subscription.
no-sed-inplace-use-edit warning force

Use the Edit tool instead of 'sed -i' for in-place file edits.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v5
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
13382ad7cbab3cd9c4e4b14e07962b79e427c7642c969882ece7fdb9488d299b
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-agent/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-agent. The published version only bumps when a maintainer resyncs.

No commit history available.