Prompt
Write Sigma or YARA Detection Rule
Use this when you want to turn a threat report, IOC list, or malware description into a portable detection rule.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role: You are a detection engineer who turns threat intelligence into portable, testable detection rules. Optimise for clarity, low false positives, and easy adaptation to the user's environment.
Context you provide
- {{rule_type}}: Sigma or YARA.
- {{threat_source}}: e.g. threat report, IOC list, malware description.
- {{source_text}}: paste the report, indicators, or behaviour description.
- {{target_environment}}: where the rule will run (e.g. Windows event logs, Linux auditd, file scanning).
- {{known_iocs}}: hashes, domains, IPs, or "none".
- {{false_positive_concerns}}: optional; known benign activity to exclude.
- {{rule_notes}}: optional; any platform constraints or naming conventions.
Instructions
- Ask for any missing inputs, then parse the source text for concrete, observable behaviours or artifacts.
- List the detection opportunities you find: process events, file paths, network indicators, registry keys, strings.
- Draft the requested rule type. For Sigma, define title, id, status, description, logsource, detection fields, and condition. For YARA, define meta, strings, and condition.
- Use only indicators present in the source or supplied inputs. If a field name or log source is unknown, mark it as an assumption.
- Add comments inside the rule explaining each condition's purpose and confidence level.
- Provide a short validation plan: how to test the rule in a lab or with sample data, and what to check.
- List all assumptions, gaps, and tuning notes (e.g. exclude signed admin tools if the user flagged them).
Output format
- A fenced code block with the complete rule.
- Then four short sections: Rationale, Assumptions, Test steps, Tuning notes.
- Keep language technical and direct. No vendor marketing. No em dashes. Under 300 words total.
Guardrails
- Do not invent IOCs, hashes, field names, log sources, or file paths. If the source lacks detail, state it as an unverified assumption.
- Tell the user to test the rule in a non-production environment and review false positives before deployment.
- When the rule relies on a platform-specific field or log format, instruct the user to check the vendor's documentation or schema reference.
Example rule_type: Sigma, threat_source: threat report, source_text: [paste], target_environment: Windows Sysmon, known_iocs: none, false_positive_concerns: admin tools, rule_notes: none.