Hub rules-llm

rules-llm

v3 public Verified

LLM

LLM and AI API governance rules for AI coding agents. Prevents API key exposure in source code, prompt injection via system prompts, runaway inference costs from uncapped max_tokens, PII leakage in LLM response logs, and unsafe temperature settings in production AI applications.

@sigmashakeinc 2 pulls 8 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-llm →
Severity
3 error 5 warn 0 info
demo.cast
LLM and AI API governance rules for AI coding agents. Prevents API key exposure in source code, prompt injection via system prompts, runaway inference costs from uncapped max_tokens, PII leakage in LLM response logs, and unsafe temperature settings in production AI applications.

Rules index

8 governance rules

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

llm

ask-max-tokens-missing warning log

AI API call detected. Ensure max_tokens/max_output_tokens is set to prevent runaway costs from unexpectedly long responses.

Rule source requires an active Pro or Enterprise subscription.
ask-temperature-above-one warning log

Temperature above 1.0 makes model outputs highly random and unpredictable. Values above 1.0 are rarely appropriate for production use cases.

Rule source requires an active Pro or Enterprise subscription.
no-hardcoded-api-key error block

AI API key hardcoded in source. Keys expose your account to abuse and billing fraud. Use environment variables: process.env.OPENAI_API_KEY or os.environ['ANTHROPIC_API_KEY']

Rule source requires an active Pro or Enterprise subscription.
no-llm-output-exec error block

Executing LLM output directly as a shell command or eval is an RCE vulnerability. An adversarial prompt or a jailbreak can inject arbitrary commands. Parse and validate LLM output as structured data (JSON schema) and map to a fixed allowlist of operations.

Rule source requires an active Pro or Enterprise subscription.
no-logging-llm-responses warning log

Logging full LLM responses may capture PII, confidential business data, or sensitive content. Log metadata (tokens, latency, model) but not the response body.

Rule source requires an active Pro or Enterprise subscription.
no-tool-call-dispatch-without-allowlist error log

Dispatching tool calls via getattr()/locals()/globals() using an LLM-provided name allows prompt injection to call arbitrary functions. Maintain an explicit dict mapping allowed tool names to their callables and reject any name not in that dict.

Rule source requires an active Pro or Enterprise subscription.
no-unpinned-model-version warning log

Unpinned model alias (e.g., 'gpt-4') may resolve to a different model after a provider update, silently changing behavior and costs. Pin to a dated model ID where possible.

Rule source requires an active Pro or Enterprise subscription.
no-user-input-in-system-prompt warning log

User-controlled content in system prompt enables prompt injection. The system prompt should be static — interpolate user data into user messages only.

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
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
6fd7c46e24facc7530e1a980a9d5e204eba409a7656979cab92d3a6587f26723
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

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

No commit history available.