Hub rules-secrets

rules-secrets

v2 public Verified

Secrets

These rules govern the management, protection, and handling of sensitive information such as API keys and credentials. They ensure AI agents maintain high security standards and prevent accidental exposure of secrets.

@sigmashakeinc 6 pulls 21 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-secrets →
Severity
18 error 3 warn 0 info
demo.cast
These rules govern the management, protection, and handling of sensitive information such as API keys and credentials. They ensure AI agents maintain high security standards and prevent accidental exposure of secrets.

Rules index

21 governance rules

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

fs

no-basic-auth-hardcoded warning log

Hardcoded HTTP Basic auth header detected. RISK: base64 is reversible — the cleartext user:password will be extracted in seconds. FIX: build the header at runtime from env-var credentials.

Rule source requires an active Pro or Enterprise subscription.
no-cat-secret-files error block

Do not dump secret files to stdout via shell commands. Use environment variables or a secrets manager at runtime.

Rule source requires an active Pro or Enterprise subscription.
no-db-url-with-password error block

Database connection string with embedded password detected. RISK: URL-embedded passwords appear in logs, proxies, and error traces. FIX: split credentials into DB_PASSWORD env var and reference via config; the MongoDB/Postgres drivers all accept separate user/password fields.

Rule source requires an active Pro or Enterprise subscription.
no-hardcode-secrets error log

Possible hardcoded secret detected. Store credentials in environment variables or a secrets manager, never in source code.

Rule source requires an active Pro or Enterprise subscription.
no-hardcoded-ai-provider-token error block

AI platform token detected (Hugging Face hf_, Replicate r8_, or Groq gsk_). RISK: Hugging Face tokens were the most-leaked AI credential type in 2025. FIX: revoke on the provider dashboard and load from HF_TOKEN/REPLICATE_API_TOKEN/GROQ_API_KEY env vars.

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

Anthropic API key detected (sk-ant-api/sk-ant-admin prefix). RISK: CVE-2025-59536 showed Claude Code keys exfiltrated via malicious project files. FIX: revoke at console.anthropic.com and read from ANTHROPIC_API_KEY env var.

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

AWS access key detected (AKIA/ASIA prefix). RISK: 2025 credential-harvesting campaigns showed AWS keys in public repos were abused within minutes. FIX: rotate the key at IAM immediately and load via AWS SDK default credential chain (env/role).

Rule source requires an active Pro or Enterprise subscription.
no-hardcoded-github-token error block

GitHub token detected (ghp_/gho_/ghu_/ghs_/ghr_ or github_pat_). RISK: Snyk's 2025 report found 96% of leaked GitHub tokens had write scope enabling supply-chain attacks. FIX: revoke at github.com/settings/tokens and use GITHUB_TOKEN env var or a GitHub App.

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

Google API key detected (AIza prefix). RISK: unrestricted Google keys allow billed Maps/Translate/GenAI calls against the owner's quota. FIX: restrict the key to specific APIs/referrers in GCP console or rotate and load from env var.

Rule source requires an active Pro or Enterprise subscription.
no-hardcoded-jwt-token warning log

JWT detected in source (three base64url segments). RISK: even expired JWTs can leak user IDs, scopes, and signing-algorithm hints useful for forgery. FIX: mint JWTs at runtime and pass via env/secret manager; use a placeholder in tests.

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

OpenAI API key detected (sk- or sk-proj- prefix). RISK: AI provider keys were the fastest-growing leak category in 2025 (+81% YoY). FIX: revoke at platform.openai.com/api-keys and read from OPENAI_API_KEY at runtime.

Rule source requires an active Pro or Enterprise subscription.
no-hardcoded-slack-token error block

Slack token or incoming webhook URL detected. RISK: leaked webhooks allow spoofed messages; bot tokens grant workspace read/write. FIX: revoke at api.slack.com/apps and read from SLACK_BOT_TOKEN env var.

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

Stripe live secret/restricted key detected (sk_live_/rk_live_). RISK: live keys authorize real charges and payouts. FIX: roll the key in Stripe Dashboard and load from STRIPE_SECRET_KEY env var; use sk_test_ keys for examples.

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

Hardcoded API key in MCP server / Claude settings config. RISK: CVE-2025-59536 and the 2025 GitGuardian MCP study found 24k+ secrets in public MCP configs. FIX: use \${ENV_VAR} placeholder in the config and set the env var in your shell profile.

Rule source requires an active Pro or Enterprise subscription.
no-npmrc-auth-token error block

npm/yarn registry auth token committed in .npmrc/.yarnrc.yml. RISK: committed npm tokens enable malicious publishes under your scope (2024/2025 supply-chain attacks). FIX: replace literal with \${NPM_TOKEN} and set the env var in CI only.

Rule source requires an active Pro or Enterprise subscription.
no-pem-private-key-in-source error block

PEM-encoded private key material detected in source. RISK: inline private keys cannot be rotated without a code deploy and will be indexed by GitHub secret scanning. FIX: remove, rotate the key, and load from a secrets manager or file path outside source control.

Rule source requires an active Pro or Enterprise subscription.
no-read-additional-key-files error block

PKCS#12/PuTTY/Java keystores and SSH key material contain private keys. RISK: reading them loads key bytes into agent context. FIX: reference the keystore by path in config and load it at runtime.

Rule source requires an active Pro or Enterprise subscription.
no-read-cloud-credential-files error block

Cloud CLI credential stores (AWS, GCP, Azure, kubeconfig, docker config) carry session tokens and service-account keys. FIX: never inline these into source or context; authenticate via the CLI/SDK at runtime.

Rule source requires an active Pro or Enterprise subscription.
no-read-env-files error block

Reading .env files is blocked. Secret values should be accessed via environment variables at runtime, not read directly from disk by agents.

Rule source requires an active Pro or Enterprise subscription.
no-read-key-files error block

Private key and credential files must not be read by agents. If a key needs to be used, reference it by path in a config — never read its contents.

Rule source requires an active Pro or Enterprise subscription.
no-write-dotenv-file warning log

Writing to a .env file. RISK: agent-written .env files are a common vector for committing real secrets (missing .gitignore entry). FIX: ensure .env is in .gitignore and prefer a .env.example template with placeholder values.

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

Source history

Recent commits

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

No commit history available.