threat-detection

threat-detection is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 51 tokens per session (1,659 once invoked), scanned A, original, Apache-2.0.

A guide for proactively looking for security threats by starting with a specific hypothesis and checking system data for supporting evidence. It uses threat techniques and indicators to organise the investigation.

In plain words
What is it for?
Hunting for threats, analysing indicators of compromise, investigating unusual telemetry, and identifying detection gaps.
Why use it?
It helps uncover suspicious behaviour that automated controls missed and separates confirmed threats from false alarms or missing detections.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Hunting for threats, analysing indicators of compromise, investigating unusual telemetry, and identifying detection gaps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/threat-detection
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill threat-detection
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for threat-detection

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/threat-detection/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/threat-detection)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/threat-detection"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/threat-detection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for threat-detection

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/threat-detection"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/threat-detection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,659 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.01659
Opus 5.5 $0.00020 $0.00664
Sonnet 5.5 $0.00010 $0.00332
Haiku 4.5 $0.00005 $0.00166

Measured 2mo ago against content hash 56c882f46b19, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

threat-detection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/threat-detection/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Detect threats with tested, ATT&CK-mapped rules

A detection only counts if it fires on the attack and stays quiet on normal activity, and that can only be shown with sample events. In a Gaffer worktree you have the repo and whatever log samples the ticket supplies. You have no live SIEM or EDR. So the deliverables are detection-as-code (Sigma or the repo's rule format, with test events), security events emitted by the application so detections have something to match, and hunt packages (hypothesis, queries and findings over supplied data). Sources: MITRE ATT&CK, the Sigma specification and sigma-cli, Splunk's PEAK framework (Prepare, Execute, and Act with Knowledge), the Pyramid of Pain, OWASP Logging Vocabulary, and ASVS 5.0 V16. A declared incident belongs to the incident-response skill, and cloud misconfiguration to the cloud-security skill.

Procedure

  1. Frame the hypothesis (PEAK: Prepare). Write one sentence in the form: "An adversary performing ATT&CK technique T1110.003 password spraying against the login API would produce many authn_login_fail events for different accounts from one source within five minutes." Name the technique ID, the log source and the observable. "Look for anything suspicious" is not a hypothesis. Call search_lore for existing rules, log schemas, field mappings and known false-positive sources.
  2. Confirm the data exists. Find the log source and field names in the repo's log schema, logging code or the supplied samples. If the application does not emit the event yet, add it first, following the structured-logging-and-tracing skill and the OWASP vocabulary (authn_login_fail, authz_fail, session_use_after_expire, input_validation_fail, excess_rate_limit_exceeded). Include who, what, where and a UTC timestamp, and no secrets or unnecessary personal data. Missing telemetry is itself a finding.
  3. Prefer behaviour over indicators. On the Pyramid of Pain, hashes, IPs and domains are trivial for an attacker to change. Tools and TTPs are not. Write the rule against the technique's behaviour. IOC sweeps are a supplement:
    • Record each indicator's source, first-seen date and confidence, and drop stale or low-confidence ones. IP and domain indicators decay within weeks.
    • Defang indicators in docs and evidence (hxxp://evil[.]example).
    • Never resolve, browse or download an IOC, and never execute a sample.
  4. Write the rule (PEAK: Execute) in the repo's format, or as Sigma:
    • Include title, a UUID id, status: experimental for new rules, description, references, logsource, detection and condition.
    • Add falsepositives naming real benign causes, and a level from the spec (informational, low, medium, high or critical).
    • Tag it with attack.<tactic> and attack.tNNNN, for example attack.credential-access and attack.t1110.003.
    • Use thresholds and correlation instead of single-event matches where the technique is volumetric.
  5. Test the rule with events. For every rule, commit at least one true-positive sample (the attack) and one near-miss true-negative (the closest benign behaviour, for example one user mistyping a password three times). Then:
    • If sigma is on PATH, run sigma check <rules-dir>, and run sigma convert -t <backend> -p <pipeline> <rule> for the repo's backend (list them with sigma list targets and sigma list pipelines).
    • Run the repo's rule test harness, or a small test that evaluates the rule logic over the samples, and assert that the true positive matches and the negative does not.
    • Do not install tooling. If none exists, the sample-driven test is the evidence.
  6. Hunt over supplied data, when the ticket asks for one. Run the queries over the provided logs or exports only. Establish a per-entity baseline (logins per hour, destinations per host, bytes out per user) and flag outliers. Use a robust score (median and MAD) because security data is heavy-tailed. Corroborate every hit with a second, independent source before calling it malicious. If the hunt needs production telemetry you cannot reach, the deliverable is the hunt package (hypothesis, queries, expected results), and you raise request_decision so a human runs it.
  7. Close (PEAK: Act with Knowledge). Every hypothesis ends in exactly one outcome:
    • Confirmed activity: stop, record the evidence and raise request_decision with severity: security_required pointing at the incident-response skill. Do not remediate on your own.
    • Refuted: record the queries, the data window and why the hypothesis did not hold.
    • Detection gap: ship the new rule with its tests in this ticket, or state exactly what telemetry is missing.
  8. Evidence. Record the rule test output as test_output, plus a short hunt summary (hypothesis, ATT&CK IDs, data window, outcome), through the record-evidence skill, then stop.

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +40 lines · -17 tokens per session 56c882f46b19
  2. 3mo ago First seen · 73 lines · 68 tokens per session scan A e3619ec443c1

Subscribe to this mod's changes

threat-detection is a skill published in the GitHub repository tmj-90/gaffer (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 51 tokens to every session and 1,659 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

threat-detection compared with skills from other repositories

threat-detection next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
threat-detectiontmj-90/gafferSkill14d agoApache-2.0A51Claude Code, Codex
bulwark-brainstormQBall-Inc/the-bulwarkSkill9yesterdayMITA50Claude Code
plan-creationQBall-Inc/the-bulwarkSkill9yesterdayMITA38Claude Code
anthropic-validatorQBall-Inc/the-bulwarkSkill9yesterdayMITA40Claude Code
create-subagentQBall-Inc/the-bulwarkSkill9yesterdayMITA42Claude Code
test-auditQBall-Inc/the-bulwarkSkill9yesterdayMITA0Claude Code
code-reviewQBall-Inc/the-bulwarkSkill9yesterdayMITA61Claude Code