Works with the AI Agents you already use

    Security Audit for AI-Built Apps: Leaked Keys & AI Risks

    by Abhineet Sharma

    1

    This skill finds those, and then verifies them, so you get a short list of real problems instead of 80 regex hits.

    Free

    Security scanned

    What it does

    • Finds API keys and passwords hidden in your code or git history
    • Flags secrets that were accidentally sent to the user's web browser
    • Identifies when AI output can trick your app into running bad commands
    • Checks if user data is properly protected from other logged-in users
    • Verifies every security hole with a safe test to prove it is real
    • Proposes the exact code changes needed to fix confirmed bugs

    Who it's for

    Founders of AI startups and apps

    Catch leaked keys and prompt injection holes before they cost you money.

    Try asking: “Audit my new AI chatbot repo for security risks.”

    Developers using AI to write code (vibe-coding)

    Find the common security bugs that AI often introduces into your app.

    Try asking: “Check if this code is safe to make public on GitHub.”

    Small business owners with custom web tools

    Ensure your customer data isn't exposed through your API or database.

    Try asking: “Do a security review of my customer portal code.”

    Security Audit for AI-Built Apps: Leaked Keys & AI Risks

    Security Audit for AI-Built Apps: Leaked Keys & AI Risks

    Example session with this skill installed

    Audit this repo before we launch. FastAPI backend in app/, React (Vite) frontend in web/, uses OpenAI, deployed with Docker and GitHub Actions.

    • Read your context and instructions
    • Compiled the security audit
    • Generated the document

    Security audit: ./ scope: app/, web/, Dockerfile, .github/ method: sec_scan.py --history 500 + manual review

    Rotate now

    • OpenAI key in git history: app/old_config.py, commit 0d49f57 (deleted later, still in history). Revoke it in the OpenAI dashboard and issue a new one.
    • .env is committed (DATABASE_URL with password). Rotate the DB password, git rm --cached .env, add .env* to .gitignore.
    • web/src/Chat.tsx:1 VITE_OPENAI_API_KEY ships the key to every browser. Move the call to a FastAPI route.

    Confirmed

    1. [Critical] Model output executed: app/main.py:14 exec(response.content)
      Path: POST /agent -> messages -> client.chat -> response.content -> exec. Anyone who can reach /agent, or any text the model reads, gets RCE.
      Fix: parse a JSON action and dispatch from an allow-list (diff below). Test: test_agent_rejects_code_in_response.
    2. [Critical] GitHub Actions pwn request: ci.yml runs pull_request_target and checks out the PR head with write-all permissions.
    3. [High] SQL injection: app/main.py:16 f-string with query param q. Proof: test sends "' OR 1=1 --" and gets every row.
    4. [High] IDOR: GET /orders/{id} returns any order; no owner check (app/orders.py:22).

    Hardening: Dockerfile runs as root, python:latest unpinned, requests without timeout.
    Checked and dismissed (5): PY_SQL_STRING in scripts/report.py (column names only, values parameterised).

    Chat.tsx

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    AI-built apps fail security in predictable ways: an OpenAI key in a VITE_ variable, a .env committed in week one, model output piped into exec(), a text-to-SQL endpoint with a write-capable DB user, an /api/orders/:id that never checks whose order it is. This skill finds those, and then verifies them, so you get a short list of real problems instead of 80 regex hits.

    The scanner (sec_scan.py, stdlib only, read-only, no network)

    • Secrets: OpenAI, Anthropic, AWS, GitHub, Stripe live, Slack, Google, Hugging Face, SendGrid, private keys, DB URLs with passwords, plus high-entropy literals assigned to secret-looking names. Committed .env files. Secrets buried in git history (--history N), which are still exposed even after you delete them. Values are always masked in output.
    • Keys shipped to the browser: NEXT_PUBLIC_ / VITE_ / REACT_APP_ / EXPO_PUBLIC_ variables that look like LLM keys, service-role keys or secrets.
    • LLM-specific sinks: model output into eval/exec, a shell, SQL, or raw HTML (dangerouslySetInnerHTML); user input interpolated into the system prompt.
    • Classic bugs in Python and JS/TS: SQL via f-strings/templates, shell=True, child_process.exec with interpolation, pickle/torch.load/yaml.load, TLS verification off, JWT without signature checks, weak password hashing, random/Math.random for tokens, path traversal, SSRF, open redirects, debug mode, CORS * with credentials.
    • Config: Dockerfiles running as root or baking secrets into layers; GitHub Actions "pwn requests" (pull_request_target + PR checkout), script injection via ${{ github.event.issue.title }}, unpinned third-party actions, write-all tokens.
    • Tells you which dependency audit to run (pip-audit, npm/pnpm audit, govulncheck, cargo audit) for your lockfiles.
    • Calibrated against real code: test files are downgraded, env-var and header names aren't flagged as secrets, and SQL that only interpolates column names (with values parameterised) is marked low-confidence.

    The audit workflow

    1. Map the attack surface: routes, who the attacker is, where untrusted input enters (including retrieved documents and model output).
    2. Scan, then a manual checklist for what regex can't see: IDOR / missing ownership checks, Supabase RLS and Firebase rules, admin/debug routes, unauthenticated paid-LLM endpoints (cost abuse), RAG cross-tenant leaks, agent tools without human approval, unsigned webhooks, uploads.
    3. Verify every candidate: trace source to sink, check reachability, and add a minimal safe proof (a unit test, not an attack on production). Each finding ends up Confirmed, Likely, or Dismissed with a reason.
    4. Fix: rotate leaked secrets first, then patches with regression tests, in priority order.

    Free. Defensive use on your own code only.

    Pattern-based scanning finds candidates, not proof: the workflow verifies them, but it can miss bugs that need deep data-flow analysis. Code rules cover Python and JS/TS; other languages get secret and config checks only. Dependency vulnerability checks need you to run the suggested audit tools (they need network). Not a penetration test, not a compliance audit, and not for systems you don't own.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    • Free with an Agensi account

    Software
    Python 3.9+pip-audituv (Python tool runner)
    Optional
    Git (history and tracked-file checks)pip-audit / npm audit (dependency CVEs)

    Permissions

    Terminal / Shell
    Read Files

    File Scopes

    The
    repository
    being
    audited
    (read-only)

    The scanner is stdlib-only, read-only and makes no network calls. It runs read-only git commands (ls-files, log) if git is available. Secret values are masked in all output. The agent proposes patches and only applies those the user approves; it never tests against live or production systems.

    Listed7 days ago

    What's inside

    Frequently Asked Questions

    No. The scanner masks every value (first 4 characters plus length) and the skill tells the agent never to print full secrets.

    No. It's still in git history and may already have been scraped. The fix is to rotate or revoke the key at the provider. The --history option finds keys like this.

    The scanner is tuned against real code (test files downgraded, env-var names and header names ignored, parameterised SQL marked low-confidence), and the workflow verifies every candidate. You get Confirmed, Likely and Dismissed lists, with reasons.

    Yes, that's the focus: model output reaching eval/shell/SQL/HTML, prompt injection via system prompts and retrieved documents, agent tool permissions, RAG tenant isolation, and cost abuse of paid model endpoints.

    New in Security

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Free