Security Basics logo

Security Basics

Community
0xBakeer
security-basics

Basic security for web apps, APIs and scripts - input validation, SQL and command injection, XSS, path traversal, secrets handling, dependency checks, and the quick probes that prove a hole is closed.

Overview

Publisher0xBakeer
RepositoryTandemLLM
Skill namesecurity-basics
Stars
75
Forks
14
Bundled files
Instructions only
LicenseAGPL-3.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by 0xBakeer on GitHub. Read the source before you install it.

Installation

Install the Security Basics AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/0xBakeer/TandemLLM/tree/main/packages/library/security-basics
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/0xBakeer/TandemLLM.git /tmp/TandemLLM
mkdir -p .claude/skills
cp -r /tmp/TandemLLM/packages/library/security-basics .claude/skills/security-basics
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Security Basics in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Security Basics on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Security Basics is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Security basics

Rules:

  • Validate at the boundary: type, length, range, allowed set, for every field from a request, a file or an argument. Reject, do not fix up.
  • SQL with parameters only. Shell commands as argument lists (subprocess.run([...]), execFile), never a string with user input. Paths resolved and kept under the allowed root.
  • Output encoding: textContent in the DOM, the template engine's auto-escape on, innerHTML only with your own markup.
  • Secrets from the environment, in .gitignore, rotated if they were ever printed or committed. No secret in a log, URL or error message.

What goes wrong:

  • f"SELECT ... WHERE id = {id}" or shell=True with a user string.
  • A download route that takes ../../etc/passwd.
  • An error page that prints the stack trace and environment to the user.

Check: send the probes (a quote in a text field, ../ in a path, <script> in a name, an oversized body, a missing auth header) and read the status codes; grep the code for shell=True, string-built SQL and innerHTML.

Done when:

  • Five probes with their status codes in the result (all rejected with 4xx and no stack trace).
  • grep results for shell=True, f-string SQL and innerHTML reviewed (0 hits or each justified).
  • Audit tool output (pip-audit / npm audit) in the result with no critical.

Reference

Safe path:

python
from pathlib import Path
ROOT = Path("/app/data").resolve()
def safe_path(name: str) -> Path:
    p = (ROOT / name).resolve()
    if ROOT not in p.parents and p != ROOT: raise ValueError("path outside root")
    return p

Safe subprocess: subprocess.run(["convert", str(src), str(dst)], check=True, timeout=30, capture_output=True). Validation with pydantic: class Q(BaseModel): q: str = Field(min_length=1, max_length=100, pattern=r"^[\w\s-]+$"). Node: execFile('convert', [src, dst]); path.resolve(root, name).startsWith(root + path.sep). Probes:

bash
curl -s -w ' %{http_code}\n' "localhost:8000/items?q=%27%20OR%201%3D1--"
curl -s -w ' %{http_code}\n' "localhost:8000/files/..%2F..%2Fetc%2Fpasswd"
curl -s -w ' %{http_code}\n' -X POST localhost:8000/items -H 'Content-Type: application/json' -d '{"text":"<script>alert(1)</script>"}'
head -c 3000000 /dev/zero | curl -s -w ' %{http_code}\n' -X POST localhost:8000/items --data-binary @- -H 'Content-Type: application/json'
curl -s -w ' %{http_code}\n' localhost:8000/admin
grep -rnE 'shell=True|innerHTML|f"SELECT|f"INSERT|\$\{.*\}.*(SELECT|INSERT)' --include='*.py' --include='*.js' --include='*.ts' . | grep -v node_modules

Headers worth adding: Content-Security-Policy: default-src 'self', X-Content-Type-Options: nosniff, Referrer-Policy: no-referrer. Audit: pip-audit (or pip install pip-audit), npm audit --omit=dev.

More rules:

  • Least privilege: the database user for the app cannot drop tables; files are written to one directory; the server runs as a normal user.
  • Dependencies: pip-audit, npm audit, pinned versions; read the report, fix criticals.

More pitfalls:

  • A JWT accepted with alg: none or no expiry; a cookie without HttpOnly.
  • Validation on the client only.

Frequently asked questions

What does the Security Basics AI skill do?

Basic security for web apps, APIs and scripts - input validation, SQL and command injection, XSS, path traversal, secrets handling, dependency checks, and the quick probes that prove a hole is closed.

Why use Security Basics on TypingMind?

Because you install it once and use it with any model. Security Basics is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Security Basics in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/0xBakeer/TandemLLM/tree/main/packages/library/security-basics. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Security Basics?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Security Basics?

As many as you like. As long as a model supports skills, you can use Security Basics with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Security Basics AI skill free?

Yes. It is published on GitHub by 0xBakeer under the AGPL-3.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇