Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/atlassian/forge-skills/hardcoded-secretsgit clone --depth 1 https://github.com/atlassian/forge-skillsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00015 | $0.01321 |
| Opus 5 | $0.00008 | $0.00660 |
| Sonnet 5 | $0.00003 | $0.00264 |
| Haiku 4.5 | $0.00002 | $0.00132 |
Grade A, and why
hardcoded-secrets scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const response = await fetch(url, { How it starts
The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context
- Hardcoded credentials in source code enable unauthorized access if code is exposed. Forge apps should use
storage.setSecret()or Forge environment variables for sensitive values. - Related CWE: CWE-798 (Use of Hard-coded Credentials), CWE-259 (Use of Hard-coded Password).
- Reference: Internal Forge VULN Guide to Hardcoded Basic Auth.
Scope & Signals
- Secrets to detect:
- Basic auth headers:
Basic [base64] - Bearer tokens:
Bearer [token] - API keys:
api_key,apiKey,api-keywith literal values - AWS credentials:
AKIA..., secret access keys - Private keys:
-----BEGIN PRIVATE KEY----- - OAuth secrets:
client_secretwith literal values - Database connection strings with passwords
- Basic auth headers:
- Locations: Source files, config files (excluding node_modules, test fixtures).
Detection Patterns
# Basic Auth detection (refined)
grep -rlE '"Basic [A-Za-z0-9+/]*={1,2}"' --exclude-dir={node_modules,webpack} .
grep -rlE "'Basic [A-Za-z0-9+/]*={1,2}'" --exclude-dir={node_modules,webpack} .
# Bearer tokens
grep -rE 'Bearer [A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+' .
# API keys (common patterns)
grep -rE '(api[_-]?key|apiKey)\s*[:=]\s*["\047][A-Za-z0-9]{20,}["\047]' .
# AWS access keys
grep -rE 'AKIA[0-9A-Z]{16}' .
Vulnerable Patterns
// VULNERABLE - Hardcoded Basic auth
const headers = {
'Authorization': 'Basic dXNlcm5hbWU6cGFzc3dvcmQ='
};
// VULNERABLE - Hardcoded API key
const API_KEY = 'sk-1234567890abcdef1234567890abcdef';
const response = await fetch(url, {
headers: { 'X-API-Key': API_KEY }
});
// VULNERABLE - Hardcoded in config
const config = {
database: {
password: 'super_secret_password'
}
};
// VULNERABLE - Hardcoded OAuth secret
const clientSecret = 'abc123-client-secret-xyz789';
// VULNERABLE - Hardcoded in environment-like object
const ENV = {
STRIPE_SECRET_KEY: 'sk_live_abcdefghijklmnop'
};
Secure Patterns
// SECURE - Use Forge storage for secrets
import { storage } from '@forge/api';
async function getApiKey() {
return await storage.getSecret('external-api-key');
}
// SECURE - Use Forge environment variables
// Set via: forge variables set API_KEY "value" --encrypt
const apiKey = process.env.API_KEY;
// SECURE - Use External Auth for OAuth
import { auth } from '@forge/api';
async function getExternalToken() {
const token = await auth.getExternalAuth('my-external-service');
return token.accessToken;
}
// SECURE - Retrieve at runtime, never hardcode
async function initializeClient() {
const credentials = await storage.getSecret('service-credentials');
return new ServiceClient(JSON.parse(credentials));
}
Detection Checklist
- Search for Base64-encoded Basic auth headers.
- Look for Bearer token patterns (JWT format).
- Find API key variable assignments with literal strings.
- Check for AWS access key patterns (AKIA...).
- Search for private key file contents.
- Review config objects for password/secret fields with values.
- Exclude test fixtures and mock data from findings.
False Positive Handling
// FALSE POSITIVE - Placeholder in example/documentation
const API_KEY = 'YOUR_API_KEY_HERE';
const token = 'example-token-replace-me';
// FALSE POSITIVE - Test fixture
const mockAuth = 'Basic dGVzdDp0ZXN0'; // test:test
// FALSE POSITIVE - Schema/type definition
interface Config {
apiKey: string; // Not a hardcoded value
}
// TRUE POSITIVE - Real credential
const auth = 'Basic cHJvZHVjdGlvbjpyZWFsX3NlY3JldA=='; // Decodes to real secret
Semgrep Rules
rules:
- id: hardcoded-basic-auth
patterns:
- pattern-regex: "Basic [A-Za-z0-9+/]{10,}={0,2}"
message: "Potential hardcoded Basic auth credential"
severity: ERROR
- id: hardcoded-api-key
patterns:
- pattern: $VAR = "..."
- metavariable-regex:
metavariable: $VAR
regex: (api[_-]?key|apiKey|API_KEY)
- pattern-not: $VAR = "YOUR_API_KEY"
- pattern-not: $VAR = ""
message: "Potential hardcoded API key"
severity: WARNING
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 175 lines · 15 tokens per session scan A 03b28bc5d17a
hardcoded-secrets is a cursor rule published in the GitHub repository atlassian/forge-skills (20 stars, last pushed 2d ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,321 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
project
4DA project rules and conventions.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.