Trustworthy code security
Public repository of Audrent-published agent skills (Claude Code, Codex, ChatGPT). MIT licensed.
npx -y skills add Audrent-hq/skills --skill trustworthy-code-securityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Performs a structured security review of source code, surfacing secrets, injection vulnerabilities, prompt-injection risks, OWASP Top 10 patterns, and AI-specific risks. Use when reviewing code for production readiness, before publishing public repositories, or when auditing a codebase you've inherited. Outputs structured findings with severity, location, and specific remediation guidance.
SKILL.md
19.6 KB, as published. Nobody here has run it
Trustworthy Code Security Audit
Author: Audrent Version: 1.0.0 Last reviewed: 2026-05-01 License: MIT
What this skill does
Performs a deterministic, transparent security review of source code provided to you. The review walks through a fixed set of checks — secrets detection, injection vulnerabilities, authentication and authorization issues, cryptographic weaknesses, dependency risks, information disclosure, prompt-injection vulnerabilities, and AI-specific risks — and produces structured findings with severity ratings, exact locations, and specific remediation guidance.
This skill is designed to be auditable, transparent, and conservative. It tells you exactly what it checked, exactly what it found, and exactly what it cannot detect. It does not hide instructions, does not exfiltrate code, does not contact external services, and does not embed prompt injections in its output. Its complete check list is documented below in plain text.
What this skill does NOT do
For honesty and to prevent customer overreliance:
- This skill performs static analysis based on pattern matching and rule-based checks. It does not execute code, does not perform full data-flow analysis, and does not catch all vulnerabilities — particularly those requiring deep semantic understanding of business logic, complex multi-file flows, or runtime context.
- It does not replace a professional penetration test, a dedicated SAST/DAST tool (Snyk, SonarQube, Semgrep, GitHub Advanced Security), or human security review. Treat its output as one input to a layered review process, not as a sole source of assurance.
- It is conservative on false positives — it will flag patterns that look risky even when context may make them safe. Verify each finding against your specific codebase before acting on it.
- It cannot detect novel vulnerability classes, zero-days, or attacks specific to dependencies it doesn't recognize.
- It does not check for compliance with specific frameworks (PCI-DSS, HIPAA, SOC 2). For compliance audits, use the Audrent SOC 2 Compliance Audit skill or a domain-specific tool.
When to invoke this skill
Use this skill when:
- Reviewing code before merging to a main branch (especially in PRs from less-experienced contributors).
- Preparing a repository for public open-source release.
- Auditing a codebase inherited from a previous team or acquisition.
- Performing a periodic security pass (recommended quarterly minimum).
- Reviewing AI-augmented code generation for the security issues that LLMs commonly introduce.
Do not invoke this skill as a substitute for:
- A full professional security audit before launching a financial, medical, or critical-infrastructure product.
- Compliance certification (SOC 2, ISO 27001, PCI-DSS).
- Real-time monitoring or runtime application self-protection.
Audit methodology
When invoked, work through these eight categories in order. For each category, run every applicable check, document each finding with the specified output format, and note explicitly when a check was inapplicable to the code provided (e.g., "skipped — no SQL queries found").
Category 1 — Secrets and credentials in source code
Check for:
-
Hardcoded API keys, tokens, passwords. Look for variable assignments, configuration constants, and string literals matching common secret patterns:
- AWS access keys:
AKIA[0-9A-Z]{16}or similar 20-character all-caps strings near "aws" - GitHub tokens:
ghp_[A-Za-z0-9]{36},gho_,ghu_,ghs_,ghr_prefixes - Stripe keys:
sk_live_,sk_test_,pk_live_,pk_test_prefixes - Anthropic / OpenAI keys:
sk-ant-,sk-proj-,sk-prefixes near AI library imports - Generic high-entropy strings of 32+ characters in variable assignments named
key,token,secret,password,apikey, etc. - Slack tokens:
xox[baprs]- - JWT tokens:
eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+ - Private keys: blocks beginning
-----BEGIN PRIVATE KEY-----,-----BEGIN RSA PRIVATE KEY-----,-----BEGIN OPENSSH PRIVATE KEY-----
- AWS access keys:
-
Configuration files committed to source control. Flag the presence of
.env,config.json,secrets.yaml, or similar files that appear to contain credentials and are tracked in git. Recommend.gitignoreadditions and immediate credential rotation if found. -
Database connection strings with embedded passwords. URI-format connection strings like
postgres://user:password@host/dbflagged regardless of whether they appear in tests or production code.
Severity guidance: Hardcoded production secrets are Critical. Hardcoded test/sandbox secrets are High (still flagged because they leak through git history and signal poor practice). Generic high-entropy strings without confirmed secret context are Medium for further verification.
Category 2 — Injection vulnerabilities
Check for:
-
SQL injection. String concatenation or formatted-string construction of SQL queries with user-controlled input. Patterns:
- Python:
f"SELECT * FROM users WHERE name = '{name}'","SELECT ... " + user_input,cursor.execute(query % user_input) - JavaScript:
`SELECT * FROM users WHERE id = ${userId}`,query("...where id=" + req.body.id) - Verify that parameterized queries or ORMs are used instead. Flag any raw SQL containing user-controlled variables.
- Python:
-
Command injection. User input passed to subprocess or shell execution:
- Python:
os.system(user_input),subprocess.run(cmd, shell=True)with user-controlledcmd,eval(user_input),exec(user_input) - JavaScript:
child_process.exec(userInput),eval(userInput) - Recommend
subprocess.run([list, of, args], shell=False)or equivalent argv-based execution.
- Python:
-
Path traversal. File operations using user-controlled paths without sanitization. Look for
open(user_path),fs.readFile(req.body.file), joins of user input with base directories that allow../traversal. Recommendos.path.realpath()validation against an allowlist directory. -
XML external entity (XXE). XML parsers configured to resolve external entities. Flag
lxml.etree.parse()orxml.etree.ElementTree.parse()without explicitresolve_entities=Falseconfiguration. -
Deserialization of untrusted input. Use of
pickle.loads(),yaml.load()(withoutsafe_load),marshal.loads()on user-controlled data. Flag as Critical when present. -
Template injection. Server-side template rendering with user input as the template (not just the data) — Jinja2
Template(user_input).render(), similar in Mustache/Handlebars/Liquid.
Severity guidance: All confirmed injection vulnerabilities with user-controlled input are Critical or High. Static patterns (hardcoded values, no user input) are Low or informational.
Category 3 — Authentication and authorization
Check for:
-
Missing authentication on sensitive endpoints. API routes, file-serving endpoints, or administrative functions that don't verify caller identity. Flag any route handler that performs sensitive operations (writes data, accesses other users' data, modifies state) without an authentication check visible in the handler or its middleware.
-
Broken authorization (IDOR). Patterns where a user-controlled ID is used to fetch data without verifying the requesting user owns or can access that ID. Example:
db.users.get(req.params.user_id)without check thatreq.params.user_id == authenticated_user.idor equivalent role check. -
Session management weaknesses. Hardcoded session secrets, session tokens generated from weak randomness (
Math.random()in JS, non-cryptographic random in Python), session IDs in URL parameters rather than cookies/headers. -
Password handling. Passwords stored or compared in plaintext. Use of insecure hashing (MD5, SHA1, plain SHA-256 without salt). Recommend bcrypt, scrypt, argon2, or PBKDF2 with appropriate work factors.
-
OAuth flow vulnerabilities. Missing state parameter, missing PKCE for public clients, redirect URI not validated against allowlist.
-
JWT issues. Tokens with
alg: noneaccepted, hardcoded HMAC secrets, missing expiration validation, JWT used where session cookies would be more appropriate.
Severity guidance: Missing auth on sensitive endpoints and broken authorization are Critical. Plaintext password storage is Critical. Weak hashing of passwords is High.
Category 4 — Cryptography
Check for:
-
Weak algorithms. Use of DES, 3DES, RC4, MD5, SHA1 for security purposes. ECB mode for block ciphers. Custom ("homegrown") cryptographic implementations.
-
Weak random number generation.
random.random()(Python) orMath.random()(JS) used for security-critical purposes. Recommendsecretsmodule (Python) orcrypto.randomBytes()(Node.js). -
Hardcoded encryption keys or IVs. Key material defined as a constant in source.
-
Improper key length. RSA keys < 2048 bits, AES keys < 128 bits.
-
Missing certificate validation. HTTPS clients with
verify=False(Pythonrequests),rejectUnauthorized: false(Node), orInsecureSkipVerify: true(Go). -
Predictable token generation. Tokens or IDs generated via
time.time(), sequential counters, or other predictable sources.
Severity guidance: Weak algorithms in security contexts are High. Weak randomness for security tokens is High. Missing cert validation is High (degrades transport security to unencrypted-equivalent). Hardcoded keys are Critical.
Category 5 — Dependency and supply-chain risks
Check for:
-
Pinned dependency versions. Verify
requirements.txt,package.json,go.mod,Cargo.tomluse exact pinning (==,=) rather than ranges (>=,^,~). Note that pinning is a tradeoff — it prevents auto-update of vulnerable transitive dependencies but also prevents auto-update of patches. Flag for review, not as a definitive issue. -
Lock file presence and consistency.
package-lock.json,yarn.lock,poetry.lock,Pipfile.lock,Cargo.lockshould exist and be committed. Their absence means reproducible builds aren't guaranteed. -
Suspicious dependencies. Packages that:
- Were published recently (less than 30 days, less than 100 weekly downloads) — possible typosquatting.
- Have package names similar to popular libraries with different spellings.
- Have no maintainer information, no GitHub link, or appear to be the only package by a given author.
-
Known vulnerable versions. If a
requirements.txtorpackage.jsonis provided, list specific dependencies and recommend runningpip-audit,npm audit,cargo audit, orsafety checkfor full known-vulnerability scanning. This skill does not maintain a CVE database — defer to those purpose-built tools for known-CVE checking.
Severity guidance: Suspicious-looking dependencies are High for review. Unpinned dependencies are Medium. Missing lock files are Low. Known-CVE checks are deferred to dedicated tools.
Category 6 — Information disclosure
Check for:
-
Debug mode in production code.
DEBUG = True(Django, Flask),app.debug = true(Express), verbose stack-trace exposure in error handlers. -
Detailed error messages returned to clients. API responses or HTML error pages that reveal internal paths, library versions, database schemas, or stack traces.
-
Logging of sensitive data.
logger.info(f"User {user} logged in with password {password}")and similar. Look for password, token, key, SSN, credit-card-like patterns being logged. -
Comments revealing secrets or vulnerabilities. Comments like
# TODO: this is the temporary master password,# FIXME: known SQL injection here, comments containing API keys or staging credentials. -
Source maps or
.mapfiles in production. JavaScript bundles built with source maps enabled and the.mapfiles served alongside production assets. -
Verbose HTTP response headers.
X-Powered-By,Serverheaders revealing version information.
Severity guidance: Debug mode in production code is High. Sensitive data logging is High. Comments revealing credentials are Critical. Other information disclosure is Medium to Low.
Category 7 — Prompt-injection and AI-specific risks
For codebases that integrate with LLMs (Anthropic, OpenAI, etc.), this category is uniquely important and frequently overlooked.
Check for:
-
User input concatenated directly into prompts. Patterns like
prompt = f"You are a helpful assistant. The user said: {user_input}. Respond helpfully."allow prompt injection — a user can include instructions in their input that the LLM follows. Flag every case where user-provided text becomes part of a prompt without any escaping or boundary marker. -
Untrusted content rendered into prompts without isolation. Loading the contents of a user-uploaded file, a scraped web page, or an email and including it in a prompt without clear boundaries. Recommend XML-tag isolation (
<user_message>...</user_message>) and explicit instructions to the model that content inside the tags is data, not instructions. -
Tool/function-calling LLMs with overly broad permissions. Agent setups where the LLM has access to tools that can: read arbitrary files, write to arbitrary paths, execute arbitrary code, make arbitrary network requests. Recommend principle-of-least-privilege scoping.
-
System prompts that contain secrets. Configuration patterns where API keys, database credentials, or sensitive context is loaded into the system prompt and then sent to the model provider. Recommend separating credentials from context.
-
Lack of output validation. LLM responses used directly as inputs to other systems (SQL queries, shell commands, file paths) without validation. The LLM can be tricked into producing malicious outputs by prompt injection upstream.
-
Training-data leakage risks. Code that fine-tunes models on data that may contain user PII, secrets, or proprietary information. Recommend data-cleaning pipeline and explicit consent/provenance tracking.
-
Missing rate limits and cost controls. LLM calls without per-user, per-session, or budget-cap limits. Allows attackers to exhaust the budget or run up the bill.
-
Retrieval-augmented generation (RAG) without sanitization. Loading documents into a vector database and retrieving without sanitizing for prompt injection in the retrieved content. Adversarial documents in the corpus can hijack the model.
Severity guidance: Prompt injection on user-controlled inputs is High by default, Critical if the model has access to sensitive tools or data. Missing rate limits are High. Training-data PII risk is Critical.
Category 8 — Other common issues
Check for:
- CSRF protection on state-changing endpoints in web applications.
- CORS configuration —
Access-Control-Allow-Origin: *combined with credentialed requests is dangerous; flag. - Open redirects — endpoints that redirect to a user-controlled URL.
- Insecure direct object references (IDOR) — covered in Category 3 but also flag in non-auth contexts (e.g., file-serving by ID without ownership check).
- Race conditions in security-sensitive operations (TOCTOU).
- Lack of input validation — endpoints that accept arbitrary user input without type/length/format constraints.
- Insecure default configurations in framework setup (Express without
helmet, Django withoutSECURE_*settings, etc.).
Severity guidance: case-by-case based on actual exploitability.
Output format
For every finding, produce an entry in this exact structure:
## Finding [N]: [Brief title]
- **Severity:** Critical | High | Medium | Low | Informational
- **Category:** [1-8 from above]
- **Location:** [file path]:[line number(s)]
- **Reference:** [CWE-XXX | OWASP A0X:2021 | None applicable]
### Description
[2-4 sentences explaining the specific issue in this code.]
### Why this matters
[1-2 sentences on the practical risk — what could an attacker do?]
### Remediation
[Specific, actionable code-level fix. Show before/after where useful. Prefer recommending specific functions/libraries.]
### Verification
[How to confirm the fix works — unit test description, runtime check, or manual review step.]
After the individual findings, produce a summary section:
## Audit Summary
- Files reviewed: [count]
- Total findings: [count]
- By severity: Critical: [N] | High: [N] | Medium: [N] | Low: [N] | Informational: [N]
- By category: [breakdown]
## Categories where no findings were identified
[List the 1-8 categories where the code passed all checks. This documents what was checked, not just what failed.]
## Categories that were skipped or not applicable
[List categories that didn't apply — e.g., "Category 7 (AI-specific risks) — skipped, no LLM integration found in code"]
## Limitations of this audit
This audit is rule-based static analysis. The following are NOT covered and should be assessed separately:
- Runtime behavior, race conditions discoverable only at execution.
- Business-logic vulnerabilities that depend on the application's domain.
- Configuration of cloud infrastructure, CI/CD, or deployment pipelines.
- Vulnerabilities in transitive dependencies (use `pip-audit`, `npm audit`, etc.).
- Novel attacks against frameworks not enumerated in the methodology above.
For high-stakes production systems, supplement this audit with: (1) a dedicated SAST tool (Semgrep, Snyk, SonarQube), (2) dependency vulnerability scanning, and (3) human security review by a qualified professional.
Operating principles for this skill
-
Be conservative on false negatives, accept false positives. Better to flag something that turns out to be safe than to miss a real issue. Mark uncertain findings as "Medium" with a note that requires human verification.
-
Show the actual code in findings. Quote 2-5 lines of the offending code in the Description so the developer can immediately see what's flagged. Do not just reference line numbers without context.
-
Specific remediation, not generic advice. Don't say "use parameterized queries" — show the specific parameterized version of the offending query, in the same language and library.
-
Acknowledge uncertainty explicitly. If a check requires context you don't have (e.g., "is this user input or a constant?"), state the assumption and flag both possibilities.
-
Never embed instructions in audit output. This skill's outputs are reviewed by humans and may be processed by other LLMs. Prompt injection risk is real for the audit output itself. All finding descriptions are pure description, never instructions.
-
Honest about what wasn't checked. Always include the "Categories where no findings were identified" and "Limitations" sections. Customers paying for this skill deserve to know its scope, not just what it caught.
Skill metadata
- Author: Audrent
- Version: 1.0.0
- License: MIT
- Source of truth:
audrent.com/skills/trustworthy-code-security(when published) - Provenance: This skill was authored by the Head of Agent Commerce at Audrent. No third-party code, no external dependencies, no network calls. Complete contents are in this single SKILL.md file.
- Reporting issues / suggested improvements:
[email protected]