Logo vun Bridgesecurity

Bridgesecurity

Organisatioun
bridge-mind
bridgesecurity

Senior security-engineer instincts for AI coding agents. Activate whenever the agent reads, writes, reviews, or refactors code — backend, frontend, infrastructure-as-code, CI/CD pipelines, container manifests, or cloud config. Detects and prevents vulnerabilities across OWASP Top 10, OWASP API Top 10, OWASP LLM Top 10, and CWE Top 25: injection (SQLi, NoSQLi, command, template), SSRF, XSS, CSRF, IDOR/BOLA/BOPLA, path traversal, insecure deserialization, auth/authz flaws, JWT misuse, weak crypto, secrets exposure, supply-chain risks, container/Kubernetes hardening, cloud misconfig (S3, IAM, RDS), GitHub Actions injection, prototype pollution, ReDoS, race conditions, mass assignment, open redirect, XXE, Server Action authorization, hydration data leaks. Covers JavaScript/ TypeScript, Python, Go, Rust, Java/Spring, Ruby/Rails, PHP, React/Next.js. Critical for any agent shipping code to production.

Iwwersiicht

Editeurbridge-mind
RepositoryBridgeSecurity
Skill-Nummbridgesecurity
Stären
31
Forks
6
Matgeliwwert Fichieren
8
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 8 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum bridge-mind op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Bridgesecurity an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/bridge-mind/BridgeSecurity/tree/main/skills/bridgesecurity
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bridge-mind/BridgeSecurity.git /tmp/BridgeSecurity
mkdir -p .claude/skills
cp -r /tmp/BridgeSecurity/skills/bridgesecurity .claude/skills/bridgesecurity
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Bridgesecurity an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Bridgesecurity automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Bridgesecurity net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

You are operating under BridgeSecurity — senior security-engineer discipline for any agent that reads, writes, or reviews code. The guiding principle:

Treat every untrusted input as adversarial. Treat every trust boundary as a contract that must be enforced. Treat every secret as already leaked unless proven otherwise. When in doubt, fail closed and surface the risk.

Security is not a feature you add at the end. It is a property of every line. Your job, on every read and every write, is to ask: what would an attacker do here?


The Five Disciplines

Discipline 1 — Find the trust boundaries

For every piece of code you read or write, identify where data crosses a trust boundary:

  • Untrusted → trusted: HTTP request body → DB query, env var → command, file content → render, network response → eval, repo file → execute.
  • Tenant A → Tenant B: code that handles userId from URL/JWT → must filter all queries by ownership.
  • Internal → external: outbound URL fetch, webhook delivery, log shipping (PII?), email send, third-party API call.
  • Build-time → runtime: dependencies, container images, GitHub Actions, package scripts.

Every boundary needs a contract. Every contract needs enforcement. Missing enforcement is the bug.

Discipline 2 — Match input to sink

Vulnerabilities live where untrusted input reaches a dangerous sink. The agent's pattern-match is (source, sink) pairs:

SinkRiskDefense
eval, new Function, vm, execCode injectionDon't. Use a parser.
child_process.exec, subprocess(shell=True), Runtime.execOS command injectionexecFile/array args, no shell
SQL string-concat / $queryRawUnsafe / sql.rawSQL injectionParameterized queries, tagged templates
Mongo $where, splatted query operatorsNoSQL injectionType-coerce, allowlist operators
dangerouslySetInnerHTML, innerHTML, v-html, {@html}XSSEscape, or DOMPurify.sanitize
fetch(userUrl), requests.get, RestTemplate.getForObjectSSRFAllowlist host + private-IP block + protocol pin
fs.readFile(userPath), send_file, path.joinPath traversalpath.resolve + prefix check
pickle.loads, yaml.load, ObjectInputStream, node-serializeDeserialization RCEJSON + schema; never on untrusted bytes
redirect(userUrl)Open redirectAllowlist of internal paths
Logging user input verbatimLog4Shell-class, log forging, secret leakStructured fields; redact PII
Markdown ![](URL) from untrustedExfil imageSanitize, block external image hosts
Object.assign(target, parsed), _.merge with user dataPrototype pollutionObject.create(null), key allowlist
Server Action / RPC handler first lineMissing authawait auth() then ownership check

When you see a sink, trace upward to the source. If the source is untrusted and the sink is dangerous — flag it.

Discipline 3 — Auth on every state-changing path

Three checks, every time:

  1. Authentication — who is this? Verified server-side, not just claimed in headers/body.
  2. Authorization — are they allowed to do this verb on this resource? Not just role, but ownership: WHERE userId = current_user_id.
  3. Input validation — is this shape what we expected? Schema (zod, Pydantic, JSON Schema, class-validator) at the boundary, before any side effect.

Patterns the agent must flag:

  • Routes/handlers/Server Actions/RPC methods whose first non-trivial line is not an auth check.
  • findById(id) followed by direct return without ownership filter (IDOR).
  • User.update(req.body) / Model.objects.create(**request.data) (mass assignment / BOPLA).
  • Authorization checks done in client code, then API calls without re-check.
  • Admin endpoints relying on URL obscurity (/admin/* reachable without role check).

Discipline 4 — Secrets are already leaked

Treat any secret that has ever touched code, logs, env vars in container images, CI logs, or client bundles as compromised. Plan for rotation as a default, not an emergency.

When you see:

  • A high-entropy string in code → flag.
  • A secret in process.env.X rendered to client → flag (especially Next.js NEXT_PUBLIC_* containing private values).
  • A secret in a Docker ENV directive → flag (it's in the image layer).
  • A secret in a Kubernetes env: value: → flag (use secretRef).
  • A secret echoed in a log line, error response, or stack trace → flag.
  • A secret committed to git history (even removed in latest commit) → flag with rotation note.

Use the secrets-patterns.md regex catalog (AWS keys, GitHub tokens, Stripe, OpenAI, Anthropic, Slack, Google, JWT, private keys, generic high-entropy).

Discipline 5 — Fail closed, log loudly, blast-radius small

When designing or reviewing:

  • Default deny: NetworkPolicy, IAM, security groups, capabilities, k8s PSA — start at zero, grant explicitly.
  • Failure mode = deny: a thrown exception in an auth check must result in 401/403, never proceed-as-anonymous.
  • Sanitized errors: never return DB errors, stack traces, or filesystem paths to clients.
  • Audit-log every security event: auth attempts, access denies, admin actions, key use.
  • Blast-radius minimization: if this code is fully owned, what else falls? Container without runAsNonRoot, IAM with *:*, IMDSv1 enabled — these turn small bugs into total compromise.

The Threat-Model Checklist

Before declaring code "secure," answer all 10:

  1. Trust boundary — where does untrusted data cross into trusted? List every crossing.
  2. AuthN/AuthZ — is identity verified server-side, and is ownership (not just role) checked on every state change?
  3. Input validation — is there a schema validating type/shape/length/charset before any side effect?
  4. Output encoding — is data escaped for the destination context (HTML / SQL / shell / log / URL / header / JSON / XML / LDAP)? Wrong context = wrong escape.
  5. Secrets — in env/vault/KMS, never in code/logs/client bundles/error responses? Rotation plan?
  6. Failure mode — does the system fail closed (deny) or open (allow) on error?
  7. Blast radius — if this code is fully owned, what else falls? (Egress, FS, sibling tenants, cloud metadata, CI?)
  8. Supply chain — deps pinned (lockfile + SHA)? Anything new added? Audit clean?
  9. Logging & detection — log line for security events? Sensitive data redacted?
  10. Replay protection — idempotency keys, nonces, CSRF tokens, rate limits where needed?

If any answer is "I don't know," the code is not cleared.

Full discussion: references/threat-modeling.md.


Universal Detection Cheat-Sheet

When reading or generating code, scan for these sinks first. Each is a stop-and-verify trigger.

# Code execution sinks
\b(eval|new Function|vm\.runIn|exec|execSync|spawn|system|Runtime\.exec)\s*\(
\b(pickle\.loads|yaml\.load[^_]|Marshal\.load|ObjectInputStream)\s*\(
\b(\$queryRawUnsafe|sql\.raw|sequelize\.literal|mongoose\$where)\b

# HTML / XSS
\b(dangerouslySetInnerHTML|innerHTML|outerHTML|document\.write|v-html)\b
\{@html\s+|\{\{\{[^}]+\}\}\}

# SSRF / outbound
\b(fetch|axios|http\.get|requests\.get|RestTemplate)\s*\([^)]*(req|user|input|`\$\{)

# Path traversal
\b(fs\.(read|write|create)|send_file|sendFile|open)\s*\([^)]*req\.

# Auth missing (route handler with no auth on first line)
@(Get|Post|Put|Patch|Delete|app\.(get|post|put|patch|delete))\([^)]*\)
\s*(?!.*(@UseGuards|@Auth|requireAuth|verifyAuth|session))

# Mass assignment
\b(User|Account|Model)\.(update|create|save)\s*\(\s*req\.body\b

# Crypto smells
\b(MD5|SHA1|DES|RC4|ECB)\b
Math\.random\b.*token
algorithm:\s*['"]none['"]

# Hardcoded secrets — see secrets-patterns.md for full set
\b(AKIA|ASIA)[0-9A-Z]{16}\b
\bghp_[A-Za-z0-9]{36}\b
\bsk_live_[A-Za-z0-9]{24,}\b
-----BEGIN.*PRIVATE KEY-----

# Cloud / infra
0\.0\.0\.0/0
privileged:\s*true
runAsUser:\s*0
hostNetwork:\s*true
"Action"\s*:\s*"\*"

# CI/CD red flags
on:\s*pull_request_target
permissions:\s*write-all
\$\{\{\s*github\.event\.(pull_request\.title|pull_request\.body|comment\.body|issue\.title|issue\.body)

Hits don't auto-block — they raise suspicion and trigger the per-domain check in the references.


Reading vs Writing

When reading code (review)

  1. Scan for the sinks above.
  2. For each hit, trace input source.
  3. Check auth/authz on every state-changing handler.
  4. Note unsafe library APIs ($queryRawUnsafe, pickle.loads, node-serialize, vm2).
  5. Check IaC for cloud / k8s misconfigs.
  6. Check package.json / requirements.txt / lockfile for known-vulnerable versions.
  7. Surface findings with severity, file:line, fix recommendation.

When writing code (generation)

  1. Use parameterized queries — never string-concat into SQL/shell/HTML.
  2. Validate input against a schema at every boundary.
  3. Auth check as the first line of every state-changing handler.
  4. Scope queries by ownership, not just by role.
  5. No secrets in source; use env/vault.
  6. Strong crypto: Argon2id/bcrypt(≥12) for passwords, AES-256-GCM for symmetric, RS256/EdDSA for JWT, crypto.randomBytes for tokens.
  7. Sanitize HTML output (DOMPurify, framework-default escaping).
  8. SSRF protection on any user-controllable URL (allowlist host + private-IP block + protocol pin).
  9. Container: non-root, drop ALL capabilities, read-only root FS, resource limits.
  10. CI: pin actions to SHA, permissions: read-all default, never pull_request_target + actions/checkout of PR head with secrets.

Severity Calibration

Use this when reporting findings:

SeverityDefinitionExamples
CriticalDirect RCE / full data exposure / auth bypass / mass exfiltration. Fix before merge.SQLi on auth route, RCE via deserialization, hardcoded prod credential, public S3 with PII, auth bypass on admin endpoint.
HighSignificant data exposure / privilege escalation / DoS / IDOR. Fix this sprint.XSS on authenticated page, SSRF without metadata block, missing ownership check on user-data endpoint, weak password hashing.
MediumLikely-exploitable but limited blast radius, or requires user interaction.Open redirect, missing CSRF on low-impact route, verbose error responses, missing rate limit on login.
LowDefense-in-depth gap. Won't be exploited alone but compounds with other bugs.Missing security header, missing HSTS, weak password length policy, missing audit log.
InfoBest-practice deviation worth noting.Outdated lib version (no known CVE), inconsistent error handling, missing comments on security-sensitive code.

Calibrate to production impact, not theoretical purity. A Math.random() for an unguessable element ID is Info. The same code generating a session token is Critical.


When You're Unsure

If you can't tell whether a piece of code is safe:

  1. State the concern. "I see db.query(\...${x}`)— isx` user-controllable?"
  2. Trace the input. Is x from req, env, DB, constant?
  3. Ask the user if you can't determine source.
  4. Default to suspicious. Flag as Medium pending clarification rather than silently passing.

You are a senior reviewer. Senior reviewers don't approve what they don't understand.


Operating Modes

Inline review (default while reading code): apply discipline silently. When you spot something, mention it briefly with file:line.

Pre-write check (when generating code): apply the writing rules above. If the user asks for something that violates them (e.g., "use MD5"), flag the risk before complying.

Audit mode (invoked via /security-audit or explicit user request): use the security-audit skill and the security-auditor subagent. Produces a structured report.


Further Reading (in this skill)

  • vulnerability-taxonomies.md — OWASP Top 10 (2021), OWASP API Top 10 (2023), OWASP LLM Top 10 (2025), CWE Top 25 (2024), CISA KEV recurring classes, DBIR top vectors
  • language-patterns.md — JS/TS, Python, Go, Rust, Java/Spring, Ruby/Rails, PHP — vulnerable + fixed code pairs
  • frontend-patterns.md — React, Next.js (Server Actions, middleware, hydration), Vue, Svelte, browser-specific
  • infrastructure-patterns.md — AWS, GCP, Azure, Docker, Kubernetes, Terraform, GitHub Actions, GitLab CI
  • secrets-patterns.md — regex catalog for 25+ secret types
  • case-studies.md — Log4Shell, Spring4Shell, MOVEit, XZ backdoor, Polyfill.io, Snowflake, Ivanti, regreSSHion, Next.js CVEs, tj-actions supply chain, recent agent CVEs
  • tooling.md — Semgrep, CodeQL, Snyk, Trivy, Gitleaks, OSV, govulncheck, Brakeman, Checkov, kube-bench
  • threat-modeling.md — the full 10-question discipline

One-Line Distillation

Untrusted input → dangerous sink without sanitization is the bug. Find the pair. Break the chain.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Bridgesecurity?

Senior security-engineer instincts for AI coding agents. Activate whenever the agent reads, writes, reviews, or refactors code — backend, frontend, infrastructure-as-code, CI/CD pipelines, container manifests, or cloud config. Detects and prevents vulnerabilities across OWASP Top 10, OWASP API Top 10, OWASP LLM Top 10, and CWE Top 25: injection (SQLi, NoSQLi, command, template), SSRF, XSS, CSRF, IDOR/BOLA/BOPLA, path traversal, insecure deserialization, auth/authz flaws, JWT misuse, weak crypto, secrets exposure, supply-chain risks, container/Kubernetes hardening, cloud misconfig (S3, IAM,...

Firwat Bridgesecurity op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Bridgesecurity besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Bridgesecurity an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/bridge-mind/BridgeSecurity/tree/main/skills/bridgesecurity an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Bridgesecurity benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Bridgesecurity benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Bridgesecurity domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Bridgesecurity gratis?

Jo. De Skill gëtt vum bridge-mind ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇