Logotipo de Threat Model Surface

Threat Model Surface

Organización
alpha-omega-security
threat-model-surface

Realiza el análisis en profundidad de la fase 3.3 de una superficie de ataque incluida en el alcance de un modelo de amenazas. ÚSALO CUANDO el resumen de orientación esté listo y haya que leer el código para elaborar la tabla de confianza por entrada de §1.7 y la matriz de dimensiones del contrato, el inventario de efectos secundarios inesperados de §1.5, las condiciones previas de alcanzabilidad de §1.4 y la contaminación de resultados de §1.8. Lee los puntos de entrada públicos para analizar los contratos, no los defectos; limita el tiempo dedicado a cada familia de componentes e indica qué partes de la superficie no cubiertas se han inferido. Genera un análisis de la superficie. Solo lectura. NO LO USES PARA: buscar errores, revisar código, orientar o redactar el modelo de amenazas.

Add to TypingMind

Descripción general

Editoralpha-omega-security
Repositoriothreat-model
Nombre de la habilidadthreat-model-surface
Estrellas
60
Forks
10
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por alpha-omega-security en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Threat Model Surface en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/alpha-omega-security/threat-model/tree/main/skills/threat-model-surface
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/alpha-omega-security/threat-model.git /tmp/threat-model
mkdir -p .claude/skills
cp -r /tmp/threat-model/skills/threat-model-surface .claude/skills/threat-model-surface
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Threat Model Surface en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Threat Model Surface automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Threat Model Surface no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Threat Model — Surface (deep pass on the in-scope surface)

Phase 3.3. The orient pass was minutes; this is hours, and that is expected. Three of the output's most valuable artifacts cannot be produced any other way:

  • the per-input-operand trust table (§1.7), which requires reading each in-scope entry point far enough to say which direct parameters and indirect inputs an attacker can reach and what the caller must enforce; and
  • the contract-dimension matrix (§1.7-§1.12), which prevents silence about failure behavior, representational limits, executable collaborators, object topology, and lifecycle edge cases from becoming downstream MODEL-GAP findings; and
  • the no-surprise side-effects inventory (§1.5) — negative claims about what the project does to its host that cannot be established by reading docs.

Read principles.md and the §1.5 / §1.7 / §1.8 specs in output-structure.md first.

Rules for keeping the cost bounded

  • Scope by the recon carve. Read only the entry points of in-model families. Do not read contrib/, examples, or out-of-scope families beyond confirming they are separable.
  • Read for contract, not for bugs. At each entry point the question is "which of these parameters can an attacker control, what kind of control is it, and what contract applies at edge conditions?" — not "is this code correct?" Record whether behavior is guaranteed, disclaimed, or unresolved; do not test whether the implementation satisfies it. The moment the reading turns into review, stop and move on.
  • Timebox per family. If a family's surface is too large to table in budget (e.g., a service with 100+ routes), table the highest-exposure subset, mark the remainder (inferred, QN) with a coverage note, and raise completing the table as an open question / follow-up — do not silently generalize.
  • Record hypotheses as you go, in draft form with provenance tags. Preserve documented provenance for explicit normative public contracts. Code, implementation comments, and tests that merely suggest an unwritten contract remain (inferred, QN) until a maintainer ratifies them.
  • Read code as a behavioural oracle, not just as a second-class doc. Mining comments and headers tells you what the project says; it cannot tell you where a guarantee stops. Every security-critical property needs its off-switches found by reading statements: the API call that relaxes a check, the flag that removes one, the mode that trades it for speed. Cite each as <file>:<line> at the statement that implements it. A comment describing the function does not qualify — the check that matters may have no comment at all, which is exactly why comment-harvesting misses it. These are easy to walk past because they are not input operands: no attacker-controlled parameter appears, so an input-shaped reading of the API sees nothing. They are property switches. Grep for names built on validate, undermine, relax, skip, permit, trust, unsafe, strict, and sane, then read what each one assigns.
  • Search the whole shipped build, not the files you happen to have open. Scope every switch hunt to the source set the supported build compiles — including the build scripts, which is where platform-conditional and default-on options live. A search restricted to the public header and one implementation file will miss a compile-time switch that replaces an entire function, and it will miss it silently.
  • Report a negative as a command plus its result, so the next reader can re-run it in one paste: grep -rn 'PATTERN' <file set> — N hits, all in X. "I searched and found nothing" is not reviewable and has been wrong every time it has been checked.
  • Cite harder before tagging inferred. Before marking a row inferred, check the API docs, header comments, Javadoc/package-info, manpage, and README — a fact stated there is (documented, source), not inferred. Turning a false-inferred into a true-documented row is pure accuracy and directly reduces the escalation count.
  • Disclaim demonstrably-absent guarantees rather than leaving them open. When the reading shows a family makes no thread-safety, resource-bound, or failure-atomicity guarantee, that absence is verifiable — record the matrix row as disclaimed with (documented, source), routing to §1.12, not as unresolved. Reserve unresolved / inferred for dimensions where a guarantee plausibly exists but you could not confirm it. Where you must reason past the verifiable to a clear safe default, tag (assumption, QN) rather than (inferred, QN).

Build the per-input-operand trust table (§1.7)

One row per direct parameter and each security-relevant indirect input of every public entry point:

FunctionInput operandAttacker-controllable?Control kindCaller must enforceProvenance
gzopenpathno — trusted caller stringdata, resource-namepath sanitization(documented, gzopen contract)
gzreadfile contentsyesdata, sizeoutput buffer >= len(inferred, Q4)
gzprintfformatno — trusted literalx-format-stringnever source from input(inferred, Q5)

For a network service, the first column is the route/endpoint or protocol message (POST /v1/configuration, Handshake frame), and rows must cover headers and connection metadata as well as bodies — header-presence checks (X-Forwarded-*, auth tokens) are common false friends. Group rows by component family if the table grows large. Prose is not sufficient: tool/AI findings are reported against specific sinks, and the triager must look up the exact parameter.

Do not collapse all control into a boolean. Use one or more control kinds: data, size/rate, type/class, callback/code, object-graph topology, collaborator implementation, resource-name, serialized state, or a project-specific x- kind. Distinguish an attacker choosing data passed through a trusted callback from an attacker choosing the callback itself.

Also capture size/shape/rate assumptions (bounded? streaming? memory-mapped?), and flag any input whose magnitude drives resource allocation (memory, threads, file handles) — that feeds the §1.11 resource-property threshold.

Build the contract-dimension matrix (§1.7-§1.12)

For every in-scope component family, fill every applicable row. A blank cell is not allowed:

DimensionStatusConditions / boundaryRoutes toProvenance
numeric domain and representational limitsclaimed / disclaimed / N/A / unresolvedmaximum size, overflow behavior, normalization domain§1.11 / §1.12 / §1.18(inferred, QN) or cited documented/maintainer source
failure and exception atomicityclaimed / disclaimed / N/A / unresolvedstate after validation or callback failure§1.11 / §1.12 / §1.18(inferred, QN) or cited source
recursive or cyclic topologyclaimed / disclaimed / N/A / unresolvedself-reference, graph depth, reentrancy§1.11 / §1.12 / §1.18(inferred, QN) or cited source
callback and collaborator executionclaimed / disclaimed / N/A / unresolvedcomparator, predicate, factory, virtual dispatch§1.7 / §1.10 / §1.11 / §1.12 / §1.18(inferred, QN) or cited source
serialization and reconstructionclaimed / disclaimed / N/A / unresolvedrestored types, callbacks, invariant rebuilding§1.3 / §1.7 / §1.10 / §1.11 / §1.12 / §1.18(inferred, QN) or cited source
reference and object lifecycleclaimed / disclaimed / N/A / unresolvedweak/soft references, GC clearing, invalidation§1.5 / §1.11 / §1.12 / §1.18(inferred, QN) or cited source
concurrency and reentrancyclaimed / disclaimed / N/A / unresolvedshared mutation, callback reentry§1.5 / §1.11 / §1.12 / §1.18(inferred, QN) or cited source
resource complexityclaimed / disclaimed / N/A / unresolvedCPU, heap, stack, I/O as a function of input/state§1.7 / §1.11 / §1.12 / §1.18(inferred, QN) or cited source

Add project-type rows when needed, such as Unicode/canonicalization, probabilistic-result semantics, protocol state transitions, clock behavior, or distributed consistency. The matrix is a contract inventory, not a bug list. A demonstrably-absent guarantee is a disclaimed row with documented provenance; only a dimension where a guarantee might exist stays unresolved and becomes a proposed-answer question for the interview. A guarantee "might exist" when the project has historically fixed reports of that class, or when a documented guarantee already implies it — in that case narrow the claimed row rather than disclaiming. Record the disclaimer's conditions and tier (see §1.12): a disclaimer with no boundary is the one that over-closes, and the tier is the worst impact of a report the disclaimer would close.

For stateful APIs, explicitly record the postcondition on failure: unchanged, partially committed, best-effort cleanup, or unspecified. Cover failures from validation, allocation, caller callbacks, and delegated collaborator methods.

Build the no-surprise side-effects inventory (§1.5)

Scan for what the project does to its host, then state the negative claims: does it open sockets? spawn processes? install signal handlers? read environment variables? write to stdout/stderr? touch global locale or FPU state? mutate process-wide state?

Tag these by how good your scan was, not by a default. A negative here says no such behaviour was observed; the project has not promised to keep it that way, so it is a §1.5 inventory row rather than a documented contract:

  • (assumption, QN) when you scanned the shipped sources of the supported build exhaustively and found nothing. Name what you searched.
  • (inferred, QN) when the scan could not be exhaustive — hand-written assembly, generated code, dlopen or another dynamic dispatch, an #ifdef branch you did not read, or a dependency that could do it on the project's behalf. Name the specific hole in the question, so the maintainer knows what you could not see.

Do not pre-label the whole inventory inferred before scanning. A negative you actually verified across the supported build is worth more to a triager than a blanket hedge, and the difference is exactly what the maintainer is being asked to ratify.

Derive reachability preconditions (§1.4) and output taint (§1.8)

  • Per in-model family, state the condition a finding must meet to matter ("a finding in inflate.c is in-model only if reachable from the compressed input bytes"). This is the first test a triager applies to a tool/AI hit.
  • Per output channel, state taint. The default for parsers/decoders/decompressors is one line worth stating verbatim: "Output is exactly as untrusted as the input it derives from; no sanitization, normalization, or encoding is performed." Note any structural invariant the code actually upholds (bounded writes, valid encoding, matching length fields) — each is a candidate §1.11 property.

Output — surface analysis

Hand back: the §1.7 table (with coverage note if partial), the completed contract-dimension matrix, the §1.5 side-effects inventory, per-family §1.4 reachability preconditions, and §1.8 output-taint statements — each tagged with its actual provenance. Mark code-derived contract hypotheses (inferred, QN) and call out unresolved dimensions and wave-1/2 confirmation targets for threat-model-interview.

Preguntas frecuentes

¿Qué hace la habilidad de IA Threat Model Surface?

Realiza el análisis en profundidad de la fase 3.3 de una superficie de ataque incluida en el alcance de un modelo de amenazas. ÚSALO CUANDO el resumen de orientación esté listo y haya que leer el código para elaborar la tabla de confianza por entrada de §1.7 y la matriz de dimensiones del contrato, el inventario de efectos secundarios inesperados de §1.5, las condiciones previas de alcanzabilidad de §1.4 y la contaminación de resultados de §1.8. Lee los puntos de entrada públicos para analizar los contratos, no los defectos; limita el tiempo dedicado a cada familia de componentes e indica q...

¿Por qué usar Threat Model Surface en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Threat Model Surface está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Threat Model Surface en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/alpha-omega-security/threat-model/tree/main/skills/threat-model-surface. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Threat Model Surface?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Threat Model Surface?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Threat Model Surface con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Threat Model Surface?

Sí. alpha-omega-security la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇